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 06-30-2001, 01:42 AM
Huggles Huggles is offline
Should I care anymore?
Huggles's Avatar
Join Date: Apr 2001
Location: Arizona
Posts: 2,127
Huggles is on a distinguished road
Send a message via AIM to Huggles Send a message via Yahoo to Huggles
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
__________________
Captain USA, Or Captin USA

Plain and simple.
Reply With Quote
  #2  
Old 06-30-2001, 01:45 AM
T-Squad T-Squad is offline
Banned
T-Squad's Avatar
Join Date: Mar 2001
Location: United States of America
Posts: 1,733
T-Squad is on a distinguished road
i will tell on ICQ...
Reply With Quote
  #3  
Old 06-30-2001, 02:46 AM
Huggles Huggles is offline
Should I care anymore?
Huggles's Avatar
Join Date: Apr 2001
Location: Arizona
Posts: 2,127
Huggles is on a distinguished road
Send a message via AIM to Huggles Send a message via Yahoo to Huggles
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}
__________________
Captain USA, Or Captin USA

Plain and simple.
Reply With Quote
  #4  
Old 06-30-2001, 02:59 AM
Huggles Huggles is offline
Should I care anymore?
Huggles's Avatar
Join Date: Apr 2001
Location: Arizona
Posts: 2,127
Huggles is on a distinguished road
Send a message via AIM to Huggles Send a message via Yahoo to Huggles
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;}
__________________
Captain USA, Or Captin USA

Plain and simple.
Reply With Quote
  #5  
Old 06-30-2001, 03:06 PM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to 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
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #6  
Old 06-30-2001, 03:18 PM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
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;
}

__________________

Reply With Quote
  #7  
Old 06-30-2001, 03:42 PM
tecgoku234 tecgoku234 is offline
Registered User
Join Date: Mar 2001
Posts: 21
tecgoku234 is on a distinguished road
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.
__________________
Temporary disabled
Stefan Knorr
Reply With Quote
  #8  
Old 06-30-2001, 04:07 PM
toad1413 toad1413 is offline
toad@graal:~$ ./Oldbie
Join Date: May 2001
Location: Aust.
Posts: 3,819
toad1413 is on a distinguished road
Send a message via ICQ to toad1413
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
__________________
Creator of the original 'spam' icon. Worst mistake I ever made on these forums.
Reply With Quote
  #9  
Old 07-05-2001, 02:48 PM
Brady2 Brady2 is offline
Registered User
Brady2's Avatar
Join Date: Mar 2001
Location: Phoenix, AZ and Wichita Falls, TX
Posts: 924
Brady2 is on a distinguished road
-Posted by Jadis

And I prefer
no
__________________
Reply With Quote
  #10  
Old 07-05-2001, 03:15 PM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
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.
__________________

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:39 AM.


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