HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Ok, very weird bug

06-10-2006, 10:14 PM#1
st33m
Ah, okay, thank you very much. And can I ask for more than one trigger in one thread? If so I have a question about a movement trigger. Basically what it does is it creates a Zeppelin when a unit eneters the region and the Zeppelin loads them up and flies them to another place.

Trigger:
North Zeppelin
Collapse Events
Unit - A unit enters North Zeppelin <gen>
Conditions
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Unit-type of (Entering unit)) Equal to Goblin Zeppelin) and ((Custom value of (Entering unit)) Equal to 1)
Collapse Then - Actions
Unit - Order (Entering unit) to Unload All At (Position of (Entering unit))
Unit - Remove (Entering unit) from the game
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Triggering unit) is A Hero) Equal to True
Collapse Then - Actions
Unit - Create 1 Goblin Zeppelin for (Owner of (Entering unit)) at (Position of (Entering unit)) facing Default building facing degrees
Unit - Set the custom value of (Last created unit) to 1
Unit - Order (Last created unit) to Load (Entering unit)
Wait 1.00 seconds
Unit - Order (Last created unit) to Move To (Center of South Zeppelin Land <gen>)
Collapse Else - Actions
Do nothing

At the moment it doesnt create the Zeppelin...

NOTE: This is copied from post #15. Solved the original problem, so uh... yeah. Need help with this not working.
06-10-2006, 11:53 PM#2
Rising_Dusk
Turn collision for the caster back on.
From personal experience, removing collision allows units to bypass all obstacles, but they themselves are still obstacles.
06-10-2006, 11:56 PM#3
The)TideHunter(
Yes, you could use a IsXSafe and IsYSafe function, or check but this in a condition:

Trigger:
Conditions
(Min X of (Playable map area)) Less than (X of (Your Location)))
(Min Y of (Playable map area)) Less than (X of (Your Location)))
(Max X of (Playable map area)) Greater than (Y of (Your Location)))
(Max Y of (Playable map area)) Greater than (Y of (Your Location)))

That will prevent setting a location outside of the map

EDIT: I looked over the thread, and mysteriously, i posted twice at exactly the same time =/
Odd...

EDIT2: This is to prevent going off the map
06-11-2006, 03:32 AM#4
st33m
Hmm thats one problem solved, but theres still cliffs and water that I could jet by.
06-11-2006, 04:14 AM#5
Pheonix-IV
There is a way to check if a unit is standing on a cliff or not. Possibly when you do the "Is it more than 800 away or dead" check, you could also check to see if the unit is standing on the Cliff terrain types, and if so stop it. Theres another way to check if something is trying to go up a cliff too that works via looking at cliff height, but i can't remember it.
06-11-2006, 03:29 PM#6
st33m
I tried it with terrain type, and the appropriate cliff(s). But it still could go up them fine.
06-11-2006, 04:45 PM#7
blu_da_noob
You can use Vexorian's CheckPathability function (http://www.wc3jass.com/viewtopic.php?t=2374), this will tell you if a position is pathable for a unit.

In your instance, the easiest way to include it would be:
Copy those functions into your custom script area
Create a global boolean called IsPathable
Add this line:
Trigger:
Custom script: set udg_IsPathable = CheckPathability(GetUnitX(udg_Caster),GetUnitY(udg_Caster))
Then, for the movement part, do an if/then/else with condition being IsPathable == true.
06-11-2006, 04:47 PM#8
st33m
Hmm... that may work. But I dont quite understand how to impliment that.
06-11-2006, 05:21 PM#9
blu_da_noob
Copy the functions from that link into your custom script section (at the top of your list of triggers, there should be something with the name of your map and a map icon next to it, click on that and paste in the area where trigger text normall goes).

Create a global boolean variable called IsPathable.

Copy the line I showed above.

Before moving the unit, check if IsPathable is equal to true.
06-11-2006, 05:40 PM#10
st33m
I dont understand where you want to copy the line and what the global boolean is.
06-11-2006, 05:49 PM#11
blu_da_noob
Oops, forgot to say where to put that line :>

The global boolean is like your global unit variable Caster. Create it in the same place, with type boolean.

Copy that custom script line to the top of the actions in Charge Effect trigger.
06-11-2006, 05:53 PM#12
st33m
Ah, okay, thank you.

I get an error: Type mismatch in assignment.
06-11-2006, 06:11 PM#13
blu_da_noob
You did make the IsPathable variable of type boolean?
06-11-2006, 06:17 PM#14
st33m
Erm okay, did that.

Fixed the error, it was silly. But I dont get how to use the boolean. What do I set it to in the first Charge trigger?

Trigger:
Charge
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Dance
Collapse Actions
Set Caster = (Casting unit)
Set CasterPosition = (Position of Caster)
Set TargetPoint = (Target point of ability being cast)
Set Distance = (Distance between CasterPosition and TargetPoint)
Set Angle = (Angle from CasterPosition to TargetPoint)
Set N = 0.00
Wait 0.20 seconds
Unit - Turn collision for Caster Off
Unit - Add Dancing to Caster
Unit - Order Caster to Orc Blademaster - Bladestorm
Trigger - Turn on Charge Effect <gen>

Trigger:
Charge Effect
Collapse Events
Time - Every 0.03 seconds of game time
Conditions
Collapse Actions
Custom script: set udg_IsPathable = CheckPathability(GetUnitX(udg_Caster),GetUnitY(udg_Caster))
Set N = (N + 20.00)
Set CasterPosition = (Position of Caster)
Set MoveToPoint = (CasterPosition offset by 20.00 towards Angle degrees)
Unit - Move Caster instantly to MoveToPoint, facing Angle degrees
Custom script: call RemoveLocation(udg_MoveToPoint)
Custom script: call RemoveLocation(udg_CasterPosition)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(N Greater than or equal to 800.00) or (((Caster is dead) Equal to True) or ((Terrain type at (Position of Caster)) Equal to Village - Grass Thick Cliff))
Collapse Then - Actions
Unit - Turn collision for Caster On
Unit - Remove Dancing from Caster
Custom script: set udg_Caster = null
Custom script: call RemoveLocation(udg_MoveToPoint)
Trigger - Turn off (This trigger)
Collapse Else - Actions
Do nothing
06-11-2006, 06:21 PM#15
blu_da_noob
Put an if/then/else around the move action like so:
Trigger:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
IsPathable Equal to True
Collapse Then - Actions
Unit - Move Caster instantly to MoveToPoint, facing Angle degrees
Else - Actions

You don't set it in the first trigger at all. You only use it in the second one.