Warpto Commands

Just wondering if the warpto command works?

if (playerchats) { if (strequals(#g,Staff)) { if (strequals(#c,unstick boats)||strequals(#c,unstuck boats)||strequals(#c,warp boats)) warpto #s(this.startlevel),strtofloat(#s(this.startx)),strtofloat(#s(this.starty)); }

If you get what i mean.

I Dont see what defines this.startx and such but the command you want is setlevel2.
Example:setlevel2 test.nw,30,30;

then you can do a custom staff warp command like this:

if (playerchats && startswith(warpto,#c)){
  tokenize #c;
  setlevel2 #t(1),#t(2),#t(3);
}

This is just an example though, its not limited just to this kinda of application.

That seems to work. I’m trying to fix the providence boat script. However, it wont move. At all. I get the cannons to fire fine

[CODE]if(actioncannon){
with(getnpc(#N)){
test = strtofloat(#s(this.hp))-1;
setstring this.hp,#v(test);
setcharprop #c,#s(this.hp) left;
}
}
if (created) {
setstring this.hp,3;
setgif ship1.gif;
drawunderplayer;
noplayeronwall;
this.mdir = -1;
this.speed = 3;
setstring this.warp,abcdefghijklmnopqrstuvwxy;

timeout = 0.1;
}
if (playerdies) {detachplayer};
if (created || initialized) {
setstring this.startlevel,#L;
setstring this.startx,#v(x);
setstring this.starty,#v(y);
setshape 1,1416,2016;
}
if (actionmoveship) {
if (mdir>=0) {
mdir = int(strtofloat(#p(0)));
if (mdir>=0 && mdir<=3) {
setplayerprop #c,Aye Sir!;
this.mdir = mdir;
}
}
}
if (playerchats) {
if (strequals(#g,Staff)) {
if (strequals(#c,unstick boats)||strequals(#c,unstuck boats)||strequals(#c,warp boats))
setlevel2 #s(this.startlevel),strtofloat(#s(this.startx)),strtofloat(#s(this.starty));
}
setstring this.textp,#a;
this.testx = playerx;
this.testy = playery;
this.testx2 = x;
this.testy2 = y;
}
if (playerchats && (playerx in |x,x+14|) && (playery in |y,y+26|)) {
if (strequals(#c,stop)) {
setplayerprop #c,Aye Sir!;
this.mdir = -1;
}
}
if (timeout) {
setcharprop #c,#s(this.hp) left;
if(strtofloat(#s(this.hp))< 2){
setimg shipbeat.png;
}
if(strtofloat(#s(this.hp))<=0){
tokenize #s(this.attached);
for(i=0;i<tokenscount;i++){
with(getplayer(#t(i))){
detachplayer;
}
}
setimg ship1.gif;
setstring this.hp, 3;
setlevel2 #s(this.startlevel),strtofloat(#s(this.startx)),strtofloat(#s(this.starty));
}
this.playersattached=0;
setstring this.attached,;
for(this.player=0;this.player<playerscount;this.player++) {
with (players[this.player]) {
if (playerattachid==id) {
if (lindexof(#a,this.attached)<0)
addstring this.attached,#a;
this.playersattached ++;
}
}
}
setstring this.playersattached,#v(this.playersattached);
if (this.mdir>=0) {
dir = this.mdir;
dist = this.speed;
newx = x + vecx(dir)*dist;
newy = y + vecy(dir)*dist;

levxmove = (newx<-4? -1 : newx>54? 1 : 0);
levymove = (newy<-4? -1 : newy>52? 1 : 0);
warped = false;

if (levxmove!=0 || levymove!=0) {
  // Level warp

  if (startswith(providence,#L)) {
    levx = indexof(#e(11,1,#L),#s(this.warp))+1;
    levy = strtofloat(#e(14,2,#L));
    if (levx>=1 && levy>=1 &&
      (levx+levxmove in |1,16|) && (levy+levymove in |1,16|)) {
      setstring this.dest,providence_#e(levx+levxmove-1,1,#s(this.warp))-;
      setstring this.test,providence_#e(levx+levxmove-1,1,#s(this.warp))-;
      if (levy+levymove<10) setstring this.dest,#s(this.dest)0;
      setstring this.dest,#s(this.dest)#v(levy+levymove).nw;

      setlevel2 #s(this.dest),(levxmove<0? 54 : levxmove>0? -4 : x),  (levymove<0? 52 : levymove>0? -4 : y);
      warped = true;
    }
  }
}

if (warped==false) {
  if (!onwater2(newx+4.1,newy+4.1,5.8,7.8) ||
    onwall2(newx+4.1,newy+4.1,5.8,7.8))
      this.mdir = -1; // stop
  else
    move vecx(dir)*dist,vecy(dir)*dist,1,1;
}

}
if (strtofloat(#s(this.playersattached))==0&&(!strequals(#L,#s(this.startlevel))||strequals(#L,#s(this.startlevel))&&!(x==strtofloat(#s(this.startx))||y==strtofloat(#s(this.starty))))) {
this.warptime++;
if (this.warptime>=300) {
setlevel2 #s(this.startlevel),strtofloat(#s(this.startx)),strtofloat(#s(this.starty));
this.warptime=0;
}
} else {
this.warptime=0;
}
timeout = 1;
}

//#CLIENTSIDE
if(actionprojectile){
triggeraction x,y,cannon,;
}
if (created) {
blockagain;
setgif ship1.gif;
setshape2 14,26,{
0, 0, 0, 0,22,22,22,22,22,22, 0, 0, 0, 0,
0, 0, 0,22,22,22,22,22,22,22,22, 0, 0, 0,
0, 0, 0,22,22,22, 3, 3,22,22,22, 0, 0, 0,
0, 0,22, 0, 3, 3, 3, 3, 3, 3, 0,22, 0, 0,
0, 0,22, 0, 3, 3, 0, 0, 3, 3, 0,22, 0, 0,
0, 8,22, 0, 0, 0, 0, 0, 0, 0, 0,22, 8, 0,
8, 8,22, 0, 0, 0,22,22, 0, 0, 0,22, 8, 8,
8, 8,22, 0, 0,22, 3, 3,22, 0, 0,22, 8, 8,
8, 8,22, 0, 0,22, 3, 3,22, 0, 0,22, 8, 8,
0, 0,22, 0, 0, 0, 3, 3, 0, 0, 0,22, 0, 0,
0, 0,22, 0, 0, 0, 3, 3, 0, 0, 0,22, 0, 0,
0, 0, 0, 0, 0,22, 3, 3,22, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0,22, 3, 3,22, 0, 0, 0, 0, 0,
0, 8,22, 0, 0, 0,22,22, 0, 0, 0,22, 8, 0,
8, 8,22, 0, 0, 0, 0, 0, 0, 0, 0,22, 8, 8,
8, 8,22, 0, 0, 0, 0, 0, 0, 0, 0,22, 8, 8,
8, 8,22, 0, 0, 0,22,22, 0, 0, 0,22, 8, 8,
8, 8,22,22, 0,22,22,22,22, 0,22,22, 8, 8,
8, 0,22,22,22, 0,22,22, 0,22,22,22, 0, 8,
0, 0,22,22,22,22,22,22,22,22,22,22, 0, 0,
0, 0,22,22,22,22,22,22,22,22,22,22, 0, 0,
0, 0, 0,22,22,22,22,22,22,22,22, 0, 0, 0,
0, 0, 0, 0,22,22,22,22,22,22, 0, 0, 0, 0,
0, 0, 0, 0, 0,22,22,22,22, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,22,22, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};

}
if (playerenters || timeout) {
if(strtofloat(#s(this.hp)<2)){
setimg shipbeat.png;
}
if (playerattached) {
if(playerx+2.5<=x+3 || playerx+1>=x+11.5) {
detachplayer;
}
//cannon 1
if(playery in |y+4,y+6| && playerx in |x+2.5,x+3.5|){
if(strequals(#m,pull)){
if(playerdir==1){
setshootparams cannon;
setplayerprop #c,FIRE!;
shoot x-.5,y+7,z,3,0,0,prov_cannonball,;
setani idle,;
}
}
}
//cannon 2
if(playery in |y+11,y+13| && playerx in |x+2.5,x+3.5|){
if(strequals(#m,pull)){
if(playerdir==1){
setshootparams cannon;
setplayerprop #c,FIRE!;
shoot x-.5,y+14,z,3.14,0,0,prov_cannonball,;
setani idle,;
}
}
}
//cannon 3
if(playery in |y+4,y+6| && playerx in |x+8.5,x+9.5|){
if(strequals(#m,pull)){
if(playerdir==3){
setshootparams cannon;
setplayerprop #c,FIRE!;
shoot x+11.5,y+7,z,0,0,0,prov_cannonball,;
setani idle,;
}
}
}
//cannon 4
if(playery in |y+11,y+13| && playerx in |x+8.5,x+9.5|){
if(strequals(#m,pull)){
if(playerdir==3){
setshootparams cannon;
setplayerprop #c,FIRE!;
shoot x+11.5,y+14,z,0,0,0,prov_cannonball,;
setani idle,;
}
}
}

if ((strequals(#m,grab) || strequals(#m,pull)) && playerdir==2) {
  mdir = -1;
  for (i=0; i<4; i++)
    if (keydown(i)) mdir = i;
  if (mdir>=0)
    triggeraction playerx+1.5,playery+2,moveship,#v(mdir);
}

} else {
if (playery+2 in |y+11,y+13|&&((playerx+1.5 in |x+2,x+4| && playerdir==3 && keydown(3)) || (playerx+1 in |x+10,x+12| && playerdir==1 && keydown(1)))) {
attachplayertoobj 0,id;
}
}
timeout = 0.05;
}

if (playerenters) playlooped ocean.wav;
if (playerleaves) stopsound ocean.wav;
[/CODE]

your using npc server related commands, the script is too big for me to just magically come up with a solution for you, you need to read over commands.rtf and work your way up then you will be able to fix this script with ease

i miss yenairo

He’s my brother. Haha

tell him to get his ass the fuck back on these forums now.

I got everything to work… Except for the boat to move ntb…

I’ma fail

[QUOTE=Yen;69993]
I got everything to work… Except for the boat to move ntb…

I’ma fail
[/QUOTE]

  with(getnpc(#N)){

Can’t use this. This is a serverside command, used with an npc-server.

    if (strequals(#c,unstick boats)||strequals(#c,unstuck boats)||strequals(#c,warp boats))
      setlevel2 #s(this.startlevel),strtofloat(#s(this.startx)),strtofloat(#s(this.starty));

Looks like you are trying to warp the NPC. You need an npc-server to warp NPCs across levels.

Your problem is that this script was designed to be used on an npc-server. We don’t have a fully working npc-server. Much less one that supports GS1 scripts. It just flat out won’t work.

Make it a weapon, change a few things and bam! you know have a boat, although it couldnt be used for transporting multiple people and less you ran it off server strings with the level leader manipulating them and everyone on the boat reading off those server strings. Best bet if you really want this boat is a total rescript lol. Im sure it could be smaller as well, you could make it read off arrays for paths :slight_smile:

yendawg is back! or is it yendawg 2.0?

[QUOTE=hosler;70000]yendawg is back! or is it yendawg 2.0?[/QUOTE]

2.0 i fear.