![]() |
function question
Does stuff like this work?
NPC Code: I've tried it and nothing happens but if its messed up somewhere please correct me. |
It won't work, no. Graal has no support for function parameters at the moment.
|
All a function is in graal is code replacement.... like saying
if(true){ dothis(); } function dothis(){ message done!; } is the same as if(true){ message done!; } |
Fuctions are more of a branch.
initial code branches to the fuction and then comes back. Fuctions branch to other fuctions. etc etc. Think of it as sort of a Tree (like the side bar in Explorer for windows My Computer stuff) rather than standard replacement. |
Quote:
|
Yes bhala, in graal thats exactly what it does, but it doesnt acually work like that =\.
|
Whats the point of explaning the internal workings when all he needs to know is what it does?
|
Maybe to not rot out his mind if he wants to try other, more practical forms of programing like C++ ;)
|
lol true...
|
Quote:
|
Quote:
I know better;) |
Well about the new engine, a few weeks back Stefan said about a year...
Which sucks, however functions are very useful with classes and arrays. I don't understand when people have a function that they only call once, because one of the points of functions is things you use more than once, like this: NPC Code: Now since this is a Graal function and Gscript, there is no real reason for the return, however I have always thought it should help with execution so that the function knows it has returned so it doesn't have to keep looking for code. In something more like PHP you may have code like this: PHP Code:
|
| All times are GMT +2. The time now is 08:45 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.