• 🏆 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!

[Trigger] Landing trigger bug

Status
Not open for further replies.
Level 4
Joined
Jun 15, 2009
Messages
37
This trigger is supposed to land a player's ship to one of the 2 landing area on the targeted planet.There is 4 landing area per planet (2/Team)

The problem is that the custom value of planets only works for the first second of the trigger. I mean after the waits it does not work any more (Unit appear in the middle of the map) If I remove waits it still bugs but this time only for last actions
I checked and variables are set correctly(Planet custom value is set before elevator positions ect ...)

Variables:
SlotC and SlotD: Boolean that says if the area is used or not (C and D for each team)
Slot_PosC and Slot_PosD: Destructible, gives the position of elevators(Depending on custom value of the planet)
SlotC_Who and Ves_Slot_PosC are used in other triggers, ignore them.


If anyone could help me debug that or if not possible give me a working jass version (Or GUI ...)
  • Land 2 test
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equals to Atterir
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Casting unit)) Equals to Intercepteur Jedi
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • SlotC[(Custom value of (Target unit of ability being cast))] Equals to TRUE
            • Then - Actions
              • Floating text - Create floating text that reads |cff00CC00Atterriss... above (Casting unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
              • Set Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))] = (Last created floating text)
              • Floating text - Change Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))]: Desactivate permanence
              • Floating text - Change the lifespan of Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))] to 5.00 seconds
              • Floating text - Change the fading age of Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))] to 0.00 seconds
              • Floating text - Set the velocity of Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))] to 15.00 towards 90.00 degrees
              • Wait 1.20 seconds
              • Destructible - Set height of Slot_PosC[(Custom value of (Target unit of ability being cast))] to 3
              • Wait 0.80 seconds
              • Unit - Move (Casting unit) instantly to (Position of Slot_PosC[(Custom value of (Target unit of ability being cast))])
              • Unit - Make (Casting unit) face (Current life of Slot_PosC[(Custom value of (Target unit of ability being cast))]) over 0.00 seconds
              • Destructible - Set height of Slot_PosC[(Custom value of (Target unit of ability being cast))] to 1
              • Unit - Pause (Casting unit)
              • Animation - Change (Casting unit)'s size to (180.00%, 180.00%, 180.00%) of its original size
              • Animation - Change (Casting unit) flying height to 0.00 at 0.00
              • Set SlotC_Who[(Custom value of (Casting unit))] = (Custom value of (Target unit of ability being cast))
              • Set Ves_Slot_PosC[(Custom value of (Casting unit))] = TRUE
              • Set SlotC[(Custom value of (Target unit of ability being cast))] = FALSE
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SlotC[((Custom value of (Target unit of ability being cast)) + 200)] Equals to* TRUE
                • Then - Actions
                  • Floating text - Create floating text that reads |cff00CC00Atterriss... above (Casting unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
                  • Set Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))] = (Last created floating text)
                  • Floating text - Change Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))]: Desactivate permanence
                  • Floating text - Change the lifespan of Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))] to 5.00 seconds
                  • Floating text - Change the fading age of Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))] to 0.00 seconds
                  • Floating text - Set the velocity of Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))] to 15.00 towards 90.00 degrees
                  • Wait 1.70 seconds
                  • Destructible - Set height of Slot_PosC[((Custom value of (Target unit of ability being cast)) + 200)] to 3
                  • Wait 0.20 seconds
                  • Unit - Move (Casting unit) instantly to (Position of Slot_PosC[((Custom value of (Target unit of ability being cast)) + 200)])
                  • Unit - Pause (Casting unit)
                  • Animation - Change (Casting unit)'s size to (180.00%, 180.00%, 180.00%) of its original size
                  • Animation - Change (Casting unit) flying height to 0.00 at 0.00
                  • Unit - Make (Casting unit) face (Current life of Slot_PosC[((Custom value of (Target unit of ability being cast)) + 200)]) over 0.00 seconds
                  • Destructible - Set height of Slot_PosC[((Custom value of (Target unit of ability being cast)) + 200)] to 1
                  • Set Ves_Slot_PosC[(Custom value of (Casting unit))] = FALSE
                  • Set SlotC_Who[(Custom value of (Casting unit))] = ((Custom value of (Target unit of ability being cast)) + 200)
                  • Set SlotC[((Custom value of (Target unit of ability being cast)) + 200)] = FALSE
                • Else - Actions
                  • Floating text - Create floating text that reads |cffFF0000Impossibl... above (Casting unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
                  • Set Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))] = (Last created floating text)
                  • Floating text - Change Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))]: Deactivate permanence
                    • Floating text - Change the lifespan of Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))] to 5.00 seconds
                    • Floating text - Change the fading age of Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))] to 0.00 seconds
                    • Floating text - Set the velocity of Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))] to 15.00 towards 90.00 degrees
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • SlotD[((Custom value of (Target unit of ability being cast)) + 10)] Equals to* TRUE
            • Then - Actions
              • Floating text - Create floating text that reads |cff00CC00Atterriss... above (Casting unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
              • Set Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))] = (Last created floating text)
              • Floating text - Change Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))]: Deactivate permanence
              • Floating text - Change the lifespan of Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))] to 5.00 seconds
              • Floating text - Change the fading age of Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))] to 0.00 seconds
              • Floating text - Set the velocity of Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))] to 15.00 towards 90.00 degrees
              • Wait 1.70 seconds
              • Destructible - Set height of Slot_PosD[((Custom value of (Target unit of ability being cast)) + 10)] to 3
              • Wait 0.20 seconds
              • Unit - Move (Casting unit) instantly to (Position of Slot_PosD[((Custom value of (Target unit of ability being cast)) + 10)])
              • Unit - Pause (Casting unit)
              • Animation - Change (Casting unit)'s size to (180.00%, 180.00%, 180.00%) of its original size
              • Animation - Change (Casting unit) flying height to 0.00 at 0.00
              • Unit - Make (Casting unit) face (Current life of Slot_PosD[((Custom value of (Target unit of ability being cast)) + 10)]) over 0.00 seconds
              • Destructible - Set height of Slot_PosD[((Custom value of (Target unit of ability being cast)) + 10)] to 1
              • Set SlotD_Who[((Custom value of (Casting unit)) + 10)] = ((Custom value of (Target unit of ability being cast)) + 10)
              • Set Ves_Slot_PosD[((Custom value of (Target unit of ability being cast)) + 10)] = TRUE
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SlotD[((Custom value of (Target unit of ability being cast)) + 210)] Equals to TRUE
                • Then - Actions
                  • Floating text - Create floating text that reads |cff00CC00Atterriss... above (Casting unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
                  • Set Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))] = (Last created floating text)
                  • Floating text - Change Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))]: Deactivate permanence
                  • Floating text - Change the lifespan of Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))] to 5.00 seconds
                  • Floating text - Change the fading age of Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))] to 0.00 seconds
                  • Floating text - Set the velocity of Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))] to 15.00 towards 90.00 degrees
                  • Wait 1.70 seconds
                  • Destructible - Set height of Slot_PosD[((Custom value of (Target unit of ability being cast)) + 210)] to 3
                  • Wait 0.20 seconds
                  • Unit - Move (Casting unit) instantly to (Position of Slot_PosD[((Custom value of (Target unit of ability being cast)) + 210)])
                  • Unit - Pause (Casting unit)
                  • Animation - Change (Casting unit)'s size to (180.00%, 180.00%, 180.00%) of its original size
                  • Animation - Change (Casting unit) flying height to 0.00 at 0.00
                  • Unit - Make (Casting unit) face (Current life of Slot_PosD[((Custom value of (Target unit of ability being cast)) + 210)]) over 0.00 seconds
                  • Destructible - Set height of Slot_PosD[((Custom value of (Target unit of ability being cast)) + 210)] to 1
                  • Set SlotD_Who[((Custom value of (Casting unit)) + 210)] = ((Custom value of (Target unit of ability being cast)) + 210)
                  • Set Ves_Slot_PosD[((Custom value of (Casting unit)) + 210)] = FALSE
                • If - Actions
                  • Floating text - Create floating text that reads |cffFF0000Impossibl... above (Casting unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
                  • Set Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))] = (Last created floating text)
                  • Floating text - Change Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))]: Deactivate permanence
                  • Floating text - Change the lifespan of Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))] to 5.00 seconds
                  • Floating text - Change the fading age of Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))] to 0.00 seconds
                    • Floating text - Set the velocity of Ply_Txt_Ves[(Player number of (Owner of (Casting unit)))] to 15.00 towards 90.00 degrees
 
Last edited:
Level 4
Joined
Jun 15, 2009
Messages
37
Mhh ok
1. Why custom values are bad ?
2.Yes but an instant landing is weird, so how to fix ?
3.Yes just seen that my trigger were in French, I fixed it.Should be more readable now (Might be still some mistakes)
 
Level 11
Joined
Sep 12, 2008
Messages
657
kk, this is VERY hard to read.

tell us exactly what you need.

about slowly losing height,
do this:

put this code in map header

JASS:
function SlowLanding takes unit u returns real
    
    local real f = GetUnitFlyHeight(u)
    
    call SetUnitFlyHeight(u, f - 0.75, 0)
    
    set f = GetUnitFlyHeight(u)
    return f
endfunction

now make this trigger:

  • YourCodeName
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Custom script: call SlowLanding( YourUnit )
      • Custom script: if SlowLanding( YourUnit ) <= 10 then
      • Trigger - Turn off (This trigger)
      • Custom script: endif
mark the "enabled" to off.
turn the trigger on when you want the unit to land.
it will auto-turn off.

enjoy the code! :D
 
Level 4
Joined
Jun 15, 2009
Messages
37
Ok here is what I need in detail

There is 1 "Space" region with planets as globes and 8 "Surfaces" with planets as land (With doodad and all stuff)

What I need is a trigger that allows player space ships to target a globe planet(In space) and move their vessel from space to the correct planet surface(Vessels are moved to elevators like in metastasis, the elevator is set to 3, vessel move,pause, get bigger, face correct angle, and then elevator goes back to 1)

So players can move their hero from vessel 'map'(The interior of it...) to vessel 'unit' and have fun on planet

Hope this is clear enough
 
Level 4
Joined
Jun 15, 2009
Messages
37
Ok.
First the disposition. There is 8 planets. 4 Elevators per planets(2 Per team)
Except a little planet with only 2 elevators (and 2 Mother ships with 6 slots but you can leave that)
Elevators is where vessels land (Are moved to)

The code does that:
-For mother ships, check if hangars are opened (Buff)
-Check if casted spell = Land
-Check if the vessel is team 1 or team 2 (Depending on unit type)
-Check if there is an empty slots on targeted planet, depending on team (Unit type ...)
-If yes moves the vessel to that planet,on the empty slot(Corresponding to team landing area [Screen2]), faces the right angle(I used face destructible life, works well), pauses the unit so it does not move on ground and size it a little bigger to be realistic.
-Also does a little floating text(See original code) which reads "Landing..."(In green) or "Impossible..."(In red)
-Set the slot full so only 1 vessel /elevator.

To work with there is a "Vessel dies on ground" and "Take off" triggers, do them if you can.

Some screens:

Here is a vessel ready to land



Here is where it is supposed to move

 
Status
Not open for further replies.
Top