wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Triggers & Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 10-25-2006, 05:32 AM   #1
Wyvernoid
Santa Wyvvy!
 
Wyvernoid's Avatar
 
Join Date: Jul 2006
Posts: 206

Wyvernoid will become famous soon enough (44)Wyvernoid will become famous soon enough (44)

Send a message via MSN to Wyvernoid
Default Autocast problem

Hello ^^ Sorry for being vague last time, and this time a more specific problem... How could I make the following work?
Trigger:
Spell Cheer
Collapse Events
Time - Every 1.00 seconds of game
Collapse Conditions
(Current Order of (My hero)) Equal to order(stop)
Collapse Actions
Set tempLocation = (Position of (My hero))
Set tempUG = (Units in 600.00 of tempLocation)
Collapse Unit Group - Pick every unit in tempUG and do (Actions)
Collapse Loop - Actions
Collapse If (All conditions are true) then do (Actions) else do (Actions)
Collapse If - Conditions
((Picked unit) belongs to an enemy of (Owner of (My hero))) Equal to False
(Life of (Picked unit)) Less than (Max Life of (Picked unit))
Collapse Then - Actions
Unit - Order (My hero) to Cheer (Picked unit)
Else - Actions
Custom Script: call RemoveLocation(udg_tempLocation)
Custom Script: call DestroyGroup(udg_tempUG)
Well that "Cheer" was made out of inner fire, but I wanted it to work as a heal. The problems are:
1. This didn't work at all (:-P), "My hero" wouldn't move. I think the problem is in that "order = stop" but can't find any other solutions.
2. Even it works, I didn't check whether the autocast is on. This means that even the autocast is off "My hero" would go and cheer others. However how to check?
3. Something I am curious about is that, if the above trigger worked, will an error message show if the cooldown is not complete or mana is not enough when the trigger orders "My hero" to cheer? (sry for being foolish - and btw I think not)
Hmm, specific enough? Maybe... ^^ Well if I'm vague again, please point out. Thanks!
__________________


Hey buddies! Check out Silly JASS Utility v2.0 Beta ^^ REALLY updated.

INACTIVE
Wyvernoid is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 10-25-2006, 07:19 AM   #2
Archmage Owenalacaster
Laughs Derisively
 
Archmage Owenalacaster's Avatar


Project Member: PoC
 
Join Date: Jun 2006
Posts: 649

Submissions (1)

Archmage Owenalacaster is a jewel in the rough (180)Archmage Owenalacaster is a jewel in the rough (180)Archmage Owenalacaster is a jewel in the rough (180)

Race-Building Contest #1 Winner

Default

I ran three tests.

First with the "stop" order string under similar conditions: the condition was, somehow, never fulfilled.

Second with the "stop" order string but with the event occuring every 0.10 seconds: same effect - nothing.

Third with the the "move" order string: right-clicking did not fulfill the condition, but issuing the move order from the command card fulfilled the condition.

Perhaps you need another trigger for storing the unit's current order in a value and then comparing it in the condition of the original trigger.
__________________
I enjoy small text.
Resources: Custom Race System
JademusSreg.950, North American region on StarCraft 2
Archmage Owenalacaster is offline   Reply With Quote
Old 10-25-2006, 09:24 AM   #3
shadowange1
User
 
shadowange1's Avatar
 
Join Date: Aug 2006
Posts: 91

Submissions (1)

shadowange1 has little to show at this moment (0)

Default

Try putting the action inside an IF..Then..Else
And before it enters the IF set var = current order
Also move the first condition to the condition of the IF with all the other things inside of it.

Also another problem may be that it is trying to cast the spell on all the units at the same time to maybe try adding a wait action after every pick.(Maybe, not sure)
shadowange1 is offline   Reply With Quote
Old 10-25-2006, 11:17 AM   #4
Archmage Owenalacaster
Laughs Derisively
 
Archmage Owenalacaster's Avatar


Project Member: PoC
 
Join Date: Jun 2006
Posts: 649

Submissions (1)

Archmage Owenalacaster is a jewel in the rough (180)Archmage Owenalacaster is a jewel in the rough (180)Archmage Owenalacaster is a jewel in the rough (180)

Race-Building Contest #1 Winner

Default

Quote:
Originally Posted by shadowange1
Also move the first condition to the condition of the IF with all the other things inside of it.
Bad idea. Those initial conditions are there so the trigger actions aren't needlessly activated.

Quote:
Originally Posted by shadowange1
Also another problem may be that it is trying to cast the spell on all the units at the same time
Good idea. I knew I was forgetting something in my previous post. Shadowange1 is nearly correct: before the unit could even begin casting the first spell, it will have received orders to cast another.

Quote:
Originally Posted by shadowange1
maybe try adding a wait action after every pick.
Bad idea. The wait action in a loop would not be able to compensate for many of a variety of influences upon the casting of the spell, such as stun, slow, disability, and spell casting time / animation casting time. And it would also disrupt your attempts at breaking the loop with other orders.

Two suggestions with no scripting neccessary:
[Ichi] Use an aura with similar effects to Inner Fire.
[Ni] Use Inner Fire as is and for the unit that shall cast your version of Inner Fire, reduce two stats in the Object Editor. Art - Animation - Cast Backswing and Art - Animation - Cast Point; these two stats determine the amount of time spent in spellcasting animation after and before the spell's effects respectively. If you reduce these to 0.000, you will have a nearly instant casting speed while the spell is auto-cast. Not having it on before a battle would be inconsequential because you would cast quickly enough to satisfy your troops' needs.

Otherwise, you'll need regulated target acquisition at timed intervals. Every R-seconds, compare the Unit is Alive equal to true and compare the value of a variable holding an order to stop, then go through a process of elimination through if statements until you're left with one unit, and the spell will successfully cast. I apologize for the lack of detail on how a variable holds a value pointing to an order (called "interception", perhaps?), but I have not implemented it myself and so I have no experience with it.
__________________
I enjoy small text.
Resources: Custom Race System
JademusSreg.950, North American region on StarCraft 2

Last edited by Archmage Owenalacaster : 10-25-2006 at 11:29 AM.
Archmage Owenalacaster is offline   Reply With Quote
Old 10-25-2006, 11:53 AM   #5
The)TideHunter(
SpeakerGames.com
 
The)TideHunter('s Avatar
 
Join Date: Mar 2006
Posts: 1,328

Submissions (1)

The)TideHunter( is a jewel in the rough (160)The)TideHunter( is a jewel in the rough (160)

Send a message via MSN to The)TideHunter(
Default

Welcome to Wc3c Archmage Owenalacaster, it seems you have some knowledge here.

I would create a dummy caster in the loop, order that to inner fire, and add a timed life effect to the dummy, it will all clear up fine and cast them all.
Heres an example:

Trigger:
Actions
Set TempLoc = (Position of (My Hero))
Set TempGroup = (Units within 600.00 of TempLoc)
Collapse Unit Group - Pick every unit in TempGroup and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Owner of (My Hero)) is an ally of (Owner of (Picked unit))) Equal to True
(Life of (Picked unit)) Less than (Max life of (Picked unit))
Collapse Then - Actions
Unit - Create 1 Dummy unit for (Owner of (My Hero)) at TempLoc facing Default building facing degrees
Unit - Order (Last created unit) to Cheer (Picked unit)
Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
Else - Actions
Custom script: call RemoveLocation(udg_TempLoc)
Custom script: call DestroyGroup(udg_TempGroup)

Btw, you need a dummy unit with this spell.
__________________
Big plans...

Last edited by The)TideHunter( : 10-25-2006 at 11:55 AM.
The)TideHunter( is offline   Reply With Quote
Old 10-25-2006, 07:40 PM   #6
Archmage Owenalacaster
Laughs Derisively
 
Archmage Owenalacaster's Avatar


Project Member: PoC
 
Join Date: Jun 2006
Posts: 649

Submissions (1)

Archmage Owenalacaster is a jewel in the rough (180)Archmage Owenalacaster is a jewel in the rough (180)Archmage Owenalacaster is a jewel in the rough (180)

Race-Building Contest #1 Winner

Default

I'm curious, though, if the desired effect is to include forcing the hero using Cheer to actually cast the ability (which would include casting time, mana consumption, cooldown, and "disablibility" or in other words the potential for the ability to be disabled through effects like Polymorph, Hex, Soul Burn, et cetera). While your trigger would work, Tidehunter, it would be nearly equivocal to having the Devotion and Command auras, as opposed to constantly auto-casting the Inner Fire-like spell as was specified.

(If there is any ambiguity, by "constantly auto-casting" I mean the desired function is to have an Inner Fire-like effect cast on any allied units in range if able, as opposed to the standard Inner Fire auto-cast which activates the ability when allied units enter combat with an enemy.)

This is a tricky problem for me, as I don't have enough triggering experience to be able to determine a solution. Anyone else have an idea?

EDIT: Modified for clarity
__________________
I enjoy small text.
Resources: Custom Race System
JademusSreg.950, North American region on StarCraft 2

Last edited by Archmage Owenalacaster : 10-25-2006 at 07:41 PM.
Archmage Owenalacaster is offline   Reply With Quote
Old 10-26-2006, 08:58 AM   #7
DioD
obey
 
DioD's Avatar
 
Join Date: Feb 2006
Posts: 1,532

Submissions (4)

DioD is a jewel in the rough (220)DioD is a jewel in the rough (220)DioD is a jewel in the rough (220)DioD is a jewel in the rough (220)

Send a message via ICQ to DioD
Default

use empty order eg

Order("")

if unit just stay order != stop
DioD is offline   Reply With Quote
Old 10-26-2006, 09:50 AM   #8
The)TideHunter(
SpeakerGames.com
 
The)TideHunter('s Avatar
 
Join Date: Mar 2006
Posts: 1,328

Submissions (1)

The)TideHunter( is a jewel in the rough (160)The)TideHunter( is a jewel in the rough (160)

Send a message via MSN to The)TideHunter(
Default

Order("") will just return 0, as you can see by:

Collapse JASS:
function String2OrderIdBJ takes string orderIdString returns integer
    local integer orderId
    
    // Check to see if it's a generic order.
    set orderId = OrderId(orderIdString)
    if (orderId != 0) then
        return orderId
    endif

    // Check to see if it's a (train) unit order.
    set orderId = UnitId(orderIdString)
    if (orderId != 0) then
        return orderId
    endif

    // Unrecognized - return 0
    return 0
endfunction
__________________
Big plans...
The)TideHunter( is offline   Reply With Quote
Old 10-27-2006, 05:11 AM   #9
Wyvernoid
Santa Wyvvy!
 
Wyvernoid's Avatar
 
Join Date: Jul 2006
Posts: 206

Wyvernoid will become famous soon enough (44)Wyvernoid will become famous soon enough (44)

Send a message via MSN to Wyvernoid
Default

Long not online. Let me see your good suggestions one by one:
>>Archmage<< Hmm, I think you have been suggesting an aura-like thing right? But I'm not goin' to do that. I just want to make it act like a heal, a normal priest's heal. That is, when "My hero" is busy, he can't cast the spell - he's like a priest, hmm yeah, not a "Fountain of Health".
As for those stopped by polymorph, silence, soulburn, etc, I don't think that the "My hero" will be able to cast the Cheer when under effects of those.
As for (again^^) the cast backswing, I know that, but I think it's away from my idea. But by suggesting this you remind me that using pick might not be a good idea? Well, I'm just confused. Use your Brilliance Aura to make it clearer plz ^^

>>TideHunter<< You suggested a good way, but I think it would also not work as a heal - multiple units get healed at the same time, a priest can not do that for sure...
Then you said Order("")=0, hmm what difference does that make? Are you suggesting that I should make the condition as GetUnitCurrentOrder(udg_My_hero) = 0?

>>DioD<< Hmm I think you mean that "if unit just stay then order = "" ". Then can you check if I'm right at the following? 1. When the unit attacks automatically not manually, the order = "". 2. When the unit finishes moving to its destination, the order = "". 3. When the unit is ordered to stop, the order = "".
In fact, the above 3 conditions are all in which I want the "My hero" to cast, just like that a priest would do a heal in all the 3 conditions.

Well... is this too hard? I never expected it to be... The fact is, normal Inner Fire is only autocast when nearby allied units are attacking, but I want it to autocast when the hero is in the 3 conditions above and nearby allied units are injured. The problem present is that the hero doesn't cheer the wounded unless they attack >:<
__________________


Hey buddies! Check out Silly JASS Utility v2.0 Beta ^^ REALLY updated.

INACTIVE
Wyvernoid is offline   Reply With Quote
Old 10-27-2006, 10:41 AM   #10
The)TideHunter(
SpeakerGames.com
 
The)TideHunter('s Avatar
 
Join Date: Mar 2006
Posts: 1,328

Submissions (1)

The)TideHunter( is a jewel in the rough (160)The)TideHunter( is a jewel in the rough (160)

Send a message via MSN to The)TideHunter(
Default

Quote:
Originally Posted by Wyvernoid
>>TideHunter<< You suggested a good way, but I think it would also not work as a heal - multiple units get healed at the same time, a priest can not do that for sure...
Then you said Order("")=0, hmm what difference does that make? Are you suggesting that I should make the condition as GetUnitCurrentOrder(udg_My_hero) = 0?

You did not state what you was asking for.
By the looks of your current trigger, that would do exactly the same as mine but mine would work, by the looks of it, you wanted all units in range of 600 to get healed, its in a loop.
__________________
Big plans...

Last edited by The)TideHunter( : 10-27-2006 at 10:41 AM.
The)TideHunter( is offline   Reply With Quote
Old 10-27-2006, 11:59 AM   #11
Thunder_Eye
Lol I got a custom title!
 
Thunder_Eye's Avatar
 
Join Date: Aug 2004
Posts: 1,236

Thunder_Eye has a spectacular aura about (92)Thunder_Eye has a spectacular aura about (92)Thunder_Eye has a spectacular aura about (92)Thunder_Eye has a spectacular aura about (92)

Default

You will need to stop the loop when the priest has aquired its first target.
__________________
Thunder_Eye is offline   Reply With Quote
Old 10-28-2006, 04:51 AM   #12
Wyvernoid
Santa Wyvvy!
 
Wyvernoid's Avatar
 
Join Date: Jul 2006
Posts: 206

Wyvernoid will become famous soon enough (44)Wyvernoid will become famous soon enough (44)

Send a message via MSN to Wyvernoid
Default

Quote:
Originally Posted by Wyvernoid
Well that "Cheer" was made out of inner fire, but I wanted it to work as a heal. The problems are:

2. Even it works, I didn't check whether the autocast is on. This means that even the autocast is off "My hero" would go and cheer others. However how to check?

>>TideHunter<< Sorry for that, all I wanted to state is that I want to make it work as a normal priest's heal. My trigger is a wrong one, I know ;-)
One more thing to ask: would it be laggy if you created a dummy every 1 sec?

>>Thunder_Eye<< Thank you! But how could I do it?
Collapse JASS:
call ForGroup(udg_tempUG, function EnumFunc)
...
function EnumFunc takes nothing returns nothing
...
return // After cheering the unit
...
endfunction
or just cheer FirstOfGroup(udg_UG)?

Hmm, I still want to ask - Does anyone of you know how to check if the autocast is on? I have an idea to use 3 triggers(one checks on, one checks off, one does actions), will it work?
__________________


Hey buddies! Check out Silly JASS Utility v2.0 Beta ^^ REALLY updated.

INACTIVE
Wyvernoid is offline   Reply With Quote
Old 10-28-2006, 08:01 AM   #13
The)TideHunter(
SpeakerGames.com
 
The)TideHunter('s Avatar
 
Join Date: Mar 2006
Posts: 1,328

Submissions (1)

The)TideHunter( is a jewel in the rough (160)The)TideHunter( is a jewel in the rough (160)

Send a message via MSN to The)TideHunter(
Default

Yes, FirstOfGroup would work, but it might always pick the same unit.
And if use FirstOfGroup, remember to change the way you select units in the group, add a condition that its not on max life, because if you get it in the group and its the first one there, then it dosent meet the condition, it wont heal anybody.

And to check if autocast is on, yes i think you should have 3 triggers that set a boolean or something.
__________________
Big plans...
The)TideHunter( is offline   Reply With Quote
Old 10-28-2006, 08:12 AM   #14
Pheonix-IV
I want you inside me...
 
Pheonix-IV's Avatar
 
Join Date: Oct 2002
Posts: 4,006

Submissions (17)

Pheonix-IV is a jewel in the rough (212)Pheonix-IV is a jewel in the rough (212)Pheonix-IV is a jewel in the rough (212)Pheonix-IV is a jewel in the rough (212)

Default

There's a far easier way to do this:

Give the unit a dummy ability based on heal. Give it the tooltip, icon ect for Cheer or whatever and make the dummy heal 0 hitpoints. Have a trigger which detects when the dummy heal is cast, spawns a dummy unit and casts the real Cheer ability on the target of the dummy heal. Simple, no hassle, works like a charm.

Seriously, big phat JASS triggers arn't the answer to everything.
__________________

Last edited by Pheonix-IV : 10-28-2006 at 08:12 AM.
Pheonix-IV is offline   Reply With Quote
Old 10-28-2006, 08:22 AM   #15
darkwulfv
Alpha Male of Wc3c
 
darkwulfv's Avatar


Official Map Reviewer
 
Join Date: Mar 2006
Posts: 3,646

Submissions (6)

darkwulfv is just really nice (270)darkwulfv is just really nice (270)

Send a message via AIM to darkwulfv
Default

Quote:
Seriously, big phat JASS triggers arn't the answer to everything.
Holy crap, that had to be the best line ever. I am quoting that in my sig for all of eternity.

Phoenix-IV's method is perfect. That's insanely easy. Just make a trigger that kicks in whenever the effect of Cheer (the dummy one) is started on a unit, then make a dummy caster put the real Cheer spell on said unit. No loops, no variables (I don't think, I left GUI for JASS a month ago and I've forgotten how to do GUI...), and pretty damn easy. Phoenix-IV, you get some rep.
__________________
The Spell Request Thread
Quote:
Originally Posted by Joe-Black-5
a dota like map but with unique stuff
(There was no map attached, and that was all the thread said.)
Spells I've Made

Darkwulfv's Lightning Grapple || Tritanis' Lazy Bolt

darkwulfv is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 04:03 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2017, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services