ENIGMA Development Environment
Website is in read-only mode due to a recent attack.

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Josh @ Dreamland

That's what the local keyword does. It moves your declaration into the class scope. From the behavior you describe with the keyword in place, I'd say the code is working as intended, and the problem is more likely to lie in the code that works with those variables locally.

Developing ENIGMA / Re: Inheritance
« on: April 25, 2014, 07:59:38 PM »
To summarize our previous discussion for public record,
  • What you have is basically correct, but remember that checks which don't begin with {} are expressions and not code, and can just be inlined by the compiler. Super-checks are global and do not need rewritten.
  • Stacked events cannot call their parent's event dispatch method unless you guarantee that the child does not call any of the same events. You're better off just writing all the parent's event calls in with the child's, in those methods.
  • The big chain of ifs this case is fine. It's big if-else ladders we want to avoid, where the truth of any one implies the falsity of the others. These ifs are all independent and cannot be avoided. You should consider, though, that the code for myevent_alarm_0_subcheck and myevent_alarm_1_subcheck differs by very little, if not none at all, and can probably be consolidated into one method. This falls apart if the event does something screwy like construct variable names from the digit, which can frequently (but not always) be replaced with an array.

Off-Topic / Re: Environment Variables are Windows Only
« on: April 25, 2014, 07:37:18 PM »
When I was little, I used GM to make all sorts of things. Not just games. The ability to do things like edit the registry was crucial, and it taught me gobs about how my operating system worked. I wouldn't learn until later how flawed an approach this was, but hey, we all have to start somewhere.

The point is, yes, a typical game doesn't have any use for environment variables, and is typically concerned with its own directory only insofar as loading resources from a local folder is concerned. But I still value support for lower-level functionality.

Off-Topic / Re: Environment Variables are Windows Only
« on: April 23, 2014, 07:35:31 AM »
I'm pretty sure that anyone who actually knows what Unix is, is aware of this.

Off-Topic / Re: I want to like Chrome
« on: April 22, 2014, 10:09:03 PM »
So like I said, one tab per domain. I have like thirty GitHub tabs open, a dozen or so ENIGMA tabs open, six YouTube tabs open, some dozen or so pastebin tabs, twenty image tabs, and then the rest (probably another twenty) have unique domains. We're talking about a 70% savings.

If that is still giving you trouble, chances are, you aren't using those variables in obj_unit and they're being optimized out. You can argue the behavior is incorrect, but the alternative is disastrous. You can work around it by either referencing them in that object, or declaring them in it with local var team, max_moves, ap, hp;.

Polygone wrote something to work around that, but things tend to get broken, around here.

Programming Help / Re: function error
« on: April 22, 2014, 07:40:39 AM »
No, Harri; what he's presented is the number one use case for execute_string. We ought to have functions to look up a resource ID by name. It would require eight bytes of memory by default until first call, at which point it'd build a tree for later use, then use it to look up the sprite.

Variables always exist, legendarysnake. In ENIGMA, the instance creation event is performed after the object creation event, so you can override variables set in create from the instance creation code in rooms. That's the only reason people ever need to use variable_local_exists. Otherwise, use a ds_map.

Off-Topic / Re: I want to like Chrome
« on: April 22, 2014, 07:38:10 AM »
I prefer the Firefox method, or *maybe* one process for domain. But I'm quite happy with one-process browsing. One per window would be fine.

Issues Help Desk / Re: compiling for mac?
« on: April 20, 2014, 06:07:38 PM »
Okay, gcc -dM -xc++ -E $blank should still be cpp -dM -xc++ -E $blank. Whoever modified the Clang file to create that file didn't bother to look what they were doing. Sorry about that.

Issues Help Desk / Re: compiling for mac?
« on: April 20, 2014, 05:15:45 PM »
No, just swap -x c++ for -xc++ in it.

Issues Help Desk / Re: compiling for mac?
« on: April 20, 2014, 05:11:31 PM »
Go ahead and change it in gcc.ey, too, I guess.

Issues Help Desk / Re: compiling for mac?
« on: April 20, 2014, 05:09:06 PM »
Is it still reporting "-x c++" was read in the terminal?

Issues Help Desk / Re: compiling for mac?
« on: April 20, 2014, 05:05:18 PM »
That's... really strange, actually. But you can fix that by editing the other compiler descriptor file (gcc.ey), too. Or you can just set it to Clang.

Issues Help Desk / Re: compiling for mac?
« on: April 20, 2014, 05:00:08 PM »
Yeah, it's still reflecting the old key being read. Which compiler is selected under Enigma Settings → API?

Issues Help Desk / Re: compiling for mac?
« on: April 20, 2014, 04:44:45 PM »
That should be correct. Is it still not working?