[RMVX ACE] [NEED HELP] HOW TO MAKE AN EVENT FACE SAME DIRECTION OF OTHER EVENT WITHOUT TEDIOUS CONDITION BRANCHES?

Posts

Pages: 1
I want an even to face the player, then make other events face the same direction of the first event, without creating long conditional branches.

Simply telling all of the events to face the player leaves room for an event to look a different direction from all the other events (since the player will be moving around), which will ruin the effect.

I've tried



but get this error

pianotm
The TM is for Totally Magical.
32388
I don't see how you'll do that without conditional branches. I also don't see how they would be tedious. All each event requires is one conditional branch that says, if down button is pressed (or if player faces down), event face down.
if event 1 is facing down
face event 2 down
face event 3 down
face event 4 down

if event 1 facing left
face event 2 left
face event 3 left
face event 4 left

etc...

I've explained this somewhat out of context, as each event are actually parts of 1 monster, and each need to move in unison, being controlled by a separate process.

I've already developed a work around, but I can't figure out why $game_map.events[2].direction = (whatever)is producing this error.
I'd say because there was an error with line 1411 in the Game Interpreter. If you open the script database it should instantly jump to the issue in question - it's handy like that.

But we don't know what you've done to the script. Maybe there's no directional facing if the event is turned off, so it's looking for something that doesn't exist, thus the issue?
SunflowerGames
The most beautiful user on RMN!
13323

Screen shot of the map and what your trying to do.
I don't really understand what you want in your final result.

Sounds like you need a parallel process event that checks the players X/Y.
Based on the X/Y you can change what the other events are doing.

He has a very large sprite that is broken up in to pieces, thus making it a bunch of events. He wants to be able to move them around, thus when they face x he wants all of the events to face x.


Come to think of it, is there a reason you're not just using the default ability to use whatever sprite size you want as long as it's by itself in a charaset and has the $ at the front of it? Because that is a thing you can do. Check out the RTP large enemy sets to see better, or the gate ones. Hell, any of them that have $ at the front of the file name.
Marrend
Guardian of the Description Thread
21781
Line 1411 in Game_Interpreter is the least useful line to go to, ever. The issue is probably with the script that is screen-shotted.

Now, I haven't completely tested this, but, it seems to me that the script you want to use might look something more like...

$game_map.events[2].set_direction($game_map.events[1].direction)

...that?

*Edit: The issue is that "direction" is a class-variable of Game_CharacterBase (of which Game_Events is a child of) that cannot be directly assigned values like it is shown in the OP. It needs a function to access it, such as "direction=(value)" (which would/could allow for the code shown in the OP) or something like this "set_direction(d)" function.

Well, probably!
author=Marrend
*Edit: The issue is that "direction" is a class-variable of Game_CharacterBase (of which Game_Events is a child of) that cannot be directly assigned values like it is shown in the OP. It needs a function to access it, such as "direction=(value)" (which would/could allow for the code shown in the OP) or something like this "set_direction(d)" function.

GOTCHA!

Changing line 27 of Game_CharacterBase from "attr_reader" to "attr_accessor" did the trick!

"attr_accessor :direction # direction"

I had considered that earlier but didn't try it for an unknown reason... Oh well, thanks for the help guys!
Pages: 1