• 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.

Little Custom Script Problem

Status
Not open for further replies.
Level 7
Joined
Feb 9, 2007
Messages
56
HI Everybody

I have a little problem with a map of mine. If you play the map with more then two people, it happens very often that somebody gets disconnected...
So I thought I should improve the triggers ect.
And I thought I should remove triggers that just fired once and aren't necessary anymore afterwards.
So I added:
Custome Script: call DestroyTrigger( GetTriggeringTrigger() )
at the end of those triggers.

But now I don't know if it's working or not. So I thought I would test it on a trigger where I could see the result:

Triggername: muradinsound

Event:
-Unit gets attacked

Condition:
-Unit equal to "muradin"

Action:
-Play sound "blabla"
-Custom Script: call DestroyTrigger( gg_trg_muradinsound )


I thought that the last line would remove the trigger completly after it had been fired... So it couldn't fire again.
But actually when the unit (muradin) gets attacked, I get a fatal error...

Maybe I miss understood something with those custom scripts....
Hope you can help me :emote_grin:

Thx in adance
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
I make/destroy triggers all the time in my spells, so do people like vexorian.
Try testing the map a reboot latter, sometimes wc3 has memory allocation troubles causing it to crash at the slightest thing.
Also use a fixed command like the one that makes a game message or play animation.
 
Level 7
Joined
Feb 9, 2007
Messages
56
Hm I still get a fatal error :bored:
Hm, would it make sense if I use the action: -turn off this trigger
So it would be turned off, and afterwards removed by: -call DestroyTrigger( GetTriggeringTrigger() )

.... :eekani:

Here the error message...:

Fehler.jpg


edit: hm it doesn't work with -turn of his trigger either...
I think I let this trigger as it was...

PS: Just anothe rlittle question. In my orpg I have to initialize all the items, means I have to store about 350 items in a variable.
If I do this with the event: "-map initialisation" instead of "-elipsed game time is 4 seconds"
Does that mean that the items are stored before the game has really started, so it just needs a bit longer to load? So there would be less actions executed when the game is running....? (A kind of preloading, like when you set the heroes on the map, so the game doesn't lag everytime you load a hero...?)
 
Last edited:
Level 3
Joined
May 4, 2007
Messages
66
PS: Just anothe rlittle question. In my orpg I have to initialize all the items, means I have to store about 350 items in a variable.
If I do this with the event: "-map initialisation" instead of "-elipsed game time is 4 seconds"
Does that mean that the items are stored before the game has really started, so it just needs a bit longer to load? So there would be less actions executed when the game is running....? (A kind of preloading, like when you set the heroes on the map, so the game doesn't lag everytime you load a hero...?)

I think it does. I always do initialization of my systems at "-map initialisation" and i noticed that this make loading of map longer but cut the lag in the game.
 
Status
Not open for further replies.
Top