wishy Posted March 11, 2020 Share Posted March 11, 2020 Gonna do an attempt at showing you how to use string variables for a basic eventsystem which can easily be copy/pasted instead of having to make and edit a bunch of variables and events each time.  Here's a video of the result: Spoiler   1. Create a global variable, make sure it's a string and empty Spoiler  2. Create a map event, rename it (name must be unique per event) 3. Assign an animation or sprite to it 4. Add an event that sets the global variable (set in step 1) to \gv{nameofglobalvariable}\evtparam{evtName}- (This will change the global variable to the current content of the variable + "1-", basically adding the name of the event to the current string) Spoiler 5. Click Spawn/Execution Conditions 6. Click Add List > Add Condition 7. Check the global variable set in step 1, check if it doesn't contain (Negated) \evtparam{evtName}- So anytime the global variable doesn't contain the name of the event, this page will trigger.  Spoiler  8. Copy/paste this page, change the sprite or animation and uncheck the negated condition Spoiler  9. Change the event to set the global variable (set in step 1) to Find \evtparam{evtName}- and Replace it with an empty string.  (this will remove the event name from the global variable)  Spoiler  10. Now you can copy/paste this event anywhere in your game, the only thing you need to do is change the event name to a unique name  full video of this tutorial:  Manigold, Skuding, Shenmue and 4 others 6 1 Link to comment Share on other sites More sharing options...
AisenArvalis Posted March 11, 2020 Share Posted March 11, 2020 I have to ask, what is the point of this? It could easily be replicated just using self switches instead. Link to comment Share on other sites More sharing options...
wishy Posted March 11, 2020 Author Share Posted March 11, 2020 22 minutes ago, AisenArvalis said: I have to ask, what is the point of this? It could easily be replicated just using self switches instead. There's many possibilities for this, it's just an example that indead replicates switches, but without the need of having to make and edit a bunch of variables/switches and events each time. (says so literally in the first line of the tutorial) You can only do a limited amount with self switches, this is more extendable, you can add character names, map names, positions etc...  I use this logic for all my housing, interior options, farms, doors, etc... Link to comment Share on other sites More sharing options...
wishy Posted March 11, 2020 Author Share Posted March 11, 2020 @AisenArvalisHere's an extended example of the above tutorial, hope it's a bit clearer now: Â I should probably add that it's better practice to have condition contain a special character (adding a - at the end when you add strings and a - in front of the condition for example), like this: this way, the condition does not trigger if a player should happen to have the same name as your event, because data in the string is stored like this for the above example: "eventname1:playername-eventname2:playername2-eventname3:playername" Â Why? because playernames can't have special characters Worldofjimmy and XTRS 2 Link to comment Share on other sites More sharing options...
Worldofjimmy Posted May 2, 2020 Share Posted May 2, 2020 Just found this tutorial and must say that it is brilliant wishy 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now