need help with teleport from uncertain position + triggering
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
need help with teleport from uncertain position + triggering
maybe im searching the wrong way, but san't find a solution
- i want to move a unit of certain sides back behind a certain border if it crosses it too early. Thought id just do a moveto triggered event and teleport it, and everything okay except..the unit is still where it went, no teleporting took place it seems. Maybe you could find out what i did wrong?
i've thought maybe i should add y coordinate to it too, so did x,y=16,unit.y instead of the x=16 but nothing changed
and the second issue - i cant seem to find any way of triggering an event if a unit passes over, but doesn't stop on a certain tile. Is it possible somehow and i just can't find the way?
Yes sorry if its noobish i started my adventure with WML esterday
- i want to move a unit of certain sides back behind a certain border if it crosses it too early. Thought id just do a moveto triggered event and teleport it, and everything okay except..the unit is still where it went, no teleporting took place it seems. Maybe you could find out what i did wrong?
Code: Select all
[teleport]
[filter]
side=2,4
x=8-13
[/filter]
x=16
[/teleport]
and the second issue - i cant seem to find any way of triggering an event if a unit passes over, but doesn't stop on a certain tile. Is it possible somehow and i just can't find the way?
Yes sorry if its noobish i started my adventure with WML esterday
Like cats? I've made a whole faction of them to kick ass with!
Don't like cats? I've made a whole faction of them to kick their asses! So everyone's happy :)
Felinian faction is part of the Beyond Southern Hells era
kitties need sprites! art topic here
Don't like cats? I've made a whole faction of them to kick their asses! So everyone's happy :)
Felinian faction is part of the Beyond Southern Hells era
kitties need sprites! art topic here
Re: need help with teleport from uncertain position + triggering
unit.y is the name of a variable. $unit.y is the value of that variable. So just use x,y=16,$unit.y. And that's assuming you want to refer to the y coordinate of the primary unit of that event in which you use that. If it's really a moveto event then the primary unit is the unit that moved.StDrake wrote:maybe im searching the wrong way, but san't find a solution
- i want to move a unit of certain sides back behind a certain border if it crosses it too early. Thought id just do a moveto triggered event and teleport it, and everything okay except..the unit is still where it went, no teleporting took place it seems. Maybe you could find out what i did wrong?
i've thought maybe i should add y coordinate to it too, so did x,y=16,unit.y instead of the x=16 but nothing changedCode: Select all
[teleport] [filter] side=2,4 x=8-13 [/filter] x=16 [/teleport]
And of course you could still have other mistakes in the rest of the event code.
No, it's not really possible.StDrake wrote:and the second issue - i cant seem to find any way of triggering an event if a unit passes over, but doesn't stop on a certain tile. Is it possible somehow and i just can't find the way?
Re: need help with teleport from uncertain position + triggering
It's completely impossible, in fact. There's another thread discussing this at some length somewhere...zookeeper wrote:No, it's not really possible.StDrake wrote:and the second issue - i cant seem to find any way of triggering an event if a unit passes over, but doesn't stop on a certain tile. Is it possible somehow and i just can't find the way?
Re: need help with teleport from uncertain position + triggering
Impossible is a bit too strong. It may not be practicable to do, but it is definitely feasible. For instance, you could start by storing the positions of all the units. Then you would register a moveto event. You would code a pathfinding algorithm; it would give you afterward what path the unit followed between the stored starting position and the current ending position. Finally you would fire a "moveby" event for all the intermediate steps. The drawback of this approach is that the unit is already at its ending position by the time the event is fired. So it wouldn't look good if the unit was supposed to die on a given hex; but other than that, it would work.melinath wrote:It's completely impossible, in fact.
Re: need help with teleport from uncertain position + triggering
hmm too bad, guess ill have to do with landing on the dangerous terrain only
Anyway the $ worked perfectly, its a bit of a mystery to me why a message cant be executed after, only before the teleport, but that made no difference fortunately
thanks
Anyway the $ worked perfectly, its a bit of a mystery to me why a message cant be executed after, only before the teleport, but that made no difference fortunately
thanks
Like cats? I've made a whole faction of them to kick ass with!
Don't like cats? I've made a whole faction of them to kick their asses! So everyone's happy :)
Felinian faction is part of the Beyond Southern Hells era
kitties need sprites! art topic here
Don't like cats? I've made a whole faction of them to kick their asses! So everyone's happy :)
Felinian faction is part of the Beyond Southern Hells era
kitties need sprites! art topic here