Changing the interface depending on the lead actor

Started by The Niche, May 24, 2010, 03:55:30 pm

Previous topic - Next topic

The Niche

May 24, 2010, 03:55:30 pm Last Edit: July 20, 2010, 11:10:21 pm by The Niche
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).
Level me down, I'm trying to become the anti-blizz!
Quote from: winkio on June 15, 2011, 07:30:23 pm
Ah, excellent.  You liked my amusing sideshow, yes?  I'm just a simple fool, my wit entertains the wise, and my wisdom fools the fools.



I'm like the bible, widely hated and beautifully quotable.

Dropbox is this way, not any other way!

SBR*

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.

The Niche

Level me down, I'm trying to become the anti-blizz!
Quote from: winkio on June 15, 2011, 07:30:23 pm
Ah, excellent.  You liked my amusing sideshow, yes?  I'm just a simple fool, my wit entertains the wise, and my wisdom fools the fools.



I'm like the bible, widely hated and beautifully quotable.

Dropbox is this way, not any other way!

nathmatt

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
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


The Niche

Level me down, I'm trying to become the anti-blizz!
Quote from: winkio on June 15, 2011, 07:30:23 pm
Ah, excellent.  You liked my amusing sideshow, yes?  I'm just a simple fool, my wit entertains the wise, and my wisdom fools the fools.



I'm like the bible, widely hated and beautifully quotable.

Dropbox is this way, not any other way!

SBR*

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.

The Niche

True. But it's not so easy to figure out, so I decided to show people how to do it.
Level me down, I'm trying to become the anti-blizz!
Quote from: winkio on June 15, 2011, 07:30:23 pm
Ah, excellent.  You liked my amusing sideshow, yes?  I'm just a simple fool, my wit entertains the wise, and my wisdom fools the fools.



I'm like the bible, widely hated and beautifully quotable.

Dropbox is this way, not any other way!

SBR*

$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?).

The Niche

Level me down, I'm trying to become the anti-blizz!
Quote from: winkio on June 15, 2011, 07:30:23 pm
Ah, excellent.  You liked my amusing sideshow, yes?  I'm just a simple fool, my wit entertains the wise, and my wisdom fools the fools.



I'm like the bible, widely hated and beautifully quotable.

Dropbox is this way, not any other way!

SBR*

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!

Mikhail

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.

SBR*

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.

Mikhail

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.

SBR*

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.

Mikhail

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.

SBR*

Hmm, I understand that, but I don't understand what you said before that...

Mikhail

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.)

SBR*

Ohhhhhhh... I don't get it. So you use 0 to store temporary data in?

Mikhail

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.