The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: Lord on December 26, 2006, 11:20:54 AM

Title: [RESOLVED]---events + sripts question
Post by: Lord on December 26, 2006, 11:20:54 AM
Hello!
I just started to use RPG Maker XP, so I'm somewhat of a newbie.
Here's my problem:

Quote from Troubleshooting - Zeriab's FAQ:

"You have made an error in the syntax from the call script. Please note that everyline will be interpreted as a new script, unless you have the fix for this."

Well, i made this, in the "Edit event" window :

Script: if @actors.size == 4
Call Common Event: party full
Exit Even processing
Script: End

According to the quoted FAQ, this won't work. Well, it really doesn't. :-)
"party full" is just a text message (for testing purposes) only. The the actor's array is used to remember the party, @actors.size tells it's size, if i got it correct when I checked in the script editor.
My real question is:

How does the "event compiler" work? Is there a way to mix the script commands with event commands?
Sorry, if it's a dumb question. :-)
Title: Re: events + sripts question
Post by: Sthrattoff on December 27, 2006, 12:54:56 AM
Alright, first of all...
Welcome to RMRK Community.

Let's get started,
the right script is ain't "@actors.size" but "$game_party.actors.size" is the right one.
And I guess you don't need to add the "Script : End".

Of course it can!
Just use the Call Script Command!
Title: Re: events + sripts question
Post by: Me™ on December 27, 2006, 12:15:05 PM
Oké, Sthrattoff please don't talk if you do not know the right answer -_-

@Lord, every line will be interpreted as a new script, created in the Interpreter class. The script is completed whne an other event code occrus then call script. In your case, there will be an syntaxt error, as the script if $game_party.size is not finished, but the call script is. When having such conditional codes, you are btter of with:

Conditional Branch : Script => $game_party.actors.size == 4
(see how I removed the if. The if is already given by the conditional branch)
Common Event: Party Full
(this line will be between the conditional branch and...)
Conditional Branch End
(...the conditional branch end)
Title: Re: events + sripts question
Post by: Lord on December 27, 2006, 08:30:33 PM
Well, thank's a lot, both of you.

In the question of syntax, Sthrattoff was right. "$game_party.actors.size" worked. Which, actually, makes a sense.
The "game_party" class has an "actors" array as a public property, what you can call with "$game_party.actors". And this array has a "size" method, as every array in every C++ based language (and the Ruby is one of them, if I'm not mistaken...)
The "game_party" class is not a simple array, so you can't call on a size method, because there isn't one defined. Well, if it was, it would be like:
"def size
return @actors.size
end"
This is the same, as using Sthratoff's method, just written in the main game script itself, instead of calling through that array (anyway, i checked it... if you insert the above into the "Game_Party" part in the Script Editor, "$game_party.size" will work fine.)

On the other hand, Me cleared my thoughts about the "Interpreter" class. Double thanks. (Geeez, interpreter as a class... how far can "object oriented programmers" go..? Perverts. :-D )

Oh, by the way, I don't write so much, because I want to be a smartass... If I'm wrong, please tell me. That's my intent...

Isn't there some reference to the classes and methodes used by the program (like the Java reference at Sun's website...)? There is something in the help, but it's pretty much useless...
Title: Re: events + sripts question
Post by: Me™ on December 28, 2006, 11:23:04 AM
No, you are right. I made myself a hundreds of shortcuts, like the size thing. I reallly don't like the way RMXP handles things, therefore in my game actors are like:

$database['actors'][0] (== $game_actors[0])
$database['party'].size (== $game_party.actors.size)

It really cuts off the memeory usage. That is why I accidently said that. And it was not that why I said Oké, Sthrattoff please don't talk if you do not know the right answer -_-. It was more like: Of course it can! Just use the Call Script Command!. That is not an answer is it? It is just rewritng the question.

Either way, the help file REALLY has much refrence. Check that first ^^. And if youre problem is solved, please press the edit button in your first post and put [RESOLVED] in front of it.
Title: Re: events + sripts question
Post by: Sthrattoff on December 28, 2006, 02:43:36 PM
Ooops...
I don't know if that's a "shortcut"
sorry....
Title: Re: [RESOLVED]---events + sripts question
Post by: Me™ on December 29, 2006, 06:48:09 PM
It is okay  ;8