• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[General] instant updates and instant units whit trigger

Status
Not open for further replies.
Level 9
Joined
Aug 15, 2007
Messages
261
Code:
try training
    Events
       
try training
    Events
        Unit - A unit Begins training a unit
    Conditions
    Actions
Unit - Order (Triggering unit) to Stop

        Wait 0.01 seconds
 
Unit - Create 1 (Trained unit-type) for (Triggering player) at (Position of (Triggering unit)) facing Default building facing degrees

that doesnt work
creates 1 unit than i have to stop the new unit from beeng trained manualy and than it works again
how can i stop the training unit so i can create them instantly


allso i wanna be doing the same for reserch but thats how far i got

Events
Unit - A unit Begins research
Conditions
Actions

what actions to use?
 
Level 9
Joined
Aug 15, 2007
Messages
261
need it whit a trigger
the map has modes and one of them is chaos rigged
allso i am thinking of mixed mode and when rigged or chaos rigged are on i need that trigger to work


Unit - Order (Triggering unit) to Stop
thars the wrong one
 
Last edited:
Level 12
Joined
Mar 24, 2011
Messages
1,082
I am not sure if you are looking for Stop(S), rather than Cancel(Esc) ?

If there is no Cancel in the GUI list try looking for the command card abilities somewhere and taking the raw code.

Edit// Iceman fast ! :D
 
Level 9
Joined
Aug 15, 2007
Messages
261
Try using
  • Custom script:call IssueImmediateOrderById(GetTriggerUnit(),851976)
^it should order cancel for the unit. If it doesn't work, try it after wait-0 seconds.
try training
Events
Unit - A unit Begins training a unit
Conditions
Actions
Custom script: call IssueImmediateOrderById(GetTriggerUnit(),851976)
Wait 0.01 seconds
Unit - Create 1 (Trained unit-type) for (Triggering player) at (Position of (Triggering unit)) facing Default building facing degrees


that did it thanks


now how to make the reserch trigger in gui
 
Level 9
Joined
Aug 15, 2007
Messages
261
There's somewhere a action to set a player's research level for <something>. If you catch the event you maybe can set it just, and cancel the research.
Player - Set the current research level of (Researched tech-type) to ((Current research level of (Researched tech-type) for (Triggering player)) + 1) for (Triggering player)

ok time to try but i dont know how to stop it or let the game take the resources needed...


works as a charm but the unit summoning trigger returns the resources needed for the unit becose it cansels it...
what can i use to take the gold from the curent player

Testing that:

Player - Add (((Triggering player) Current gold) - (Supply used by (Triggering unit))) to (Triggering player) Current gold


No adds 5-6 k every unit trained!!!!


how to make the trigger take resouces equals the unit cost?
 
Last edited:
Level 15
Joined
Jul 9, 2008
Messages
1,552
why not use 2 buildings for the units?
1 for regular mode a building that trains the units
2 for chaos rigged mode a building that sells the units

and a trigger that if its chaos mode any regular building thats on the map is replaced with the chaos rigged version ?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
works as a charm but the unit summoning trigger returns the resources needed for the unit becose it cansels it...
what can i use to take the gold from the curent player
Save the gold and lumber of the owning player into integer variables, cancel the unit production then immediately set the gold and lumber of the owning player to what you previously saved in integer variables. It might just be that simple. If not then one will need a system to track cancelling the refunds that fires off a 0 second timeout timer.
 
Level 9
Joined
Aug 15, 2007
Messages
261
Save the gold and lumber of the owning player into integer variables, cancel the unit production then immediately set the gold and lumber of the owning player to what you previously saved in integer variables. It might just be that simple. If not then one will need a system to track cancelling the refunds that fires off a 0 second timeout timer.

works perfect
for everyone who need that trigger


train units instantly
Events
Unit - A unit Begins training a unit
Conditions
((Owner of (Triggering unit)) is in ChaosGroup) Equal to True
Actions
Set goldint = ((Owner of (Triggering unit)) Current gold)
Set woodint = ((Owner of (Triggering unit)) Current lumber)
Custom script: call IssueImmediateOrderById(GetTriggerUnit(),851976)
Player - Set (Owner of (Triggering unit)) Current gold to goldint
Player - Set (Owner of (Triggering unit)) Current lumber to woodint
Wait 0.01 seconds
Unit - Create 1 (Trained unit-type) for (Triggering player) at (Position of (Triggering unit)) facing Default building facing degrees
 
Last edited:
Status
Not open for further replies.
Top