Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script help
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#5
RE: Script help

I actually wrote this like 4 hours ago but forgot to post it... lol

When calling int MyFunction you do it the same was as calling it as if it were a void function. In your parent function simply put MyFunction(); and you're all set. And no, not all functions can be int or string; if you have an int function it has to return and integer. If you have a string function it has to return a string, and so on. Void functions don't return any values.

You get the return value by calling the function elsewhere. So if you want to get the value later just call the function again. You can store it as a local variable by doing SetLocalVarInt("returnvalue", Func()); and then using the variable elsewhere.

In place of your // some scripts line you would place code which returns different values depending on different conditions. There's little reason to have a function returning a value unless there are different conditions which would change the effect of its parent function. Use if statements for this purpose Smile

(This post was last modified: 07-29-2011, 07:29 AM by palistov.)
07-29-2011, 07:28 AM
Find


Messages In This Thread
Script help - by DRedshot - 07-28-2011, 09:35 PM
RE: Script help - by palistov - 07-28-2011, 10:07 PM
RE: Script help - by DRedshot - 07-28-2011, 11:52 PM
RE: Script help - by Your Computer - 07-29-2011, 04:13 AM
RE: Script help - by palistov - 07-29-2011, 07:28 AM
RE: Script help - by DRedshot - 07-29-2011, 11:08 AM
RE: Script help - by palistov - 07-29-2011, 01:24 PM



Users browsing this thread: 1 Guest(s)