Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: Shadonking on February 19, 2009, 06:32:40 am

Title: [RESOLVED]script commands
Post by: Shadonking on February 19, 2009, 06:32:40 am
I need the script command to turn on a status effect. done

edit

the script command that is simulare to this

for i in 1...$data_items.size

but instead of all items from id 1 and above to stand for "i" i want items from 1 - 22 to be "i"

Title: Re: script commands
Post by: shdwlink1993 on February 19, 2009, 07:07:21 am
Status Effect? Like a status ailment?

Try this:
$game_actors[$game_party.actors[actor_id]].add_state(state_id)


That should do it.
Title: Re: script commands
Post by: Shadonking on February 19, 2009, 07:27:36 am
i got an error,

Game_Actor line 20 no methonerror occurred
Title: Re: script commands
Post by: Blizzard on February 20, 2009, 04:17:08 am
Lol!

$game_actors[actor_id].add_state(state_id)

$game_party.actors[position].add_state(state_id)

Title: Re: script commands
Post by: Shadonking on February 20, 2009, 06:51:43 am
ok just tried your code blizz and i got an error.

undefined method 'state_add'
Title: Re: script commands
Post by: Blizzard on February 20, 2009, 07:35:38 am
Quote from: Blizzard on February 20, 2009, 04:17:08 am
...add_state...



Let's see if you can figure it out on your own. :P
Title: Re: script commands
Post by: Shadonking on February 20, 2009, 08:51:11 am
lol, thats what i put i just put it wrong in the post.

$game_party.actors[1].add_state(17)

see thats what iv put
Title: Re: script commands
Post by: G_G on February 20, 2009, 09:17:27 am
How many people are in your party? When it regers to
$game_party
the placement is like this
First Person = 0
Second Person = 1
Third Person = 2
Fourth Person = 3
Title: Re: script commands
Post by: Shadonking on February 20, 2009, 11:40:57 am
if thats the case, then i now what iv done wrong. i'll tell you if i was in a sec

edit

yep i was wrong, i put 1 where 0 should be.

thanks blizz, game_guy and shdw.

edit

i need a script command that is simulare to this

for i in 1...$data_items.size

but instead of all items from id 1 and above to stand for "i" i want items from 1 - 22 to be "i"
Title: Re: script commands
Post by: G_G on February 20, 2009, 05:32:03 pm
for i in 1...22 try that
Title: Re: script commands
Post by: Aqua on February 20, 2009, 05:36:02 pm
If you want 1-22 INCLUDING 22, then you use
for i in 1..22


There's a difference between 1..22 & 1...22
Title: Re: script commands
Post by: Shadonking on February 20, 2009, 06:03:30 pm
thanks aqua it worked

what would 1...22 do. just wondering
Title: Re: script commands
Post by: G_G on February 20, 2009, 06:05:12 pm
I didnt mean to press the . three times it was an accident
Title: Re: script commands
Post by: shdwlink1993 on February 20, 2009, 06:38:47 pm
for i in 1..22 means it does the thing starting with 1 and INCLUDING 22. if you had 1...22, it excludes the last term, so it ends on 21.
Title: Re: script commands
Post by: Shadonking on February 21, 2009, 04:34:12 am
i see thanks. yay i know a little pit more about scripting (i know its not much put its a start  :haha: )
Title: Re: [RESOLVED]script commands
Post by: Blizzard on February 21, 2009, 05:19:47 am
Lol, sorry, I thought you knew about 0 being the first position. xD It's a bit hard to keep track of who knows how much scripting here at the forums.
Title: Re: [RESOLVED]script commands
Post by: Shadonking on February 21, 2009, 06:40:38 am
its ok, i would have figured it out it some point  :haha:.