PDA

View Full Version : local. strings?


contiga
12-08-2006, 06:35 PM
Works:
setstring local.weapon,fishingrod;
initWeapon();

Doesn't work:
local.weapon = "fishingrod";
initWeapon();

(At Stefan, see +FishingRod on Debug)
Anyone has an explaination?

Loakey_P2P
12-08-2006, 07:54 PM
ive had that type of problem before but i dont remmber how i managed to fix it . at one time i had string's that wouldnt set unless i did it the old way couse the new one wouldnt work .


old example * setstring string,value;

new example * this.string = "value";

but id bet your too good to make the mistake of setting a string on the wrong side (client/server) . i think i may have solved the problem by deleteing the npc .

contiga
12-08-2006, 08:08 PM
old example * setstring string,value;

new example * this.string = "value";


Ghehe, yeah I knew that >_< Skyld already thought it had to do with the Engine.. which I agree with. So I guess Stefan can only fix it. ;)

Gambet
12-08-2006, 10:07 PM
What exactly doesn't work? When I set a local variable, it sets correctly.

contiga
12-08-2006, 11:24 PM
What exactly doesn't work? When I set a local variable, it sets correctly.

It sets local.* to something, and when doing player.chat = local.*; it also shows what it's set to.. but it can't be read by multiple NPC's.. (a joined class in this case). I have to use setstring local.*,foo; for that (the GS1 ****).

Admins
12-09-2006, 02:36 AM
All variables set with setstring that don't have a special leading (this., thiso., server., serverr.) are added to the player (like in GS1), so you need to do

player.local.weapon = "fishingrod";

to stay compatible with the current scripts.

contiga
12-09-2006, 07:36 PM
All variables set with setstring that don't have a special leading (this., thiso., server., serverr.) are added to the player (like in GS1), so you need to do

player.local.weapon = "fishingrod";

to stay compatible with the current scripts.

Problem solved, thanks!