Chaos Project

RPG Maker => Tutorials => Topic started by: The Niche on May 24, 2010, 03:55:30 pm

Title: Changing the interface depending on the lead actor
Post by: The Niche on May 24, 2010, 03:55:30 pm
Ok, so last week I was a spriter, this week I'm an eventer. Amusing.
Anyway, in my game and, since you're reading this, yours as well, different actors have their own different abilities. This isn't exactly the easiest thing to do, however.

For the purpose of the tutorial, I'll be using the names of my characters. Hope you don't mind.

1) Ok, so make a common event. Nice name for it could be interface switch or something.

2) Insert a script call. In that script call, write the following.

$game_variables[pick whatever variable you want to use] = $game_party.actors[party position here. The first one is 0].name

3) Still in Interface switch, create a conditional branch checking if your variable is whatever you want.
This method doesn't work.

4)If it is, call the common events necessary for you interface changes.

Alternative method:

1) As above.

2) Make a conditional branch and go to the script option. In the box, put in this: $game_party.actors[0].id
id is the database ID of the character. [0 ] is the party position. 0 is, again, for the leader.

3) Same as step four above.

That concludes another tutorial!
Note: I have yyet to test this, but I will inform you as soon as I do (which will be very soon).
Title: Re: Changing the interface depending on the lead actor
Post by: SBR* on May 25, 2010, 01:49:09 pm
Quote from: The Niche on May 24, 2010, 03:55:30 pm
Ok, so last week I was a spriter, this week I'm an eventer. Amusing.
Anyway, in my game and, since you're reading this, yours as well, different actors have their own different abilities. This isn't exactly the easiest thing to do, however.

For the purpose of the tutorial, I'll be using the names of my characters. Hope you don't mind.

1) Ok, so make a common event. Nice name for it could be interface switch or something.

2) Insert a script call. In that script call, write the following.

$game_variables[pick whatever variable you want to use] = $game_party.actors[party position here. The first one is 0].name

3) Still in Interface switch, create a conditional branch checking if your variable is whatever you want.

4)If it is, call the common events necessary for you interface changes.

That concludes another tutorial!
Note: I have yyet to test this, but I will inform you as soon as I do (which will be very soon).


$game_party.actors[0].name == 'NAME'
is shorter.
Title: Re: Changing the interface depending on the lead actor
Post by: The Niche on May 25, 2010, 01:52:13 pm
For the branch or the setting?
Title: Re: Changing the interface depending on the lead actor
Post by: nathmatt on May 25, 2010, 02:00:45 pm
hes saying there is no reason to store it in $game_variables when you can just use the the method as a condition you can also do this if you want to do it for the lead actor
case $game_party[0].name
when 'name' then call
end

so if i want to see if Jack is the main actor i use
case $game_party[0].name
when 'Jack' then the call
end
Title: Re: Changing the interface depending on the lead actor
Post by: The Niche on May 25, 2010, 03:17:18 pm
I might try this. I might indeed.
Title: Re: Changing the interface depending on the lead actor
Post by: SBR* on May 25, 2010, 03:27:25 pm
Quote from: nathmatt on May 25, 2010, 02:00:45 pm
hes saying there is no reason to store it in $game_variables when you can just use the the method as a condition you can also do this if you want to do it for the lead actor
case $game_party[0].name
when 'name' then call
end

so if i want to see if Jack is the main actor i use
case $game_party[0].name
when 'Jack' then the call
end



Yeah, there are tons of ways to make this kind of script.
Title: Re: Changing the interface depending on the lead actor
Post by: The Niche on May 25, 2010, 03:57:35 pm
True. But it's not so easy to figure out, so I decided to show people how to do it.
Title: Re: Changing the interface depending on the lead actor
Post by: SBR* on May 26, 2010, 02:16:42 pm
$game_party.actors[0].id
would be even better, because this way you can change the name in-game and still have this unaffected. BTW, id is the actor id in the database.

Also, don't forget to say that you compare things by using two =-signs, so ==. The name is also a string (something between apostrophes, like 'Arshes'). The id is typed regularly, so the id of Arshes is 0 (do the id's start at 0?).
Title: Re: Changing the interface depending on the lead actor
Post by: The Niche on May 27, 2010, 04:57:19 am
K, that's also worth including.
Title: Re: Changing the interface depending on the lead actor
Post by: SBR* on May 27, 2010, 02:51:34 pm
Quote from: The Niche on May 27, 2010, 04:57:19 am
K, that's also worth including.


Of course I meant
$game_party.actors[0].id
and not
$game_party[0].id
. Sorry :P!
Title: Re: Changing the interface depending on the lead actor
Post by: Mikhail on May 29, 2010, 01:26:19 pm
Quote from: SBR* on May 26, 2010, 02:16:42 pm
The id is typed regularly, so the id of Arshes is 0 (do the id's start at 0?).


The IDs start at one, but in an array, arguments start at 0.
Title: Re: Changing the interface depending on the lead actor
Post by: SBR* on May 29, 2010, 01:40:47 pm
Quote from: Mikhail on May 29, 2010, 01:26:19 pm
Quote from: SBR* on May 26, 2010, 02:16:42 pm
The id is typed regularly, so the id of Arshes is 0 (do the id's start at 0?).


The IDs start at one, but in an array, arguments start at 0.


I know, but in the database... *goes to database* OH FUCK! Sorry... I thought they started at 0 in the database :P.
Title: Re: Changing the interface depending on the lead actor
Post by: Mikhail on May 29, 2010, 01:54:46 pm
Quote from: SBR* on May 29, 2010, 01:40:47 pm
Quote from: Mikhail on May 29, 2010, 01:26:19 pm

The IDs start at one, but in an array, arguments start at 0.


I know, but in the database... *goes to database* OH FUCK! Sorry... I thought they started at 0 in the database :P.
If only.... wait, hang on a sec:

I also wished that the switches and Variables started at zero, but then there wouldn't be any "Global Settings" options in scripts because all of the arguments would return true for a specific actor and not the whole array.
Title: Re: Changing the interface depending on the lead actor
Post by: SBR* on May 29, 2010, 01:58:46 pm
Quote from: Mikhail on May 29, 2010, 01:54:46 pm
Quote from: SBR* on May 29, 2010, 01:40:47 pm
Quote from: Mikhail on May 29, 2010, 01:26:19 pm

The IDs start at one, but in an array, arguments start at 0.


I know, but in the database... *goes to database* OH FUCK! Sorry... I thought they started at 0 in the database :P.
If only.... wait, hang on a sec:

I also wished that the switches and Variables started at zero, but then there wouldn't be any "Global Settings" options in scripts because all of the arguments would return true for a specific actor and not the whole array.


I don't get a fuck of that.
Title: Re: Changing the interface depending on the lead actor
Post by: Mikhail on May 29, 2010, 02:02:53 pm
Quote from: SBR* on May 29, 2010, 01:58:46 pm
Quote from: Mikhail on May 29, 2010, 01:54:46 pm
Quote from: SBR* on May 29, 2010, 01:40:47 pm
Quote from: Mikhail on May 29, 2010, 01:26:19 pm

The IDs start at one, but in an array, arguments start at 0.


I know, but in the database... *goes to database* OH FUCK! Sorry... I thought they started at 0 in the database :P.
If only.... wait, hang on a sec:

I also wished that the switches and Variables started at zero, but then there wouldn't be any "Global Settings" options in scripts because all of the arguments would return true for a specific actor and not the whole array.


I don't get a fuck of that.
It has to do with how the scripts will work (like setting custom level caps for different actors in a special script by Woratana, etc.) and if Zero had an actor assigned to it, it would screw up the default settings for undefined arguments/elements (in this case, actors) and you'd have to do more work to configure custom scripts that mess with database stuff.
Title: Re: Changing the interface depending on the lead actor
Post by: SBR* on May 29, 2010, 05:12:52 pm
Hmm, I understand that, but I don't understand what you said before that...
Title: Re: Changing the interface depending on the lead actor
Post by: Mikhail on May 29, 2010, 05:22:05 pm
Quote from: SBR* on May 29, 2010, 05:12:52 pm
Hmm, I understand that, but I don't understand what you said before that...
I'm just saying it would be really hard to script if database items started at zero, because these items would be a bit more difficult to count/process due to the properties that zero takes in a database-altering script (editing weapons beyond the database editor, etc.)
Title: Re: Changing the interface depending on the lead actor
Post by: SBR* on May 30, 2010, 04:30:20 am
Ohhhhhhh... I don't get it. So you use 0 to store temporary data in?
Title: Re: Changing the interface depending on the lead actor
Post by: Mikhail on May 30, 2010, 12:03:08 pm
Quote from: SBR* on May 30, 2010, 04:30:20 am
Ohhhhhhh... I don't get it. So you use 0 to store temporary data in?
Something like that.