Pages: [1]
  Print  
Author Topic: Needed ENIGMA functions  (Read 1104 times)
Offline (Unknown gender) luiscubal
Posted on: September 06, 2010, 05:28:48 PM
Member
Joined: Jun 2009
Posts: 452

View Profile Email
I'm trying ENIGMA and I've noticed several functions aren't available. I'm curious regarding whether the following functions are just not-yet-implemented or if any of those won't ever be:

object_get_parent
instance_change
instance_place

I could easily implement/contribute instance_place, but I'll need a working implementation of object_get_parent for that...

BTW: Regarding compile syntax errors, ENIGMA says which errors occur and in what files, but not in which line. You really should address this.
Logged
Offline (Male) RetroX
Reply #1 Posted on: September 07, 2010, 06:47:31 AM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
instance_place requires the collision system to be working.

And it shows lines and line position for me.
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Offline (Unknown gender) luiscubal
Reply #2 Posted on: September 07, 2010, 09:00:13 AM
Member
Joined: Jun 2009
Posts: 452

View Profile Email
@RetroX Not for me. See screenshot. I used the svn checkout method yesterday(so I'm guessing it's a quite recent version), and tested my GM game using "Run".
Logged
Offline (Male) Josh @ Dreamland
Reply #3 Posted on: September 07, 2010, 11:59:16 AM

Prince of all Goldfish
Developer
Location: Ohio, United States
Joined: Feb 2008
Posts: 2953

View Profile Email
Luis: The beauty of the new instance system is that none of the engine functions require an object_get_parent().
Regarding your syntax error; if you open the file it mentions and press the syntax check button, it will highlight the place it occurs as well as print the line number and such in the status bar.

This is an implementation of instance_position, returning the first instance AT x,y.

Code: (C) [Select]
// Copyright Josh Ventura, etc.
int instance_place(int x,int y,int obj)
{
  for (enigma::inst_iter *it = enigma::fetch_inst_iter_by_int(obj); it != NULL; it = it->next)
  {
    if (x == ((enigma::object_planar*)it->inst)->x
    and y == ((enigma::object_planar*)it->inst)->y)
      return it->inst->id;
  }

  return noone;
}

I've already added it, of course. Look for it in the next revision.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Unknown gender) luiscubal
Reply #4 Posted on: September 07, 2010, 02:26:04 PM
Member
Joined: Jun 2009
Posts: 452

View Profile Email
Well, my game currently (ab)uses object_get_parent due to lack of proper object inheritance in GML.
I have no doubt that - if I had proper OOP tools in GML - I'd use them. But I've been coding in GM and those tools didn't exist, so I stuck to object_get_parent.
Will I have to rewrite those parts or can I just wait for ENIGMA to catch up?
Logged
Offline (Male) Josh @ Dreamland
Reply #5 Posted on: September 07, 2010, 02:36:03 PM

Prince of all Goldfish
Developer
Location: Ohio, United States
Joined: Feb 2008
Posts: 2953

View Profile Email
Just wait a bit; I'll get that implemented once I decide what I'm doing with sprite and object info.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Pages: [1]
  Print