furniture placement

[QUOTE=Beholder;45995]As far as donation’s go, we’re set until the year 2020 or something O_o[/QUOTE]

2017 Thanks, Riley.

[QUOTE=tricxta;46011]poor guy… who abused him btw?? just wonderin[/QUOTE]
“Reciprocal abuse”, and by everyone. Think he was even banned at some point.
Reason? He was completely fucking annoying at the time O_o

If you are annoying, you can and should be given the back-of-the-hand treatment;
You could almost say it’s equivalent exchange! :open_mouth:

…Suppose this is also a hint on how to behave and act on these forums, ie: do not be annoying.
No one likes annoying people o_o

1 Like

hmmmmm looks at spooon and coughs…
Anyway beholder im wondering I made this script:

//NPC made by Tricxta
//#CLIENTSIDE
setimg bartablehorizontal.png;
message click on me to get a bar table;
if (leftmousebutton){
  toweapons bar table;
  this.stage=1;
}
if(keydown2(68,true) && strequals(#w,bar table))if (furnitureenabled=1){
  timeout=0.1;
}
if(timeout){
  if (playerdir=0){
    x-=2;
    this.sprite=1;
  }
  if (playerdir=1){
    x-=2;
    this.sprite=0;
  }
  if (playerdir=2){
    y+=2;
    this.sprite=1;
  }
  if (playerdir=3){
    x+=4;
    y-=2;
    this.sprite=0;
  }
  if (this.sprite=1){
    putnpc bartablehorizontal.png,furniturescript.txt,x,y;
  }
  if (this.sprite=0){
    putnpc bartablevertical.png,furniturescript.txt,x,y;
  }
}

which then uses this npc code

//#CLIENTSIDE
if (leftmousebutton){
  message (selected);
  this.selected=1; 
 timeout=0.1;
}
if (timeout){
if (keydown2(85,true))
if(this.selected=1){ 
message push and pull (enabled);
  canbepushed;
  canbepulled;
  sleep 2;
  message ;
}
if (keydown2(79,true)){
  message push and pull (disabled);
cannotbepushed;
  cannotbepulled;
  sleep 2;
  message ;
}
if (keydown2(54,true)){
  message position your cursor where you want the item;
sleep 3;
 x=mousex;
  y=mousey;
message ;
}
if (keydown2(55,true)){
y-=0.1;
}
if (keydown2(56,true)){
y+=0.1;
}
if (keydown2(57,true)){
x-=0.1;
}
if (keydown2(48,true)){
x+=0.1;
}
if (keydown2(220,true)){
 destroy;
}
if(keydown2(13,true)){
 this.selected=0;
  message ;
break;
}
timeout=0.1;
}

Anyway im not sure how to implement strings into this code so I can retain the x value power make re-positioning easy

Unsure if I know what you’re actually requesting O_o
Also forgot how scary other people’s scripts looked.

ok so i want to make the furniture retain its placement even when the server crashes or is updated, ive figured that because its running on variables that if the level was updated these variable would become 0 and destroy the npc how ever if strings were used the placement of the npc would be retained and thats what i want to do with these scripts.
Use strings to retain there placement but im not sure on how to implement them

Saving [Var to String] -> setstring server.stringname,#v(variablename);
Loading [String to Var] -> variablename = strtofloat(#s(server.stringname)

hmmmmmm i knew about that, you posted that so many times :wink: oh well I think the code will get pretty bulky this way and i was trying to find out if theres an array way lol but mmmk ill try it using normal server strings and see how it goes :stuck_out_tongue:

Yeah- it will get very bulky.
Also to note, the maximum size for any script is 12255bytes (characters), spaces count (though the GServer is coded to try and trim some of the fat, thank ya for that Mr. Nalin).

[QUOTE=tricxta;46065]
hmmmmm looks at spooon and coughs…

[/QUOTE]

You’re wrong.

this is where i got with it:
the weapon:

//NPC made by Tricxta
//#CLIENTSIDE
setimg bartablehorizontal.png;
message click on me to get a bar table;
if (leftmousebutton){
  toweapons bar table;
  this.stage=1;
}
if(keydown2(68,true) && strequals(#w,bar table))if (furnitureenabled=1){
  timeout=0.1;
}
if(timeout){
  if (playerdir=0){
    x-=2;
    this.sprite=1;
  }
  if (playerdir=1){
    x-=2;
    this.sprite=0;
  }
  if (playerdir=2){
    y+=2;
    this.sprite=1;
  }
  if (playerdir=3){
    x+=4;
    y-=2;
    this.sprite=0;
  }
  setstring server.furniturecount_#l,strtofloat(#s(server.furniturecount)+1);
  addstring server.furniturecount_#L_x,#v(x);
  addstring server.furniturecount_#L_y,#v(y);
  if (this.sprite=1){
    putnpc bartablehorizontal.png,furniturescript.txt,strtofloat(#s(server.furniturecount_#l_x)),strtofloat(#s(server.furniturecount_#l_y));
  }
  if (this.sprite=0){
    putnpc bartablevertical.png,furniturescript.txt,strtofloat(#s(server.furniturecount_#l_x)),strtofloat(#s(server.furniturecount_#l_y));
  }
}

the produce of firing the weapon:

//#CLIENTSIDE

if (created){
setstring server.itemid,#s(server.furniturecount_#l)

if (leftmousebutton){

  message (selected);

  this.selected=1;
 
 timeout=0.1;

}

if (timeout){

if (keydown2(85,true))
if(this.selected=1){
 
message push and pull (enabled);
  
canbepushed;
  
canbepulled;
  
sleep 2;
  
message 
;

}

if (keydown2(79,true)){
 
 message push and pull (disabled);
  
cannotbepushed;
  
cannotbepulled;
 
 sleep 2;
  
message ;
}

if (keydown2(54,true)){

  message position your cursor where you want the item;
  
sleep 3;
 
 x=mousex;

  y=mousey;
  
message ;

}


if (keydown2(55,true)){

y-=0.1;
}

if (keydown2(56,true)){

y+=0.1;

}

if (keydown2(57,true)){

x-=0.1;

}

if (keydown2(48,true)){

x+=0.1;

}
 

if (keydown2(220,true)){
 
 destroy;

}


if(keydown2(13,true)){
 
 this.selected=0;

  message ;
  
break
;

}

timeout=0.1;

}

I planned for the item id string to be the thing that lets the client know what string to change but i dont know how you could modify stringnames, ive attempted it in this script, i dont know if its correct though…

also since this is gunna be for playerowned houses i used the #l to try simplify it down but i dont i did the right thing :frowning:

Can i have some more hints so i can keep on trying?

and btw should I just start this whole script over again since this one isnt as elegant as it could be?

Well, it’s messy as hell, but what you do is work with it in pieces.
Once the first piece works, move onto the next piece.

Read newfeatures2001.txt for fancy string handling, maybe a bit of 2002 if you want to practice “tokenize”

#L :]

ok ill rebuild the script in a cleaner way and repost when im finished lol
thx beholder

[QUOTE=bawng;45951]
ill script a furniture system for 100$ :slight_smile:
gonna need the moneyz upfront paypal
[/QUOTE]

LOL mybad

lol