Testing yet another script,... for Page Script Conditions

Started by Heretic86, August 08, 2016, 09:17:20 am

Previous topic - Next topic

Heretic86

Anyone care to take a look?  Im testing right now, see if there are any real nasty bugs or compatability stuff that needs to get fixed.

Basically, instead of having to change Switches around to make certain Event Pages active, this allows you to do the same thing by using a Script as a Page Condition.  I found it is actually a hell of a lot easier than creating a Parallel Event, then using Conditional Branches, changing a Switch, Variable or Self Switch.

Example:
@>Comment: Condition: $game_player.direction != 2

Example 2:
@>Comment: Condition: i = $game_system.map_interpreter
                      i.running?

I know it isnt exactly "efficient", but it will make things easier, especially during script development processes.  I just want to test this before releasing and get some feedback on it.

Suggestions?  Compatibility issues?  Better-er code?



Edit: Okay, I changed a few things...
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

KK20

Can start off with your regex being incorrect. It's only getting the first character immediately after Condition:, which in this case is just a whitespace. Should be
Condition: (.*)

Also you want to use 'break' instead of 'next' when you want to move onto the next page. Right now, you're just moving onto the next event command.

I see you're only limited to 6 lines (maximum a comment allows). For most cases, people probably won't use that many, but you may never know.

Unfortunate you have to make the hash key the condition itself, but I don't know if there's a better way at the moment.

For some reason, I thought this script already existed. And I didn't expect it to be this many lines.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Heretic86

Yep, I read the wrong regex code.

a?    Zero or one of a
a*    Zero or more of a

Tired I guess.

I thought about the hash key as the condition itself, it was the only way I could think of to get line 104 of Game_Event to check that Self Switch.  Object ID was out because of save games.  I did not want to replace the Game_Event Refresh method, so I was quite stuck at modifying the values of the existing code.  The only thing I could think of was to replace self_switch_ch from a property to a method, which is where I was afraid that major compatibility issues would have come from.

I had thought about using the Page as part of the Hash Key, but didnt.  Not sure if Objects that get that large affect performance of Hash Selections.  Hash Key is Map ID, Event ID and Script, and also stored in Self Switches.  Had to do that so Game_Event Refresh method remained unaltered.  :(

I changed the comments to allow multiple conditions per page, since they are stored in an array and left it as "next" instead of "break".  I thought about that Maximum and decided to pull the limitation.  Thus, multiple Comments can each be their own page condition.  Also, if people are running Scripts anyway, they most likely know a little about how to script.  So they can write their own methods and toss that into the Comment Box instead of needing to try to put the whole method inside the Comment box.  Kind of like Passable?  Use the method instead of all the code.  Which was kind of the point of this script. 

Page Conditions should now have absolutely NO LIMITS.

I didnt put any limits on number of lines either since the code to check that runs only once a map is loaded.  If I need to use regex any time an Event is refreshed, I do put limiters on how many comments get scanned due to the volume of checking.  As is the case with Modular Passable scripts, there ends up being almost a hundred checks per comment, and that could get nasty on performance.

And the script was a lot smaller without any documentation, about a page and a half.

I also looked and didnt see another script that did this either, as far as I know.  Similar stuff, like More Self Switches, and others that I wrote, one by Little Drago, etc.  Im also only looking here on Chaos Project...

Any other suggestions?  Comments?  Concerns?  Issues with Compatibility?
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Heretic86

Do you think I should prevent Events from being Refreshed if they are running?
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

KK20


Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Heretic86

I thought about it some.  Erased events wont evaluate, and I added an Option to skip evaluation for it.
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)