Page 1 of 1

Randomize waypoint - what wrong ?

Posted: Tue Apr 24, 2012 11:54 am
by kircinek
i tray make litle randimize waypoint but have problem some error meybe someone know what code be corect

<!-- # 1 --><waypoint x=tostring(-40+math.random(-1, 1)) z=tostring(-17+math.random(-1, 1)) y="62">

Re: Randomize waypoint - what wrong ?

Posted: Wed Apr 25, 2012 2:26 pm
by BillDoorNZ
you cannot embed formula's in the <waypoint> attributes.

perhaps something more like:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<waypoints>
<onLoad>
</onLoad>
<waypoint x="-40" y="62" z="-17" tag="start">
  player:moveTo(CWaypoint((-40+math.random(-1,1)), (-17+math.random(-1,1)), 62));
</waypoint>
</waypoints>
I havent tested the code of course :) But you should be able to do something like that.

Re: Randomize waypoint - what wrong ?

Posted: Thu Apr 26, 2012 8:59 am
by kircinek
ty for reply

that i cant used variable or code in x="-40" ?

Re: Randomize waypoint - what wrong ?

Posted: Thu Apr 26, 2012 1:02 pm
by rock5
kircinek wrote:ty for reply

that i cant used variable or code in x="-40" ?
No, I'm afraid not.