HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Dark Portal, Shadowstrike, Soulburn, and Getting a unit's monetary value

03-09-2007, 05:05 AM#1
Pyrogasm
Anyone have the slightest notion why Dark Portal (ANdp) has no orderid, yet there is the orderid "darkportal"? How might one go about ordering a unit to cast it?

Additionally, why do Shadowstrike and Soulburn not give credit for kills if cast via dummy units? If I add a dummy spell based off of either one to a hero, and then order it to kill a unit via it, the hero will get credit. If I instead create a dummy unit and order it to use the spell, no credit is given.

Lastly, is there a way to get the amount of money a player has been awarded for killing a unit? If, for instance, a player kills a footman which then gives him 10 gold (all done through the game engine and OE, obviously. Not trigger based); can I get that value?
03-09-2007, 09:04 AM#2
StockBreak
Quote:
Originally Posted by Pyrogasm
Anyone have the slightest notion why Dark Portal (ANdp) has no orderid, yet there is the orderid "darkportal"? How might one go about ordering a unit to cast it?
Yes, some abilities don't have a order id in the object editor (for example Spell Shield) but there is still a string order (or at least an integer order id); you can get it by using a trigger like "A unit is issued an order targeting a unit/point/item" and then showing the order id string (or even better the order id integer) with a debug message using call DebugMsg( "Order id: " + I2S( GetIssuedOrderId( ) ) ). Try to order your units using the integer id if you can't find the string, it will work.
Additionally, why do Shadowstrike and Soulburn not give credit for kills if cast via dummy units? If I add a dummy spell based off of either one to a hero, and then order it to kill a unit via it, the hero will get credit. If I instead create a dummy unit and order it to use the spell, no credit is given.
What do you mean with "no credit for kill"? The hero doesn't receive exp or gold for the kill if he's near the victim? Are you sure that the dummy caster is an ally of the hero?
Lastly, is there a way to get the amount of money a player has been awarded for killing a unit? If, for instance, a player kills a footman which then gives him 10 gold (all done through the game engine and OE, obviously. Not trigger based); can I get that value?
Well, the value is random (since it involves dices) and I don't think that you can get it. Maybe you can set a single value (not random, using 1 number of die and 1 side of the die) for a unit, store it in the object editor under the field "Point of Value" and then you can get it with triggers (set i = GetUnitPointValue( yourUnit ).

I hope it helps :) Cheers.

P.S: for your second question, does the event "A unit dies" happen AFTER of BEFORE the bounty? If it happens before, you can notice the variation of the player's gold after 0 second.
03-09-2007, 12:39 PM#3
Vexorian
Quote:
Additionally, why do Shadowstrike and Soulburn not give credit for kills if cast via dummy units? If I add a dummy spell based off of either one to a hero, and then order it to kill a unit via it, the hero will get credit. If I instead create a dummy unit and order it to use the spell, no credit is given.

Of course they do... But they wouldn't if you remove/kill the dummy before the spells end.
03-09-2007, 12:48 PM#4
masda70
In order to give bounty, shadow strike's casting unit must satisfy two conditions:
-it must be owned by the player whose bounty should be assigned to throughout the duration of the spell (or until the target dies), this sometimes isn't satisfied if you happen to recycle dummy units.
-it must be alive.
03-09-2007, 11:31 PM#5
Hydrolisk
Wow, you guys know a lot. If I knew everything, I'd be able to conduct the perfect WC3 map and make the ultimate formula that uses numbers and variables to figure out the meaning of life for YOU.
03-10-2007, 08:31 PM#6
Pyrogasm
Quote:
Originally Posted by masda70
In order to give bounty, shadow strike's casting unit must satisfy two conditions:
-it must be owned by the player whose bounty should be assigned to throughout the duration of the spell (or until the target dies), this sometimes isn't satisfied if you happen to recycle dummy units.
-it must be alive.
Perfect. My dummy units are dead before the units die.

+Rep to mazda70 and Vexorian!
03-13-2007, 03:33 AM#7
Pyrogasm
Erm, I have a slight problem.

I have created the spell via the CasterSystem, version 12.8 (I started the map with v12.8, and I don't want to have to redo all the abilities). The reason no credit is given is because the CS dummies have changed ownership (maybe I don't understand how the CS works...). How might I recitfy this?

I know I could just add the dummy units to an array, and kill them all after the spell has ended, but since this is from the CS, I can't exactly do that, right?
03-13-2007, 06:39 AM#8
Toink
call RecycleCaster() is useful..
03-13-2007, 02:36 PM#9
masda70
Any dummy unit casting shadow strike must either be recycled (back into the caster pool) or killed/removed after the spell effect duration has passed. The easiest thing would be to give each casting unit an expiration timer whose duration matches the one set in the ability editor for the respective spell. It won't return to the caster pool this way, but it's the safest and less troublesome method IMO.
03-13-2007, 03:53 PM#10
Vexorian
Quote:
Originally Posted by Pyrogasm
Erm, I have a slight problem.

I have created the spell via the CasterSystem, version 12.8 (I started the map with v12.8, and I don't want to have to redo all the abilities). The reason no credit is given is because the CS dummies have changed ownership (maybe I don't understand how the CS works...). How might I recitfy this?

I know I could just add the dummy units to an array, and kill them all after the spell has ended, but since this is from the CS, I can't exactly do that, right?
If you are using the cast abilities then you should already know how to use that function that determines the recycling delay?... I mean, do you read the readme?

Masda, how is not recycling casters "safer" or less troublesome?
03-13-2007, 07:17 PM#11
Pyrogasm
I'm just retarded. I totally missed line of the Readme.
03-13-2007, 08:49 PM#12
masda70
Quote:
Originally Posted by Vexorian
Masda, how is not recycling casters "safer" or less troublesome?

Perhaps because you don't need to use a timer+cache just to make a dummy unit usable again after X seconds. I used 'safest' because of the fact that the method used can easily cause more trouble than the alternative method if not used properly.

In any case, wouldn't it better to create new casters either when the spell is cast or when they are later needed, and then just let the casting units die? If the duration is quite long, and you happen to do a lot of caster usage during that period, the caster pool could unnecessarily grow big in size.

You probably know the advantages of recycling casters better than I do, but you might agree that depending on the availability of the caster pool (stack size+usage per minute) you will be tempted to choose one option rather than the other. Of course this does not consider that your alternative was made handy in a compilation called CS and that an expiration timer can take only one function call. The last decision is just a matter of opinion.