Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Utterly lost on this one... (https://forums.graalonline.com/forums/showthread.php?t=22110)

Gohan43331 01-26-2002 09:55 AM

Utterly lost on this one...
 
I am trying to make a 'potion' that the first time you use it, it sets that place as a warp, then subsequent uses causes you to warp there (up to 15 charges)

The problem is, it doesn't exactly warp you where you first used it...
NPC Code:

if (placeset) {
// i-- and set i to charges
setlevel2 #s(filename),strtofloat(#s(oldx)),strtofloat(#s(ol dy));
}
if (havntplaceset) {
setstring filename,#L;
setstring oldx,#v(x));
setstring oldy,#v(y));

set placeset;
unset havntplaceset;
} // And yes, i am using flags, cause i don't care. :P


Example:
oldx=10.1875
oldy=33.09375
x before use = 9.5
y before use = 32
x after use = 10.1875
y after use = 33.09375

adding int to the bolded parts above doesn't help either.

Have tried everything...but now i'm going to ask another mind to help me out.

Thanks,
Gohan

Gohan43331 01-26-2002 10:24 AM

Here's that whole section of the clip:
NPC Code:

if (weaponfired) {
if (placeset) {
putleaps 2,playerx+.5,playery+.5;
this.i = strtofloat(#s(charges)) - 1;
if (this.i == 0) {
setstring charges,;
destroy;
}
setstring charges,#v(this.i);
sleep .5;
setlevel2 #s(filename),strtofloat(#s(oldx)),strtofloat(#s(ol dy));
}
if (havntplaceset) {
setstring filename,#L;
setstring oldx,#v(x+1);
setstring oldy,#v(y);
playerx = strtofloat(#s(oldx));
playery = strtofloat(#s(oldy));
set placeset;
unset havntplaceset;
}
}



Bleeeh...this is so irritating. I checked my x and y before i used it and then i use it and i get switched x+1 or something...It's really messed up :(

Gohan

BocoC 01-26-2002 10:33 AM

setstring oldx,#v(x+1);
setstring oldy,#v(y);

I assume you want to set those with the player x and y...

setstring oldx,#v(playerx);
setstring oldy,#v(playery);

Gohan43331 01-26-2002 10:37 AM

lolololololol


:grrr: :grrr: :grrr:

meesa stupid :)

Thanks Boco


All times are GMT +2. The time now is 04:17 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.