Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Problem with scripting (https://forums.graalonline.com/forums/showthread.php?t=6100)

Huggles 06-30-2001 01:42 AM

Problem with scripting
 
How does onwall, strings, variables, onwall2, tokenize, and loops work?

Im confused deeply on these things

I want to learn how to make loops and make npcs chase players atleast

T-Squad 06-30-2001 01:45 AM

i will tell on ICQ...

Huggles 06-30-2001 02:46 AM

Okay I think I got the drift

Ok lets say I can command a object.... and I want to make it hide would this be correct script?

if (playerenters && #a(Captain-USA)) {setstring #a (Captain-USA)
if (playerchats && #a(Captain-USA)) {#c, Hide NPC; setstring Hide NPC;}
if (strequals t#(Hide NPC)) {hide;sleep 5;show}

Now if I want it to unhide would it be....

if (playerenters && #a(Captain-USA)) {setstring #a (Captain-USA)
if (playerchats && #a(Captain-USA)) {#c, Hide NPC; setstring Hide NPC; #c Unhide NPC; setstring Unhide NPC}
if (strequals #t(Hide NPC) || #t(Unhide NPC)) {#c,Hide NPC;hide || #c,Unhide NPC; show}

Huggles 06-30-2001 02:59 AM

Wait is this it?
// NPC made by Captain USA
if (playerenters && #a,Captain-USA) {setstring #a,Captain-USA}
if (playerchats && #a,Captain-USA && #c,HideNPC) {setstring Hide NPC,1;}
if (playerchats && #a,Captain-USA && #c,UnhideNPC) {setstring Unhide NPC,2;}
if (strequals,#t1) {hide;}
if (strequals,#t2) {show;}

entravial 06-30-2001 03:06 PM

*AlphaFlame*

Err... kinda...

// NPC made by Captain USA
if (playerchats && strequals(#a,Captain-USA) && strequals(#c,HideNPC)) {hide;}
if (playerchats && strequals(#a,Captain-USA) && strequals(#c,UnhideNPC)) {show;}


Didn't need the first line or the last two :P

grim_squeaker_x 06-30-2001 03:18 PM

Quote:

Originally posted by entravial
*AlphaFlame*

Err... kinda...

// NPC made by Captain USA
if (playerchats && strequals(#a,Captain-USA) && strequals(#c,HideNPC)) {hide;}
if (playerchats && strequals(#a,Captain-USA) && strequals(#c,UnhideNPC)) {show;}


Didn't need the first line or the last two :P

I prefer:
NPC Code:
if (playerchats&&strequals(#a,Captain-USA)) {
if (strequals(#c,HideNPC)) hide;
if (strequals(#c,UnHideNPC)) show;
}


tecgoku234 06-30-2001 03:42 PM

Quote:

Originally posted by grim_squeaker_x
I prefer:
NPC Code:
if (playerchats&&strequals(#a,Captain-USA)) {
if (strequals(#c,HideNPC)) hide;
if (strequals(#c,UnHideNPC)) show;
}


yeah, same here

it just makes the code cleaner.

toad1413 06-30-2001 04:07 PM

Quote:

Originally posted by grim_squeaker_x
I prefer:
NPC Code:
if (playerchats&&strequals(#a,Captain-USA)) {
if (strequals(#c,HideNPC)) hide;
if (strequals(#c,UnHideNPC)) show;
}


That's the way I'd do it. I havent even started learning hot to use setstring. lol

Brady2 07-05-2001 02:48 PM

-Posted by Jadis

And I prefer
no

grim_squeaker_x 07-05-2001 03:15 PM

Quote:

Originally posted by Kaimetsu


And I prefer:

NPC Code:

if(playerchats){
if(strequals(#a,Captain-USA)){
if(strequals(#c,HideNPC)) hide;
elseif(strequals(#c,UnHideNPC)) show;
}
}



More efficient, y0.

Yes okay it's indeed easier to add extra accounts with different options with this, but I always do it in the way I just did it if it's for only one account.


All times are GMT +2. The time now is 08:49 PM.

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