• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

 Naming events

Agneum

Member
I don't know if I'm the only one who thinks this would be a good idea, but think of naming your user events.

For example, right now there are 0-15 user defined events which you can call at any time from other places. If I could rename those and call them by their name, that would be really interesting to play around with.
 
A

Ampersand

Guest
This is what scripts are for. You can also label code blocks so you know what they are in the object editor without opening the code editor. There are also user defined events. This would be nice to label them in the object editor, but you can also simply set a constant
my_death_event = 0 ;

then to call at any time

event_user(my_death_event) ;

and define this event in the object editor, Event > Other > User Defined > user 0
 

Agneum

Member
Sure, I could have "scrMove" or something, but the advantages of calling event_user(move) would be that each object that supports it would have its own implementation. Kind of like a polymorphism thing.. but maybe I'm thinking too much about it in this way..
 
A

Ampersand

Guest
Nested scripts and parse the object index.

define scr_move() ;
Code:
switch(object_index)
{
case obj1: scr_move_obj1() break ;
case obj2: scr_move_obj2() break ;
etc...
}
Still not sure why this is easier, but that should work for you from what information you've given us.
 
obj_a:
variable_a = scr_abc; // this is the script index of scr_abc(), "variable_a" is the name as you want

script_execute(variable_a);
// script_execute(variable_a, argument0, argument1, ......);

Normally, I would like to use the " script_execute() " than the " event_user() ", if i don't need the "event_inherit()".
 
Top