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 10-13-2001, 11:57 PM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
Functions

ok ... i was wondering the exact way to test for functions and to apply functions ... can someone help me ....
Reply With Quote
  #2  
Old 10-14-2001, 12:39 AM
KJS KJS is offline
The one, The only -
KJS's Avatar
Join Date: Apr 2001
Location: USA, Minnesota
Posts: 1,012
KJS is on a distinguished road
Send a message via AIM to KJS
Re: Functions

Quote:
Originally posted by nyghtGT
ok ... i was wondering the exact way to test for functions and to apply functions ... can someone help me ....
what do you mean by test for functions?

you make functions like this
NPC Code:

if(created)
dostuff();
function dostuff(){
//coding
}

__________________
Thanks,
-KJL
Reply With Quote
  #3  
Old 10-14-2001, 02:31 AM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
k

i understood how to do fuctions but what i was unsure of was how to test using 'if' and i found out now ....
NPC Code:

if (actionMining) {
//commands
}

Reply With Quote
  #4  
Old 10-14-2001, 08:13 AM
btedji btedji is offline
bryan986
btedji's Avatar
Join Date: Apr 2001
Location: Force 10
Posts: 1,153
btedji is on a distinguished road
Send a message via ICQ to btedji Send a message via AIM to btedji Send a message via Yahoo to btedji
Re: k

Quote:
Originally posted by nyghtGT
i understood how to do fuctions but what i was unsure of was how to test using 'if' and i found out now ....
NPC Code:

if (actionMining) {
//commands
}

you didnt know how to use if?? j/k that looks like it would be used with triggeraction, a flag that starts with action is usually cause by triggeraction from another npc
Reply With Quote
  #5  
Old 10-14-2001, 08:26 AM
Xaviar Xaviar is offline
Registered User
Join Date: Aug 2001
Location: Fairyland
Posts: 463
Xaviar is on a distinguished road
Send a message via ICQ to Xaviar Send a message via AIM to Xaviar
Re: Re: k

Quote:
Originally posted by btedji


you didnt know how to use if?? j/k that looks like it would be used with triggeraction, a flag that starts with action is usually cause by triggeraction from another npc
Or you could be weird and start all your flags with 'action'...Just for the fun of it, you understand.
__________________
One by one, the penguins steal my sanity.

*cookie for Xaviar* --Originally posted by Tyhm

--Xaviar

A m e r i c a
Reply With Quote
  #6  
Old 10-14-2001, 10:52 AM
dragoonvenganc dragoonvenganc is offline
Registered User
Join Date: Jul 2001
Location: USA
Posts: 331
dragoonvenganc is on a distinguished road
Send a message via ICQ to dragoonvenganc Send a message via AIM to dragoonvenganc
while on functions.. i am not sure.. on Q basic a funcition does its action and returns a value but on graal useing a function is just like putting the whole function script there.. so it does it all right.. do you guys understand what i am saying..
__________________
Dragoon Vengance
Owner of Pangea Relics of Time
P2P Rp server
For info or job
Email: [email protected]
aim: dragoonvengnc
Reply With Quote
  #7  
Old 10-14-2001, 11:10 AM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
Re: Re: k

Quote:
Originally posted by btedji


you didnt know how to use if?? j/k that looks like it would be used with triggeraction, a flag that starts with action is usually cause by triggeraction from another npc
no i just didn't know how to test for a function thats all ...
but what i was oing was just asking how when i do:
NPC Code:

if (playerenters) {
mining()
}


how I would would use 'if' to check if it was occuring ....
Reply With Quote
  #8  
Old 10-15-2001, 12:30 AM
btedji btedji is offline
bryan986
btedji's Avatar
Join Date: Apr 2001
Location: Force 10
Posts: 1,153
btedji is on a distinguished road
Send a message via ICQ to btedji Send a message via AIM to btedji Send a message via Yahoo to btedji
Re: Re: Re: k

Quote:
Originally posted by nyghtGT

how I would would use 'if' to check if it was occuring ....
i dont think thats even possible, just dont make the function occur until you want it to
Reply With Quote
  #9  
Old 10-15-2001, 03:53 AM
Xaviar Xaviar is offline
Registered User
Join Date: Aug 2001
Location: Fairyland
Posts: 463
Xaviar is on a distinguished road
Send a message via ICQ to Xaviar Send a message via AIM to Xaviar
Re: Re: Re: Re: k

Quote:
Originally posted by btedji


i dont think thats even possible, just dont make the function occur until you want it to
I'll have to agree with you on that...

Nyght, heres an example:

if you use oh, say this:
if (playertouchsme) {
talk();
}

function talk() {
message Hello.;
sleep 3;
message ;
}

its the exact same thing as using this, the only difference is readability, and some performance issues:

if (playertouchsme) {
message Hello.;
sleep 3;
message ;
}


Got it?
__________________
One by one, the penguins steal my sanity.

*cookie for Xaviar* --Originally posted by Tyhm

--Xaviar

A m e r i c a
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 12:23 AM.


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