Author Topic: Testing yet another script,... for Page Script Conditions  (Read 443 times)

Offline Heretic86

  • Astral Trancist
  • *****
  • Posts: 724
  • LV: 29
    • View Profile
Testing yet another script,... for Page Script Conditions
« on: August 08, 2016, 03:17:20 PM »
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?

(click to show/hide)

Edit: Okay, I changed a few things...
« Last Edit: August 12, 2016, 12:20:52 AM by Heretic86 »
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.)

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Lexima Warrior
  • ****
  • Posts: 2900
  • LV: 365
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: Testing yet another script,... for Page Script Conditions
« Reply #1 on: August 08, 2016, 09:53:46 PM »
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.
« Last Edit: August 08, 2016, 10:04:49 PM by KK20 »



(click to show/hide)
NNID: KK20-CP

Offline Heretic86

  • Astral Trancist
  • *****
  • Posts: 724
  • LV: 29
    • View Profile
Re: Testing yet another script,... for Page Script Conditions
« Reply #2 on: August 09, 2016, 12:42:18 AM »
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.)

Offline Heretic86

  • Astral Trancist
  • *****
  • Posts: 724
  • LV: 29
    • View Profile
Re: Testing yet another script,... for Page Script Conditions
« Reply #3 on: August 09, 2016, 10:43:03 AM »
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.)

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Lexima Warrior
  • ****
  • Posts: 2900
  • LV: 365
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: Testing yet another script,... for Page Script Conditions
« Reply #4 on: August 09, 2016, 06:52:29 PM »
If that's how it works normally, then yes.



(click to show/hide)
NNID: KK20-CP

Offline Heretic86

  • Astral Trancist
  • *****
  • Posts: 724
  • LV: 29
    • View Profile
Re: Testing yet another script,... for Page Script Conditions
« Reply #5 on: August 10, 2016, 02:40:56 AM »
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.)