I tried to read for an answer, but the nearly 99 pages intimidated me after awhile.....
I am trying to compare the new position of an event to the position of the player with this line of script
$game_player.x==$game_map.events[EV001].x&&$game_player.y==$game_map.events[EV001]y
doesn't work
But I am wondering if there is a way to replace the EV001 event ID with a generic THIS EVENT term, so I can copy the event.
I need fifteen of the puppies.
So I am assuming that the @event_id means "this event" ???
$game_player.x==$game_map.events[@event_id].x&&$game_player.y==$game_map.events[@event_id]y
Please and thank you.
/humiliated
not even for the event. Just for that one script call.
If you have it as a conditional branch script, as soon as the conditional branch is checked, p and e are no longer defined. If you have it as a Script command, as soon as the script command has finished executing, they are no longer defined.
If you want to have them remain for the event, you would need to define them as @p and @e
Might want to add:
As Shaz mentioned, variables starting with @ will last throughout the event. However, in VXAce these variables will not be restored when you load a savestate, so you should be careful when using them in parallel process events.
Are you sure? $game_map contains all the events, doesn't it? When you load a saved game, it just continues (which is why all the events are in the same place as they were when you saved, and not reset). It doesn't do Game_Event.new() on all of them again, does it? It's only at that point they'd be cleared.
I would have to look at exactly what happens with events when a game is loaded to be sure.
If the event is on the current map, then the event is saved into $game_map, which means the instance variable should also be saved.
The only time that this would not be the case is if you're still making the game or giving updates for it. Why? Because if the internal version of the game becomes different than the registered version in the save file (the internal version automatically increases when saving the project), the map is reloaded to take into account the changes made in the editor... And in that case, the variable would be gone.
Uh, sorry, might have been a bit unclear... ^^
The restoration problem only exists for instance variables added to the interpreter object (for example by using @e instead of e within a script command) because of the special treatment given to interpreter objects when serializing them.
As Marshal can't handle an interpreters Fiber object, only a few instance variables are actually saved and restored while custom instance variables are abandoned. I don't have access to the maker right now but you can look up the definition of marshal_dump within the Game_Interpreter script for details.
For similar reasons, commands that control the interpreter for more than one frame are also canceled when loading a savestate. That affects the "Call Common Event" command as well as effects that cause the interpreter to wait.
Normally if I need to "wait" in my scripts, I kind of make a wait method that is similar to those used in like Scene_Battle in which during a "wait" it only updates the basics while keeping everything else the same. So like I activate a switch then in the update method of the script, if the switch is ON then it uses only the "wait" update instead of the full update.
PS: The actual reason why I first used this method was because I tried to use Fiber.yield and somehow could not make it work so I had to find an alternative way.
def marshal_dump [@depth, @map_id, @event_id, @list, @index + 1, @branch] endThat @index + 1 was the culprit. However, if you remove the + 1, everthing will goes wrong.
It makes that everytime you load the game, the event index will advanced to the next command. I forgot the reason.
I'm fans of Fiber, even my battle system uses Fiber. So, my alternative would be inserting wait command using script as much as the wait frame.
Probably it assumes that upon saving, the current command is already processed so you would already be going into the next command by the time the save finishes / the file is loaded. Which would be true for most cases.
You could try that grandmadeb - leave out the 00 at the front though - just use 1 and 2.
Make sure your events are all numbered 1-15.
If you need more help, go ahead and post in that tutorial thread 🙂
For the alignment, you need to insert this into your window class:
def alignment return x endReplace 'x' with 0 for left alignment, 1 for middle, and 2 for right alignment.For the square symbol thing...
As far as I encountered it, it happens with certain font types only.
There is a snippet (like you mentioned) which should fix this, at least it did fix the issue for me.
It was a really small snippet and can be found here somewhere in a pinned topic.
If you added that to your script list and the issue still remains, than I have no idea what can be done about it, sorry.