• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

[SOLVED] Argument information/description for scripts

H

HelmutShaftshwingen

Guest
When I type instance_create() a little description shows up below that says: instance_create(x,y,obj)

how can I achieve this for a custom script?
I want to see the amount and type of arguments I need to fill in while I'm typing the script name.
 

jo-thijs

Member
When I type instance_create() a little description shows up below that says: instance_create(x,y,obj)

how can I achieve this for a custom script?
I want to see the amount and type of arguments I need to fill in while I'm typing the script name.
In GM:S 1.*, you start your script with 3 slashes, followed by the script name, an opening parentheses, the list of arguments and a closing parentheses, like so:
Code:
///scr_name(arg0, arg1, arg2)

code here
EDIT:
I've been ninja'd...
 

Jeremy

Member
GMS1:
Script name
:
teleport_to
Script content:
Code:
///teleport_to(x,y)
x = argument0;
y = argument1;
Will show as: teleport_to(x,y)

GMS2:
Script name
: teleport_to
Script content:
Code:
/// @description Teleport instance
/// @param {real} x The x coordinate
/// @param {real} y The y coordinate
x = argument0;
y = argument1;
Will show as: teleport_to(x,y)
 
Top