Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Bomy Island Main Forum (https://forums.graalonline.com/forums/forumdisplay.php?f=80)
-   -   Stefan... (https://forums.graalonline.com/forums/showthread.php?t=1700)

FxChiP 04-23-2001 12:38 AM

Is the script parsing feature allowed on non-P2P servers?

waar 04-23-2001 12:44 AM

par.....se...eeengg??

FxChiP 04-23-2001 12:56 AM

Should be where you can pick out a string from a line and use it for whatever reason. You could make new "server commands" with it. :)

grim_squeaker_x 04-23-2001 01:19 AM

Actually...
 
You can do that with it ;)
Let's see now this would be a script which should work for warpto simulation:
NPC Code:

if (playerchats&&startswith(warpto,#c)) {
tokenize2 ,,#c;
if (tokenscount==2) setlevel #t(1);
else if (tokenscount==3) {
playerx=#t(1);
playery=#t(2);
}
else if (tokenscount==4) setlevel2 #t(1),strtofloat(#t(2)),strtofloat(#t(3));
}


Just try it, you can then use warpto offline ;)

Nai 04-23-2001 01:26 AM

heh, that is cool. I could use that for my personel world I am making. Very good and cool.

FxChiP 04-23-2001 01:36 AM

Grr
 
Damn it, I already know how to parse strings, I'm just asking if it's alright to use in a non-p2p server.

Besides, if you're gonna warp x/y, you don't have to use tokenize2... watch:

NPC Code:

if (playerchats) {
tokenize #c;
}

if (strequals(#t(0),warptopoint)) {
playerx = strtofloat(#t(1));
playery = strtofloat(#t(2));
}



Anyway, all I want to know is if it's alright with Stefan to use it on a non-P2P world.

FxChiP 04-23-2001 01:38 AM

Oh yeah, I don't think strings can serve as real variables, but if they can, here's shorter warpto code:

NPC Code:

if (playerchats) {
tokenize #c;
}

if (strequals(#t(0),warpto)) {
setlevel2 #t(1),#t(2),#t(3);
}



grim_squeaker_x 04-23-2001 01:50 AM

Blah.
 
I used the tokenize2 to allow true warpto stuff, because if you have that power you say:
Quote:

warpto levelname,x,y
And I used the strtofloat in it because Graal gives an error when you don't use strtofloat while using Strings in the setlevel2 command ;)
And as for the other thing we'll just have to wait till Stefan replies ^^

FxChiP 04-23-2001 01:53 AM

Yeah, I had just caught that you used strtofloat after I posted it, and decided not to edit my post. I don't know why.

grim_squeaker_x 04-23-2001 01:56 AM

Heh, I made a mistake myself with the playerx and playery anyway ^^

FxChiP 04-23-2001 01:58 AM

Well
 
Yeah.

For some reason, I usually experiment with new commands as soon as I know about them :P

Just to figure out how they'd be useful to me. :)

Tyhm 04-23-2001 03:00 AM

Heh...I keep asking him what we're allowed to and not allowed to use on Classic, but he won't tell me...I'm not entirely sure we're included in the PW category, since we're sorta the G2K1 Demo Version...

btedji 04-23-2001 03:15 AM

Another way
 
Here is another way you could make a warpto function:

if (playerchats&&startswith(warpto ,#c))
{
players[0].x=strtofloat(#e(7,2,#c));
players[0].y=strtofloat(#e(10,-1,#c))
}

That is a little shorter than using tokenize but not sure if it is the best way to do it.

---------------
bryan986
Navarone PW Owner

vergil 04-23-2001 03:31 AM

shouldn't this go in the Levels and NPC forum?

FxChiP 04-23-2001 06:48 AM

Stefan won't notice it there.

Besides, this topic wasn't intended for script discussion for warpto and such, but someone had to bring it up. :P


All times are GMT +2. The time now is 04:23 PM.

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