: so i'm working on this city skeleton, trying to write the scripts for the warps.From different copies of a room dink will warp to the same interior room in a dif. vision. Outside has the script,"&vision=&player_map;", but the interior warp tile needs a script to define tile to warp back to.(x&y cord. are optional as all copies are the same). how can I script this?.. Thanks...Ric
In my experience, &vision can only be set from the script attached to a room (with the B key in DinkEdit). It seems that &vision gets reset every time a new screen loads, so you have to set it after the screen loadss, but before the sprites are drawn (which basically means in a script attached to the room)
I'm not sure I totaly understand your plan, but maybe you could attach a script to the inside of the building that contained
&vision = &visflag;
and the script that warped dink would contain
&visflag = &player_map;
where &visflag would be a global variable you made in main.c
I hate to say this, but either call or "borrow" a global. Set it to the map of return. OR
Set vision to the screen outside(what you were doing, right?) and use a touch script instead of a direct warp for the door, i.e.
void touch( void )
{
&player_map = &vision;
}
: I hate to say this, but either call or "borrow" a global. Set it to the map of return. OR
: Set vision to the screen outside(what you were doing, right?) and use a touch script instead of a direct warp for the door, i.e.
: void touch( void )
Thanks! i'm having some sucess, I looked at s6-warp for an example( do I need to kill_this _task?) and the return warp works,but I still get an error "&vision unknown" and so it returns to the tile I preset in main.It's like this.....
ext. rm script {&vision=&player_map
}
Int. rm-sprite touch script
void touch(void)
{
&player_map=&vision;
sp_x(280);
sp_y(220);
}
kill_this_task
.......so can you see what I'm doing wrong?
Thanks ..............Ric