Ducktards
  • Home
  • Behind the Scenes
  • Daily Dev
  • Server stuff

Scripts

26/6/2016

 
Methods, functions, scripts. They're all the same thing, and they're all really simple! Click read more to learn!
Picture



​

​You put something in
Picture




​


​

​
​
and something else comes out!
Picture





​


​

​
Let's start simple
Picture
Picture

​For example, we could make a script that adds 1

GML

Num = Add_One( 5 );

Python
Num = Add_One( 5 )
​
Num would equal 6, obviously!






​
​
But how does it actually work?
Picture

GML
var original_value = argument0;    //Read the pass in
return original_value + 1;                  //Return the value, plus 1

​
​
​
Python
def
Add_One( original_value ):       #Define the script
    return original_value + 1               #Return the value, plus 1









​
Look, even scratch has scripts!
Picture

    Only show:

    All
    Dev
    Documentation
    Networking
    Tutorial

  • Home
  • Behind the Scenes
  • Daily Dev
  • Server stuff