• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Final touches on a map

Status
Not open for further replies.
Level 14
Joined
Aug 30, 2004
Messages
909
I'm finishing up my first map for release and am getting very excited about it.

One thing I thought I should consider is freeing up some memory and such because there are over 450 triggers and some of them run very very frequently (i.e. custom move system).

I seem to recall there being a custom script action that allows me to destroy triggers that will never run again.

My questions:

1. Is there a custom script that I could call to destroy, for example, a trigger called: Initialize? (please type exactly as I don't know JASS and just use custom script lines exactly as given to me).
2. If so, would destroying triggers save much memory or processing speed or whatever resources I might run low on?

Thanks
 
Level 14
Joined
Aug 30, 2004
Messages
909
Using GUI it's:
  • Custom script: call DestroyTrigger(<trigger here>)
To get global trigger's name simply convert the code into custom text and see in initialization function (at the bottom) whats the name of given trigger.

For final touches about saving up some memory I recommend reading this and this.

Excellent thanks. I think I will destroy my intro triggers at least, and I'll look into that widgetizer as well.
 
Destroying triggers that have waits in them can cause big problems just so you know. It's
better to use "Trigger - Turn off (This trigger)" in those cases.

I recommend letting someone review your map and let you know if some things can be
compressed. "Enters region" events well you can't combine those but you can combine
things like "generic unit event" triggers.
 
Level 14
Joined
Aug 30, 2004
Messages
909
Unless there are current, noticeable problems in-game from using all of those triggers, you should avoid destroying triggers that don't need to be run again.

Why is that? Bribe's comment above had me scared... I wouldn't have thought to ignore triggers with waits in them for whatever reason. The real issue I suppose is the repeated triggers that run the custom movement system. And I can't get rid of those. I was just thinking about deleting the introduction triggers and some event triggers after events.

I do have one question I suppose, about combining triggers:

I have 4-5 triggers that run off of repeated timers. The flight trigger is every .02 or .03 seconds (I forgot which). And another that fires every .07 seconds, another every half second, and so on. Would it be better to just have one timer that fires every .02 or .03 seconds and then just check a cycling integer to see if the other effects run?

e.g.
sec .02: run flight
sec .04: run flight
sec. 06: run flight and AI turn
sec. 08: run flight
sec. 10: run flight
sec. 12: run flight and AI turn
sec. 14: run flight
sec. 16: run flight and ship regen

And so forth. I didn't see any reason to do it that way to start, but I could I suppose.

Thanks, by the way,

Darwin
 
Status
Not open for further replies.
Top