Need help using Thallion's Event Template script

Started by d_a_renoir, August 12, 2022, 09:48:04 am

Previous topic - Next topic

d_a_renoir

August 12, 2022, 09:48:04 am Last Edit: August 12, 2022, 09:58:21 am by d_a_renoir
I'm a bit confused about how to use this script . The instructions is not clear.

I have made an event with <template> in it. Then is it possible to key in the event to be copy-pasted to all maps? Or do I still have to make a new event and call the script to duplicate the template event?

Incidentally I just tried playtesting from a save file and it gives me NoMethodError. The line in question says:
@saved_events[@map_id] ||= []

I suppose that means the script has not detected a template yet if I run from a save file? It doesn't occur when I start a new game, I just don't understand what to do with this script and how do I use the template?

Also if this is not the best script to use, if there's alternatives I'll take it too. What I need is to have a certain event to be copy-pasted into ALL maps, without having to manually copy-paste the event into all the maps. Preferrably if it could be scripted into the main scripts somewhere, it would be great.

KK20

Yeah, this script does not work with save files. You need to start a new game. Usually authors mention this in their post, but I guess he forgot.

And it depends on what you need copied to every map. Like is it not something you can use a Common Event for?

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!

d_a_renoir

Yes, but I need the common event to autorun as a parallel process in every map.
If I copy-paste the event, it would be a big trouble if I change something in the event. I would have to re-copy it again.
I'm assuming this script would still need an event in each map, except that it would just use the script to "run <template> event here".
If I can hard-wire the common event into the main script database itself it would be nicer, I imagine.

KK20

Yes, you will need to make the create_event_from_template script call each time on each map, whatever method you end up going with like making an autorun event on every map do it.

Again, the best method largely depends on what exactly it is you're trying to do. I can't give you any further advice without knowing.

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!

d_a_renoir

Ah I see. Well, what I'm trying to do is to have a common event that runs a parallel process checking for if a certain item exist in inventory (item is consumable). So if you sold or used up all of your stocks, it would trigger something to happen.

It seems to be tedious/inconvenient to have to paste this event in all of the maps.

KK20

That sounds fairly easy to do.
Conditional Branch: [Item] in inventory
  # Player gained an item, so prepare for when they run out of it again
  Control Switches: Switch = OFF
Else
  # This check is to ensure we don't fire off the event more than once
  Conditional Branch: Switch == OFF
    # Do your stuff here...
    Control Switches: Switch = ON
  END
END

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!

d_a_renoir

Quote from: KK20 on September 02, 2022, 08:04:20 pmThat sounds fairly easy to do.
Conditional Branch: [Item] in inventory
  # Player gained an item, so prepare for when they run out of it again
  Control Switches: Switch = OFF
Else
  # This check is to ensure we don't fire off the event more than once
  Conditional Branch: Switch == OFF
    # Do your stuff here...
    Control Switches: Switch = ON
  END
END

Thank you so much! Do I have to number the switch?
How do I tell the script to "Run common Event number X"?
Sorry, I'm not that well-versed with RGSS scripts

KK20

What do you mean by "number the switch"? It's just a "Control Switches" event command. I don't know what Switch IDs you're already using, so that's up to your discretion which ID you want to use.

As for running a common event, does it have to be a script call? There is a "Call Common Event" event command after all. But I thought the objective was to have the common event be a parallel process. You should just make its Trigger "Parallel" and choose a switch to enable it. The process is no different from any other RPG Maker...

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!