• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Trigger (frogger)

Status
Not open for further replies.
Level 2
Joined
Jul 30, 2009
Messages
24
I am in need of a little bit of help i have developed a frog hero. I call him Frogger. He has an ult which devours enemy heros. Now i being a guy wbho likes to give people a fighting chance want to allot the enemy hero a command card button called "thrash" which when spammed does damage back to frogger. Click or be killed, so to speak. So me being new to triggers etc. I havnt the Faintest idea how to 1 make Devour allow hero selecting while being devoured or even if you can for that matter. 2.) How to change the standard command card to a single "Thrash" button command card
 
Level 9
Joined
May 30, 2008
Messages
430
it doesn't matter how YOUR unit invisible is it's YOURS so u will be able to see it :xxd:. Save the hero in variable and hide it. Then if the frogger is killed or dunno what u are trying to do move your stored hero to the postition of the frogger and unhide him.
 
Level 2
Joined
Jul 30, 2009
Messages
24
ok Maybe i can clairify.


Frogger Casts Consume
Consumed hero is inside of frogger aka (Devour Cargo)
Consumed hero is left with 1 command card option called thrash
Thrash wont cause enemy unit to phyically attack it it will use the "Unit – Damage Target" Basic unit action. no spell no fancy effects just simple.

So two issues

1.) How do i change the command card of the enemy consumed hero to having only "thrash" button, Then if he is released how do i revert the card back?

2.) I need a trigger for this. my triggers just look at me and laugh when i try to make this work
 
Level 9
Joined
May 30, 2008
Messages
430
If you try to make a hero to be eated it's abvios that u won't have any chance to click on somthing that is already eated w/e there is few ways i will tell u about one "the most simple".
1. base the devour on some other spell and set the cast range to be low
2. set your hero as variable at the moment when is eated
3. set the frogger as variable when eat your hero
4. Give to the frogger ability devour
5. create dummy unit at the position of your hero
6. set the dummy as variable
7. order the frogger to devour the unit (the unit hp value is your problem)
8. move your hero to place outside of the game area
9. set the range of sight to your hero to value that will make u able to select it but not see it
10. activate trigger when your hero is selected by his owner to select other unit with your ability "trash"
11. enable a trigger which damage your hero with the damage that devour is doing to the dummy unit
12. when the hero die kill the dummy unit which u set in variable
13. i think u got the way of working for other variants wait others to tell u
14. don't try devouring hero units anymore:zip:
 
Level 2
Joined
Jul 30, 2009
Messages
24
converting heros to variables... lollllll... crud. This is more complicated than i understand. DO you know a tutorial that could possibly help me understand this process better.I am super noob at WE right now. Ive read WE tutorial, ive read Advanced spells tutorial so i understand a little about what your saying. but not rewally.
 
Level 2
Joined
Jul 30, 2009
Messages
24
If you try to make a hero to be eated it's abvios that u won't have any chance to click on somthing that is already eated w/e there is few ways i will tell u about one "the most simple".
1. base the devour on some other spell and set the cast range to be low
2. set your hero as variable at the moment when is eated
3. set the frogger as variable when eat your hero
4. Give to the frogger ability devour
5. create dummy unit at the position of your hero
6. set the dummy as variable
7. order the frogger to devour the unit (the unit hp value is your problem)
8. move your hero to place outside of the game area
9. set the range of sight to your hero to value that will make u able to select it but not see it
10. activate trigger when your hero is selected by his owner to select other unit with your ability "trash"
11. enable a trigger which damage your hero with the damage that devour is doing to the dummy unit
12. when the hero die kill the dummy unit which u set in variable
13. i think u got the way of working for other variants wait others to tell u
14. don't try devouring hero units anymore:zip:

2.) How do you set your hero as a variable. and do i ned to set my hero as a variable or the enemy hero being ate? YOu can convert a unit to a int, string, or whole number? ummm? really o_O?

8/9) DOnt you mean Enemy HERO outside of the map???Also Would this be done with a teleport or what?

10>) Understand COncept, the trigger itself i dont fathom.Would i also need to set the value of the hero undetectable on mini map?
12.) Why would enemy unit kill the dummy? Wouldnt it be Frogger himself. I set the dummy to a generic Expiration timer
 
Level 2
Joined
Jul 30, 2009
Messages
24
OK here is what i got u.u

Code:
function Trig_Untitled_Trigger_001_Copy_Func001C takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A000' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Untitled_Trigger_001_Copy_Actions takes nothing returns nothing
    if ( Trig_Untitled_Trigger_001_Copy_Func001C() ) then
        call CreateNUnitsAtLoc( 1, 'h000', GetOwningPlayer(GetSpellAbilityUnit()), GetUnitLoc(GetSpellTargetUnit()), 0.00 )
        call ShowUnitHide( GetSpellTargetUnit() )
    else
        call DoNothing(  )
    endif
    call UnitApplyTimedLifeBJ( 60, 'BTLF', GetLastCreatedUnit() )
    call UnitAddAbilityBJ( 'A003', GetLastCreatedUnit() )
    call IssueTargetOrderBJ( GetLastCreatedUnit(), "A003", GetSpellTargetUnit() )
endfunction

When i cast the ability it doesnt do my custom ability.ALl effects are achieved but the cast of my Modified parasite spell i am using to damage the unit.
 
Level 4
Joined
Mar 23, 2008
Messages
87
Use [ JASS ] tags instead of code when posting jass.
Your trigger is leaking.

Fix:
JASS:
function Trig_Untitled_Trigger_001_Copy_Actions takes nothing returns nothing
    local location tmploc = GetUnitLoc(GetSpellTargetUnit())
    local u
    if ( Trig_Untitled_Trigger_001_Copy_Func001C() ) then
        set u = CreateUnitAtLoc( GetOwningPlayer(GetSpellAbilityUnit()), 'h000', tmploc, 0.00 )
        call ShowUnitHide( GetSpellTargetUnit() )
    else
        call DoNothing(  )
    endif
    call RemoveLocation(tmploc)
    call UnitApplyTimedLifeBJ( 60, 'BTLF', u )
    call UnitAddAbilityBJ( 'A003', u )
    call IssueTargetOrderBJ( u, "A003", GetSpellTargetUnit() )
endfunction
Would be nice to have a look at your map firsthand if you can be persuaded to attach it :)
Will edit/post more when i get home from work.... :( *sigh*
 
Last edited:

Cokemonkey11

Code Reviewer
Level 29
Joined
May 9, 2006
Messages
3,516
OK here is what i got u.u

Code:
function Trig_Untitled_Trigger_001_Copy_Func001C takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A000' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Untitled_Trigger_001_Copy_Actions takes nothing returns nothing
    if ( Trig_Untitled_Trigger_001_Copy_Func001C() ) then
        call CreateNUnitsAtLoc( 1, 'h000', GetOwningPlayer(GetSpellAbilityUnit()), GetUnitLoc(GetSpellTargetUnit()), 0.00 )
        call ShowUnitHide( GetSpellTargetUnit() )
    else
        call DoNothing(  )
    endif
    call UnitApplyTimedLifeBJ( 60, 'BTLF', GetLastCreatedUnit() )
    call UnitAddAbilityBJ( 'A003', GetLastCreatedUnit() )
    call IssueTargetOrderBJ( GetLastCreatedUnit(), "A003", GetSpellTargetUnit() )
endfunction

When i cast the ability it doesnt do my custom ability.ALl effects are achieved but the cast of my Modified parasite spell i am using to damage the unit.

Your script made me vomit a little. Check this out:

http://www.hiveworkshop.com/forums/jass-ai-scripts-tutorials-280/inlining-for-beginners-121375/
 
Level 9
Joined
Jun 7, 2008
Messages
440
2.) How do you set your hero as a variable. and do i ned to set my hero as a variable or the enemy hero being ate? YOu can convert a unit to a int, string, or whole number? ummm? really o_O?
  • Events
    • Unit - a unit starts the effect of an ability
  • Conditions
    • Unit-type of (casting unit) Equal to Frogger
    • (ability being cast) equal to devour
    • ((Target unit of ability being cast) is A Hero) Equal to True
  • Actions
    • Set Ate = Casting unit
    • Set Eaten = Target unit of ability being cast
8/9) DOnt you mean Enemy HERO outside of the map???Also Would this be done with a teleport or what?
This doesnt really need to be done. Disable the units collision, Give the unit locust, switch control to neutral passive, and move it to Frogger. Create a dummy unit for that heros control, which has only the thrash ability, and scale is : 0.01 This is what it looks like:
  • Actions
    • Set TempLoc = Position of Ate
    • Unit - turn collision for Eaten off
    • Unit - add Locust to Eaten
    • Unit - change ownership of Eaten to Nuetral Hostile and retain color
    • Unit - Create 1 dummy for owner of (Eaten) at TempLoc facing default building degrees
    • Set TempUnit = last created unit
    • Unit - add Thrash to TempUnit
    • Selection - Select TempUnit for Owner of (Eaten)
    • Custom script: call RemoveLocation(udg_TempLoc)
10>) Understand COncept, the trigger itself i dont fathom.Would i also need to set the value of the hero undetectable on mini map?
I did the trigger for you (relatively)
12.) Why would enemy unit kill the dummy? Wouldnt it be Frogger himself. I set the dummy to a generic Expiration timer
Killing the dummy would work, but it would be ineffective, because its hard to check which hero frogger ate, and disabling all other abilities might take a while :p. Make sure to remove the dummy unit with thrash, as soon as the hero gets out. This is the best way, i think, as you can still use the devour ability. Also you need to make sure you set the parameters to include Hero as well.
 
Level 2
Joined
Jul 30, 2009
Messages
24
Oh how interesting, ive only been able to set variables to =null

Never understood how to set it to an actual object. I knew it possible, but i have seen you have done it with the gui.Excellent. this is great learning experience. When i get home ill re-write and see what i come up with. I apreciate the help. Experimentation time. Thanks ill post back with more issues im sure as time progresses:sad:
 
Level 2
Joined
Jul 30, 2009
Messages
24
JASS:
===========================================================================
//Trigger:Consume
//===========================================================================
function Trig_Consume_Conditions takes nothing returns boolean
	if(not(GetUnitTypeId(GetSpellAbilityUnit())=='H00C'))then
		return false
	endif
	if(not(GetSpellAbilityId()=='A037'))then
		return false
	endif
	if(not(IsUnitType(GetSpellTargetUnit(),UNIT_TYPE_HERO)==true))then
		return false
	endif
	return true
endfunction

function Trig_Consume_Actions takes nothing returns nothing
	set udg_unit01=GetSpellAbilityUnit()
	set udg_unit02=GetSpellTargetUnit()
	set udg_location01=GetUnitLoc(udg_unit01)
	call SetUnitPathing(udg_unit02,false)
	call ShowUnitHide(udg_unit02)
	call SetUnitOwner(udg_unit02,Player(PLAYER_NEUTRAL_AGGRESSIVE),false)
	call CreateNUnitsAtLoc(1,'h00D',GetOwningPlayer(udg_unit02),udg_location01,bj_UNIT_FACING)
	set udg_unit03=GetLastCreatedUnit()
	call UnitAddAbilityBJ('A038',udg_unit03)
	call SelectUnitForPlayerSingle(GetTriggerUnit(),GetOwningPlayer(udg_unit02))
	call RemoveLocation(udg_location01)
endfunction

//===========================================================================
//===========================================================================
//Trigger:Thrash
//===========================================================================
function Trig_Thrash_Conditions takes nothing returns boolean
	if(not(GetSpellAbilityId()=='A038'))then
		return false
	endif
	return true
endfunction

function Trig_Thrash_Actions takes nothing returns nothing
	call UnitDamageTargetBJ(GetSpellAbilityUnit(),udg_unit01,15.00,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_NORMAL)
endfunction

Issue:Doesnt select dummy unit with the ability thrash, my guess being due to the fact that it changes faction to Neutral hostal.. instead of maybe changing it to neutral change it to the owner of "Eaten"?
Also, because you turn the Heros faction, it makes them unavailable for reviving. Big issues that need resolving. Is there a way to lock selection to that specific unit? Also when i tried to give the hero "Locust" the ability would not show up in the spell list. I even tried to set a variable to Locust itself, but even then it wouldnt show up
 
Level 2
Joined
Jul 30, 2009
Messages
24
Read, that did shit for me. Inlineing or streamlining the code is only useful for someone who knows the code well enough to impliment it.I, do not.therefore this doesnt help me whatsoever. And yes i am giving an Earnest effort to learn.
 
Level 10
Joined
Aug 19, 2008
Messages
491
What if you double click on the Hero's icon? It'll move the player's camera to a wierd spot.
Also, as he said he's new to triggering. Why in the world did you guys give him a Jass code, and a badly coded one too?

I can't see a practical solution to this at the moment, cause I don't know if a Hero can be selected while devoured.
I'll try to think about it.
Hiding the Hero will make it unselectable. Moving it outside map bounds means that he can be double-clicked on from the portrait and cause a non-convinient camera move.
Maybe create a dummy hero called "Devoured" and if you select its portrait it'll do you Trash thing?
 
Level 2
Joined
Jul 30, 2009
Messages
24
Negative, hero cannot be selected as its faction has been changed from owning player of hero to Neutral-Hostal and has been replaced with a dummy instead. I wonder if Removing Locust from the dummy would fix the problem?
Locust=Unselectable

The only issue is, if i do this and the dummy is selectable, if frogger moves, the dummy will stay at the location of creation.. and if it hilights a ring around him in green...then it kind of ruins the effect....

Dunno....just ideas... anythin would be usefull...

and as the poorly written jass sorry conversion from trigg to jass.
 
Level 10
Joined
Aug 19, 2008
Messages
491
I have no intuitive solution for your problem, sorry man.
If you're willing to have that icon below the Hero Icon which says "release this hero by clicking me X times" then you might have yourself a solution, or you could construct a custom devour which I have no idea how it should work.
 
Status
Not open for further replies.
Top