Help - Search - Members - Calendar
Full Version: In need of help with a script condition
RPG RPG Revolution Forums > Game Engines > RPG Maker XP Discussion
Real Ninjason
Good day,

I am trying to create a common event that's conditioned with the information of which Player being the leader of the Group.

So I thought like:

If Player [010] is Leader of the Group, say: "Hey, Player 10, how are you?"

Something like that.


That's what I managed so far:

$game_actor[10].position = 0

But there seems to be something wrong with the condition, only I cannot figure it out, since I don't excel at scripting.

I'd be grateful for any help.
Jens of Zanicuud
If you're planning to build a condition, you'll need this: (I assume you're using RMVXACE)

CODE
$game_actor[10].position == 0


Remeber that in Ruby, the operator "=" assigns a value to the variable, while the operator "==" compares two things.
You've actually written "set game actor[10] position to 0" and not "tell me if actor position is 0".
I think this is a useful thing to know smile.gif

Anyway, I've another idea to do what you want to:

call script:
CODE
$game_variables[1] = $game_party.actors[0].id


WARNING: this method works in RMXP, I don't know if RMVXACE uses the very same method (I hope so).

This way, you store the first party member id into a variable (in the example, variable #1)
Then...

condition: if Variable[1] == 10
[...]
else
if Variable[1] == 3
[...]
else
if Variable[1] == 10
[...]
else
[...]
end
end
end

I hope this can help...

Jens
Legacy
It would help us out if you specified the engine that you are using.. Either way, you can look at The Law G14's tutorial on controlling flow.

http://www.rpgrevolution.com/forums/index....showtopic=57020

hope that helps smile.gif
Real Ninjason
Not to sound cocky, but I am wondering why you are asking for my Engine, since I did post it in the RMXP Discussion.

But I do use the RPG Maker XP.

I will have a look at your Link, Legacy, and thank you for your detailed post, Jens - but is they still valid for me, not using VAce?
Jens of Zanicuud
QUOTE (Real Ninjason @ Aug 19 2012, 05:45 PM) *
Not to sound cocky, but I am wondering why you are asking for my Engine, since I did post it in the RMXP Discussion.

But I do use the RPG Maker XP.

I will have a look at your Link, Legacy, and thank you for your detailed post, Jens - but is they still valid for me, not using VAce?


Okay, simply use the second method. I have only RMXP, but never seen that (.position) method.
Anyway, if you use the second method, you'll be able to do that.
In my project there's exactly that system implemented.

Two ways to do that:

A condition like that:
CODE
$game_actor[10].index == 0


or the second method I've mentioned before:

call script:

[code]$game_variables[1] = $game_party.actors[0].id[/code

This way, you store the first party member id into a variable (in the example, variable #1)
Then...

condition: if Variable[1] == 10
[...]
else
if Variable[1] == 3
[...]
else
if Variable[1] == 10
[...]
else
[...]
end
end
end

I hope this can help,

Jens
Real Ninjason
QUOTE (Jens of Zanicuud @ Aug 19 2012, 07:53 PM) *
A condition like that:
CODE
$game_actor[10].index == 0


That gives me a:


But I understood and successfully implemented your second Method - thank you very much.

Jens of Zanicuud
I'm glad it worked smile.gif
I forgot a "s" ($game_actor instead of $game_actors) and that caused your bug...
I apologise,

Jens
Real Ninjason
Hmm I have set every palyable Character in the Variable already, otherwise I would try your other method - but it works and I was told never to mess up a working system.

So thank you again.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.