HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Reals, wheels, and automobiles the story of headaches

06-18-2006, 10:11 PM#1
map-maker
my map is begining to give me massive headaches >.< but anyway for some reason the real value i set in my map just doesnt seem to be working..it is giving me some crazy value that it shouldnt be...basically what im trying to do is make a trigger that when used "submerge" your unit is transported to the same spot but underwater which is the same size area right below it. well to do this (and to go back up) i have a few triggers like this:

Event: Map initialization
condition:
actions: set transposition = distance between (center of rect<gen>) and (center of rect<gen>)

ok the 2 rects are set at the bottom edge of each area; the first one in the "Above" the water area and the second in the "below" the water area. this SHOULD give me an acurate distance between the 2 arenas from anywhere in each...here is something like the trigger im using to submerge and surface(without the special effects included):

Event: A unit starts the effect of an ability
Conditions: Ability being cast = submerge
Actions: Move (casting unit) instantly to (position of(casting unit) offset by X of (target point of ability being cast), Y of (target point of ability being cast) - transposition

basically that should just move the casting unit to the same point on the X axis and the same point on the Y axis - the value of "transposition"(the variable i set earlier) usually this works and my unit goes down to the bottom arena fine but sometimes it doesnt bring him down there at all but out into some random place in the map that i cant see because of set camera bounds. if it DOES work though it doesnt teleport him to the right point it doesnt even move him to the right point on the X axis! usually it will move my unit to the bottom right corner of the water area no matter where i cast it up top! well thats a bit weird because if my knowledge of graphs is right than that shouldnt happen at all...well im a bit puzzled over that one but heres a mysterious one too...the surface trigger is pretty much the exact same but instead of subtracting(-) "transposition" from the Y axis i add(+) it so it would just move me up to the surface area. well this one doesnt work the way it should AT ALL. it pretty much moves my guy north east about 200 units...well if someone can try to explain to me why this is happening it would be much appreciated...
06-19-2006, 12:42 AM#2
Rising_Dusk
Trigger tags next time please. :P

If your areas are directly 100% on top of eachother, then the X values of any point on either will be the same for the other.

Disposition for you equals the distance between the centers of the rects, assuming the rects are in perfect concordence with the areas themselves.
Now, we imagine you've got the rects set properly and that they really are directly atop one another.

Trigger:
Actions: Move (casting unit) instantly to (position of(casting unit) offset by X of (target point of ability being cast), Y of (target point of ability being cast) - transposition

That moves the X value, automatically meaning you did it wrong (Since the X should NOT be offset at all).
That also changes their Y by a null value, 0 (Since I assume your submerge ability doesnt take a target point, that would make no sense) - disposition.
This makes sense that your units always appear in the same spot.
They always appear at some random X offset by X (Far Right side of playable map) and 0-disposition (Bottom corner).
Try this.

Trigger:
Actions: Move (casting unit) instantly to (position of(casting unit) offset by 0, (Y of (Position of casting unit) - transposition)

Make sense? ^_^
06-19-2006, 12:45 AM#3
map-maker
ya i think i kinda realized that but....what about the "surface" trigger that is not working at all and is hardly moving the unit whatsoever just barely northeast...i assume the east part is because of the X value but it isnt moving him up hardly any
06-19-2006, 12:51 AM#4
Rising_Dusk
The surface trigger should be identical to the submerge trigger but instead of subtracting the disposition, you should add it.
06-19-2006, 01:01 AM#5
map-maker
ya i do just that its the exact same but instead i add; i fixed it how you said and now submerge works perfect ^^ nothing wrong with it at all BUT now surface makes the unit move backwards about 600 units...its indenticle to submerge but i add instead of subtract O.o this is weird

here are the two triggers:
submerge:
Trigger:
submerge
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Submerge (new)
Collapse Actions
Special Effect - Create a special effect at (Target point of ability being cast) using Objects\Spawnmodels\Naga\NagaDeath\NagaDeath.mdl
Special Effect - Destroy (Last created special effect)
Unit - Move (Casting unit) instantly to ((Target point of ability being cast) offset by (0.00, ((Y of (Position of (Casting unit))) - transposition)))
Special Effect - Create a special effect at (Target point of ability being cast) using Objects\Spawnmodels\Naga\NagaDeath\NagaDeath.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect attached to the head of (Casting unit) using Doodads\Ruins\Water\BubbleGeyser\BubbleGeyser.mdl
Set bubblesunit[(Player number of (Owner of (Casting unit)))] = (Last created special effect)

surface:
Trigger:
surface
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Surface (new)
Collapse Actions
Special Effect - Create a special effect at (Target point of ability being cast) using Objects\Spawnmodels\Naga\NagaDeath\NagaDeath.mdl
Special Effect - Destroy (Last created special effect)
Unit - Move (Casting unit) instantly to ((Target point of ability being cast) offset by (0.00, ((Y of (Position of (Casting unit))) + transposition)))
Special Effect - Create a special effect at (Target point of ability being cast) using Objects\Spawnmodels\Naga\NagaDeath\NagaDeath.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Destroy bubblesunit[(Player number of (Owner of (Casting unit)))]
06-19-2006, 01:15 AM#6
Rising_Dusk
Make sure the spells are of similar bases.
It's possible the base spell of Surface does not return a GetSpellTargetLoc() [Target point of ability being cast], thus returning 0.
06-19-2006, 01:16 AM#7
map-maker
they are based off the same spell....
06-19-2006, 01:21 AM#8
Rising_Dusk
If they have both abilities at once, then it will not work since Order ID's will be confused and it will think you're using Submerge and not Surface.
(Your triggers dont show any removing of one spell and adding of the other)
06-19-2006, 01:37 AM#9
map-maker
there is another trigger to remove submerge and add surface and vise versa...i am using surface trust me
06-19-2006, 01:48 AM#10
Rising_Dusk
Then the spell should work and the unit should move to the proper position.

If it isn't then there has to be something else factoring in that has nothing to do with triggers.
Unless you change disposition somewhere, it should work as you have it.
06-19-2006, 07:53 AM#11
Anitarf
Why do you still use (target point of ability being cast) instead of (position of (casting unit)). Submerge is a no-target spell, so it shouldn't even give a target point, but instead just the default center of playable map, which is why the submerge trigger seems to work, because you add the Y of the position of unit afterwards.

((Target point of ability being cast) offset by (0.00, ((Y of (Position of (Casting unit))) + transposition)))

change this to

((Position of (Casting unit)) offset by (0.00, (0.00 + transposition)))

and for submerge

((Position of (Casting unit)) offset by (0.00, (0.00 - transposition)))
06-19-2006, 11:36 AM#12
map-maker
its not based on submerge...ill change that when i change the spell..i was just using another spell base before and now im going to change it but thats not where the problem lies but i dont know where that is >.>
06-19-2006, 11:39 AM#13
Rising_Dusk
Yeah, Anitarf I had mentioned that earlier but he kept using it.
I just assumed he was using something like Shockwave for a target point or something. :P

Well MM, when you get the new spell worked out post it up here if it doesn't work.
I'll be sure to check it over to help ya' out there.
06-19-2006, 05:37 PM#14
Anitarf
Changing the (target point of ability being cast) to (position of (casting unit)) wasn't my only suggestion, there are other reasons why it doesn't work, the solution is in my previous post.