Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-26-2002, 09:55 AM
Gohan43331 Gohan43331 is offline
Registered User
Join Date: Jan 2002
Posts: 87
Gohan43331 is on a distinguished road
Send a message via AIM to Gohan43331
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
Reply With Quote
  #2  
Old 01-26-2002, 10:24 AM
Gohan43331 Gohan43331 is offline
Registered User
Join Date: Jan 2002
Posts: 87
Gohan43331 is on a distinguished road
Send a message via AIM to Gohan43331
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
Reply With Quote
  #3  
Old 01-26-2002, 10:33 AM
BocoC BocoC is offline
Registered User
BocoC's Avatar
Join Date: Jun 2001
Location: Washington State, USA
Posts: 980
BocoC is on a distinguished road
Send a message via AIM to BocoC Send a message via Yahoo to BocoC
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);
__________________
-Boco

FLKJH$TRFG*$(&%>FMG >REN<>F ;.kjsd
Reply With Quote
  #4  
Old 01-26-2002, 10:37 AM
Gohan43331 Gohan43331 is offline
Registered User
Join Date: Jan 2002
Posts: 87
Gohan43331 is on a distinguished road
Send a message via AIM to Gohan43331
lolololololol


:grrr: :grrr: :grrr:

meesa stupid

Thanks Boco
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:53 AM.


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