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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help SetLanternLitCallback
hunchbackproduction Offline
Junior Member

Posts: 36
Threads: 13
Joined: Jul 2013
Reputation: 0
#9
RE: SetLanternLitCallback

(07-29-2013, 07:37 PM)Tomato Cat Wrote:
(07-29-2013, 04:24 PM)hunchbackproduction Wrote: Alright, just came back from holidays and ready to code Big Grin

I ain't no pro haxor, so could you please explain to me wtf is a parameter and actually give me a example of the SetLanternLitCallback being used please xD.

Sorry for the hassle and thanks for the help so far dudes!

Welcome back!

A parameter is a value passed to a function. In the most basic sense.

PHP Code: (Select All)
//For example
public void addNumber(int iint k)
{
   
//Adds the sum of two numbers
   
print(k);


In this snippet, "i" and "k" represent integers. Their values are "passed" (think, "sent to") the function addNumber.

Say you wanted to use the function somewhere. You would write:

PHP Code: (Select All)
addNumber(31); 

In this case, the parameter "i" represents the integer value of 3. Whereas "k" represents 1.

Now, for the lantern callback, it's pretty much the same. Only what's passed is a "boolean" (true/false) type.

PHP Code: (Select All)
public void test(bool lanternLit)
{
   if(
lanternLit//Shorthand for if *** is "true"
   
{
      
//Code to keep the monsters away
   
}
   else 
//If the lanterLit value is "false"
   
{
      
//Code to get attacked by monsters
   
}


Only in this case, the parameter is passed internally.

Alrighty, making more sense now ^^ Your really good at this Big Grin I'll try this stuff out, then come back if I need some more clarification!

Scripting level is over 9000!
07-30-2013, 04:54 PM
Website Find


Messages In This Thread
SetLanternLitCallback - by hunchbackproduction - 07-19-2013, 05:32 PM
RE: SetLanternLitCallback - by Your Computer - 07-19-2013, 09:20 PM
RE: SetLanternLitCallback - by Tomato Cat - 07-20-2013, 01:02 PM
RE: SetLanternLitCallback - by Tomato Cat - 07-20-2013, 02:58 PM
RE: SetLanternLitCallback - by Tomato Cat - 07-29-2013, 07:37 PM
RE: SetLanternLitCallback - by hunchbackproduction - 07-30-2013, 04:54 PM
RE: SetLanternLitCallback - by SilentStriker - 08-03-2013, 09:31 PM
RE: SetLanternLitCallback - by Your Computer - 08-04-2013, 09:42 AM
RE: SetLanternLitCallback - by SilentStriker - 08-04-2013, 10:44 AM
RE: SetLanternLitCallback - by Tomato Cat - 08-04-2013, 01:33 AM
RE: SetLanternLitCallback - by PutraenusAlivius - 08-04-2013, 02:12 AM
RE: SetLanternLitCallback - by Tomato Cat - 08-04-2013, 03:06 AM
RE: SetLanternLitCallback - by PutraenusAlivius - 08-04-2013, 03:28 AM
RE: SetLanternLitCallback - by Tomato Cat - 08-04-2013, 03:34 AM



Users browsing this thread: 1 Guest(s)