Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Lag issue with parallel events

Hi, a little while ago, I asked for a method for checking to see if a character has a certain accessory equipped, then give that character an ability and remove it if the accessory is removed. Someone suggested a common parallel event that constantly checked what people have equipped. It worked great, except I now realize the constant checking it's doing is slowing my game to a crawl. I need a way around this. Can someone help?
 
In order to successfully use many parallell processes in conjuction with one another, you're going to have to introduce conditional branches in their use, so that, though they're constantly checking, most of the time this is process is simply "is this true? No...okay" or "Oh look I need to add +1 to a variable, cool, thats all".
Ideally, if you can, add some variables in there.

So your event should run:

-Have a conditional of Is Variable(x) != Variable(y)? Uncheck the box for 'if conditions don't apply' on this one.
--Now check your equipment with Is Character[Bob]= [Sexy Ring] Equipped?
---If yes, Does Bob have Skill [Sexy Ring Fireball]?
----If yes, Do Nothing
----If no, Add [Sexy Ring Fireball]
---If no, Does Bob have Skill [Sexy Ring Fireball]?
----If yes, Remove [Sexy Ring Fireball]
----If no, Do Nothing
--Irregardless of what happens above, Now put Control Variables Set (y) = (x)
-Finally, outside of the conditional, Set (x) to Player[Bob] Strength or something

Therefore, whenever this goes off, if Variables x and y are the same, it ignores everything except the final part, which sets x to Bobs Strength. So if Bob's Strength changes, it is no longer equal to the stored value of [y] and the skill alteration triggers. Change the reference to Strength to something that equipping the item changes (it might be INT, or something). This is the easiest way of only running the event when that persons equipment changed. It does assume that equipping something is going to alter a stat.

Alternatively, a more foolproof way would require that you delve into the Script for the equipment screen, force it change a switch everytime you're there, and control the common event that way. But thats a bit more intermediate.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top