Change coordinates of a walk-to-point withing script?

Started by cjhrules, Thu 02/07/2009 12:33:49

Previous topic - Next topic

cjhrules

Hi!
How do I change coordinates of a walk-to-point within script?

/Calle

Akatosh

I don't think you can, at least not via the built-in walk-to points, as both Hotspot.WalkToX and Hotspot.WalkToY are read-only. You could, however, rig up a script involving the hotspot's "any click" script and two integer variables.

cjhrules

Ok, what I wanted to do was to change the walk to points while on region 1. I just have to think about something else, maybe 2 objects.

Thanks anyway  ;)

cjhrules

One more question, is it possible to make it so the script only reads the x coord from the walk to point and ignore the y coord when on region 1?

cjhrules

ok, I think I almost solved it but just almost.

I added this

  if (doors ==2)
  {
       player.Walk(429, 120, eNoBlock,  eWalkableAreas);
  }

but before he walks to 429, 120 he still walks to the regular walk to point.

GuyAwesome

Yeah, I think the use of walk-to points is hard-wired to be done before the actual interaction, unless you switch them off*.

Couldn't you just delete the Walk-to point and script it? (Add a player.Walk(...) that mimics normal walk-to behaviour, but can be over ridden as needed.) It's a bit of a hassle, but not too much if it's just for this one hotspot/region combination.

* game.auto_use_walkto_points = 0;, but that's overkill for a one time thing (plus, it'll ignore all other walk-to's in te room). If you were wanting to change walk-to point coords frequently, it'd make more sense - you could use the editor walk-to as a 'default' to save having to manually enter one for every hotspot.

cjhrules

Yes you are right, I just remove the regular walk to point and add some walk to code for this door. Thanks.

cjhrules

Didn't work, he is still walking to the hotspot first before walking to the correct coordinate even without walk to points.

cjhrules

I think only way to do this is to add an object over the hotspot with another walk to point. Thanks for the help though.

Matti

You know, you can edit posts instead of posting 3 times in a row..  ;)

cjhrules

Quote from: Mr Matti on Thu 02/07/2009 16:56:00
You know, you can edit posts instead of posting 3 times in a row..  ;)

Hehe ok.

Anyway, I solved the problem. I ended up having 2 objects and 1 hotspot for each door (this was just for 1 room anyway). If anyone have the same problem feel free to send me a msg.

SMF spam blocked by CleanTalk