|
|
polygone
 Joined: Mar 2009
Posts: 794
|
 |
Reply #1 Posted on: March 02, 2011, 03:49:05 AM |
|
|
|
Why is argument_relative not passed as a function parameter from actions?
|
|
|
RetroX
Master of all things Linux
 Joined: Apr 2008
Posts: 1,055
|
 |
Reply #2 Posted on: March 02, 2011, 03:50:22 AM |
|
|
|
I believe that it's done that way because of how the GML format is stored. Otherwise, it probably would have been passed as a parameter.
|
|
|
polygone
 Joined: Mar 2009
Posts: 794
|
 |
Reply #3 Posted on: March 02, 2011, 04:31:00 AM |
|
|
|
Why are the argument_* global variables a different scope to the rest of the global variables? I can't use them inside function definitions...
|
|
|
IsmAvatar
LateralGM Developer
 Joined: Apr 2008
Posts: 877
|
 |
Reply #4 Posted on: March 02, 2011, 04:33:55 AM |
|
|
|
polygone: Try to stay on topic here. Your question isn't really relevant. To answer your question, though, you should be able to use it. However it may not be defined in enigma, so it may be necessary to define it as a bool argument_relative in Definitions in order to use it.
|
|
|
|
|
IsmAvatar
LateralGM Developer
 Joined: Apr 2008
Posts: 877
|
 |
Reply #6 Posted on: March 02, 2011, 07:18:03 PM |
|
|
|
What is int required?
As I said in the other topic, I'm fine with it as long as it doesn't introduce problems with variable arguments and such.
|
|
|
Josh @ Dreamland
Prince of all Goldfish
 Joined: Feb 2008
Posts: 2,950
|
 |
Reply #7 Posted on: March 03, 2011, 02:40:46 AM |
|
|
|
If I may bud in, we have plenty of solutions to this issue.
1. Encase everything in {}. { argument_relative = true; action_do_shit(); } 2. Comma. argument_relative = true, action_do_shit(); 3. Parentheses and comma. This will solve if(). if((argument_relative=true, action_if(fuck_you))) ;
You'll find this more accurately mimics GM's behavior. Particularly the last one. (argument_relative = false, do_shit()) is rather form-fitting, syntactically.
IsmAvatar: `int required` is the required parameter. Int was an example. He was implying that the function would be backwards compatible, but would allow LGM to set an argument relative. I object because the additional stack push and assignment is baloney.
|
|
|
IsmAvatar
LateralGM Developer
 Joined: Apr 2008
Posts: 877
|
 |
Reply #8 Posted on: March 03, 2011, 07:11:36 AM |
|
|
|
if((argument_relative=true, action_if(fuck_you))) ;
That really works? Done.
|
|
|
Josh @ Dreamland
Prince of all Goldfish
 Joined: Feb 2008
Posts: 2,950
|
 |
Reply #9 Posted on: March 03, 2011, 02:23:35 PM |
|
|
|
Indeed. Even if it didn't, we could use && instead of the comma for true, and || instead of it for false, in the case of if().
|
|
|
polygone
 Joined: Mar 2009
Posts: 794
|
 |
Reply #10 Posted on: March 03, 2011, 03:13:46 PM |
|
|
|
I don't get? Isn't it just better to pass it as an argument anyway? It seems preferable for function calling.
|
|
|
|
|
RetroX
Master of all things Linux
 Joined: Apr 2008
Posts: 1,055
|
 |
Reply #12 Posted on: March 08, 2011, 09:09:15 PM |
|
|
|
Hey, TGMG. Please inline functions in actions.h by prefixing them with the word "inline." The one-line ones, anyways.
|
|
|
|
|
|