![]() |
Functions and junk
I'm working on a script for something and I'm wondering if it's possible to call a function from within a function.
Something like: NPC Code: I'm not sure cause it isn't working to well with what I have. I'm actually testing for a position, and a keydown while at that position. |
Its very possible to use a function inside a function....
|
Ok, thanks. Now to figure out what's wrong with it...
|
[screen_name says:]
what does the command 'return' do?? i will probably feel stupid when someone tells me |
Return returns to the part of the script that called the function. In most scripting laungages, when you use return you return information back to the main script, but graal doesn't support that, in graal functions act as if they are just part of the script typed out in a different place.
|
[screen_name says:]
so would this following code be considered good use of the return command NPC Code: now this will make you say this.counter's value without having to say 'doit' again, right so, if you are using functions in a timeout, you dont necessarily need returns right?? unless something below is using the new value?? |
Ive done threefold functions...function in a function which is in another function...it goes as far as you want
|
erm no screen_name... if a function is finished, it automatically returns to the main script. It's rather for doing stuff like this...
NPC Code: |
[screen_name says:]
okay, i think i understand |
And don't use playersays =P Use playerchats && strequals(#c,)
|
[screen_name says:]
i usually do, but playersays was faster to type |
if for some reason you dont use player chats here is another way
if(strequals(#c,blah)){ setplayerprop #c,; ...commands... } |
[screen_name says:]
im not a new scripter, i've been scripting npcs for graal for 2 1/2 years or so |
u can also use break i believe
|
Quote:
|
| All times are GMT +2. The time now is 10:51 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.