questions...

Status
Not open for further replies.
Level 5
Joined
Nov 25, 2004
Messages
65
1. is it possible to detect a unit that stops attacking?
2. is it possible to detect a generic (not specific) unit that takes damage?
 
Level 5
Joined
Nov 25, 2004
Messages
65
1, A unit Is issued an order with no target, and add order condition -> Issued order equal to Stop

but what if the target is suddenly being loaded into a transport, or being teleported to a place where the attacker cannot reach it?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,241
No it can not possible lag your computer as long as you have atleast 2 processors (which most computers have) as WC3 is only single threaded.

It might cause major frame skipping or even WC3 to lock up for a few seconds if done badly.

Also a decent map should not have 1000s of units as WC3 is not designed to handle that many units.
 
Level 5
Joined
Nov 25, 2004
Messages
65
No it can not possible lag your computer as long as you have atleast 2 processors (which most computers have) as WC3 is only single threaded.

It might cause major frame skipping or even WC3 to lock up for a few seconds if done badly.

Also a decent map should not have 1000s of units as WC3 is not designed to handle that many units.

so if i have a map where i create one footman for every one seconds, and also have this trigger inside the map:

Untitled Trigger 001
Events
Unit - A unit Is attacked
Conditions
(Unit-type of (Attacked unit)) Equal to Footman
Actions
Trigger - Add to another trigger <gen> the event (Unit - (Attacked unit) Takes damage)

and then i let the map runs for several hours. after that, will it lags?
 
Level 5
Joined
Nov 25, 2004
Messages
65
Not in theory. It might crash or show performance related lag on some systems though (due to low framerate).

You only need to add unique events, so once a unit has been attacked once there is no need to ever re add the event.

okay. but if there is too many unique events as a result of killing hundreds of unique footman , is there any way possible to delete them?
 
1. is it possible to detect a unit that stops attacking?

a unit stops attacking after every attack :p
what do you want to do when the unit stops attacking?

there is an event which fires on "unit is loaded into transporter" btw
and _maybe_ you can check current order of your unit, not sure

Not in theory.

I once tested this with a few 1000 events on a rather low pc and everything worked fine
imho the problems with damage detection are overrated
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,241
I once tested this with a few 1000 events on a rather low pc and everything worked fine
imho the problems with damage detection are overrated
Obviously as those events do not create net traffic and thus do not make lag. Running a few thousand TriggerSleepActions or damage a location calls however might as those do make net traffic.

However systems as generic damage detection do add a lot of overhead as they run code on every damage. Keep in mind that units can deal damage more than just every attack and you will get a huge amount of time spent handling the code every game session. It is advisable to use a system which lets you limit the scope of complexity if you plan to have multiple systems fire on a generic damage event.
 
Level 5
Joined
Nov 25, 2004
Messages
65
I think destroying the trigger removes the events. You could also impliment a unit recycling system so the same footmen get reused.

1.i heard that destroying triggers causes a lot of problems such as memory leak, unpredictable bugs...is this true?

2.what is unit recycling system?

btw, i am actually new to custom scripts and jass.
 
Level 5
Joined
Nov 25, 2004
Messages
65
a unit stops attacking after every attack :p
what do you want to do when the unit stops attacking?

i know a unit stops attacking after every attack :grin:. that's not what i meant. anyway, i just found a possible solution to my problem but im unsure if its working well

i am actually making an ability. whenever a unit swings its weapon, and then at certain point, a few fireballs would be released, out of each attack. but i dont want the fireballs be released right when a unit start swinging its weapons. that would be unrealistic.

i want the fireballs to be released at the attack's damage point. that's why i am asking for a damage detection. the target acts as a dummy, and when it got hit, the fireball would be released from the attacker.

dr super good, is there any system out there that can detect the attacker's damage point?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,241
The attackers damage point is fixed at a certain time after it starts attacking, that might help (delaying an on attack event) to be realistic.

If there is also a single dummy unit, you can make it that only that unit gets added to a damage detection trigger (no need for all units).

You could also use a hashtable to map attack damage points to unit types.
 
Status
Not open for further replies.
Top