ENIGMA Forums

Outsourcing saves money => Programming Help => Topic started by: Mikelle02 on February 17, 2016, 10:22:53 am

Title: Help! Make a Game Maker project compatible with Enigma.
Post by: Mikelle02 on February 17, 2016, 10:22:53 am
Hi everyone ,
I'm a Noob here.
I started to use Enigma right after Game Maker 8.1 .
I noticed I can't exeute none of my projects I made with Game Maker 8.1 so I want to know how to format my all of my projects to be executed on Enigma ?

However for what platform can I compile to ?
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: TheExDeus on February 17, 2016, 02:58:32 pm
LGM (the IDE for ENIGMA) can load GMK, GMX and some older formats too. For 8.1 I think it's best to use GMK. ENIGMA probably won't run your projects out-of-the-box, as GM and ENIGMA is not 100% compatible. But converting is usually trivial.

ENIGMA runs on Windows (100% sure as I use it), Linux and Mac (I'm 80% sure). No other platforms, sorry. You can try posting a game here and I will see if I can help running it.
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: Mikelle02 on February 20, 2016, 07:35:23 am
I managed to convert an old Game maker 8.1 project.
It's an Asteroids game I'm making to learn and practise gml programming language.
I succeffuly ported the game to Enigma and now I can run the game with both Game maker 8.1 and Enigma.

Now the problem is that Enigma feels to slow to perform a simple instance_create function.

Let me explain better.

This is a cut of a part of the STEP event of my obj_button object:
Code: [Select]
   if (keyboard_check(vk_enter))
  {
    obj_button.visible =false;
    obj_menu_init.visible=false;
  };
That code will hide Play,Continue,Settings and the button from the screen during the Settings windows is opened.

This is the full code of the STEP event of my obj_system object:
Code: [Select]
if room == rm_menu
{
 with (other)
 {
 if obj_button.visible =false && obj_menu_init.visible=false
  {
  if !instance_exists (obj_settings_menu_a)
   {
    instance_create (0,0,obj_settings_menu_a);
    if keyboard_check (vk_backspace)
    {
     obj_button.visible =true;
     obj_menu_init.visible =true;             
    }; 
   };
   if keyboard_check (vk_backspace)
   {
     with (obj_settings_menu_a)
    {
     instance_destroy ();
    };
   }; 
  };
 };
};
That code will check if there is a settings menu state to create or destroy the object object_settings_menu_a.

This is the full code of the DRAW event of object_settings_menu_a for now:
Code: [Select]
   draw_set_alpha(0.5);
   draw_set_color(c_black);
   draw_rectangle(0,0,room_width,room_height,0);
It explains itself.

All the project runs perfectly in Game Maker 8.1 but for no kid of reason for me not as well in Enigma which takes times to perform all the code I wrote here.
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: Mikelle02 on February 20, 2016, 07:47:34 am
I found that the project will perform the DRAW event only if i press vk_space right after vk_enter to enter in the settings menu.
Do I miswrote something ?
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: Mikelle02 on February 23, 2016, 06:32:12 am
LGM (the IDE for ENIGMA) can load GMK, GMX and some older formats too. For 8.1 I think it's best to use GMK. ENIGMA probably won't run your projects out-of-the-box, as GM and ENIGMA is not 100% compatible. But converting is usually trivial.

ENIGMA runs on Windows (100% sure as I use it), Linux and Mac (I'm 80% sure). No other platforms, sorry. You can try posting a game here and I will see if I can help running it.

Okay , forgot the code I wrote before.
I even change the code of the STEP event of my obj_system object into :
Code: [Select]
with (other)
 {
 if obj_button.visible==false && obj_menu_init.visible==false
  {
  if !instance_exists (obj_settings_menu_a)
   {
    instance_create (0,0,obj_settings_menu_a); 
   };
   if instance_exists (obj_settings_menu_a)
   {
    if keyboard_check (vk_backspace)
    {
      with (other)
     {
      obj_button.visible =true;
      obj_menu_init.visible =true;
     };
      with (obj_settings_menu_a)
     {
      instance_destroy ();
     };
    };
   }; 
  };
 };

Again Game Maker 8.1 works Enigma NOT.
But I found something very interesting.
Every time I execute my project in Enigma I got this.
(http://)
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: time-killer-games on March 12, 2016, 03:35:51 pm
try removing the spaces before function parentheses. May or may not be of any use to you.
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: TheExDeus on March 13, 2016, 10:51:27 am
I haven't managed to get your error trough the code you gave, as we lack info about obj_menu_init, obj_button and so on. I don't think the bug is in the code you gave and it might be elsewhere. So either give a simple example or try debugging.
To debug:
Compile in debug mode. Then run command line "cmd", go to the directory you have your exe ("cd c:/path/to/my/dir") and run trough debugger ("gdb my_game.exe"). Then type "run". After it crashes type "bt" to get the backtrace. Then post it here, it will show where the error happened.

Quote
I even change the code of the STEP event of my obj_system object into :
This doesn't crash either, even though it is not valid. "other" in step event outside of a "with(){}" statement doesn't make sense. So while it doesn't crash, I don't know what would actually execute there.

Quote
try removing the spaces before function parentheses. May or may not be of any use to you.
I don't see how it could matter. Maybe a parser bug could have a problem with that, but I doubt it's the issue here.
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: Mikelle02 on March 25, 2016, 05:04:53 am
I managed to get it working.
I'll attach the files to let see the changes.
As I said I'm totally Noob , but I want to learn  :) so if someone has a suggestion for me let me know it.
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: Mikelle02 on March 25, 2016, 05:11:22 am
I tested both using GM8.1 and Enigma
However .-. do you know if it is possible to export to export to an Arm Linux platform ?
To be precise I would like to export the executable to an ARM Cortex A8 platform which has PowerVR SGX Gpu with OpenGL Es 2.0 Support and 512 MB DDR SDRam.
Is it possible ?
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: TheExDeus on March 26, 2016, 07:15:24 am
Quote
OpenGL Es 2.0
This would be the main problem. We don't have GLES support yet, but technically it shouldn't be that hard to adapt the GL3.3 system to it. ARM itself is not an issue, as the ENIGMA engine itself is pure C++ with few real 3rd party dependencies, and so it should be possible to be compiled to ARM. I have actually ran LGM on Nvidia Jetson TK1, which is ARM, and was able to compile an empty game, as it supports GL3 for rendering. Sadly I'm the only one who works on ENIGMA engine right now and I don't have GLES as a priority now. Maybe another contributor can try.

I will check the changes you did.
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: Hoohee on September 03, 2017, 03:07:45 pm
I got mine to load, but the character doesn't appear, and maybe it's the draw event that doesn't work with Enigma.  Take a look at this, and see if it looks bad to you.
Code: [Select]
draw_sprite_ext(sprite_index,-1,x,y,image_xscale,image_yscale,image_angle,image_blend,image_alpha)It works in GM8, but not in Enigma.
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: hpg678 on September 03, 2017, 03:40:24 pm
I got mine to load, but the character doesn't appear, and maybe it's the draw event that doesn't work with Enigma.  Take a look at this, and see if it looks bad to you.
Code: [Select]
draw_sprite_ext(sprite_index,-1,x,y,image_xscale,image_yscale,image_angle,image_blend,image_alpha)It works in GM8, but not in Enigma.

the problem seems to be [-1] which is to represent the sub-image of the sprite. A value of -1 indicates an invisible or non-existent sprite. Sprites sub-image starts from 0.

If you have an animated sprite, then the sub-images would start from 0 to the number of images-1. E.g if you have an animated sprite with a total of 5 images, then the sub-images with be numbered from 0 to[4].
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: faissaloo on September 04, 2017, 08:26:47 am
I got mine to load, but the character doesn't appear, and maybe it's the draw event that doesn't work with Enigma.  Take a look at this, and see if it looks bad to you.
Code: [Select]
draw_sprite_ext(sprite_index,-1,x,y,image_xscale,image_yscale,image_angle,image_blend,image_alpha)It works in GM8, but not in Enigma.

the problem seems to be [-1] which is to represent the sub-image of the sprite. A value of -1 indicates an invisible or non-existent sprite. Sprites sub-image starts from 0.

If you have an animated sprite, then the sub-images would start from 0 to the number of images-1. E.g if you have an animated sprite with a total of 5 images, then the sub-images with be numbered from 0 to[4].
This is incorrect, -1 will animate the sprite.
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: hpg678 on September 04, 2017, 10:12:31 am
so sorry about that. I was indeed wrong. i was thinking in terms of the sprite being visible or not and got mixed up.

try adding the statement (draw_self) in the DRAW event and see what happens.

also maybe in that case you may need to define the (sprite_index);
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: Hoohee on September 04, 2017, 10:23:02 pm
so sorry about that. I was indeed wrong. i was thinking in terms of the sprite being visible or not and got mixed up.

try adding the statement (draw_self) in the DRAW event and see what happens.

Where, exactly?  It didn't work to write this:
Code: [Select]
draw_self draw_sprite_ext(sprite_index,-1,x,y,image_xscale,image_yscale,image_angle,image_blend,image_alpha)
also maybe in that case you may need to define the (sprite_index);

I can try some stuff out for that.

Also, if this helps, the object that isn't appearing is the player character.  All others render right, so far as I can tell.
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: Goombert on September 05, 2017, 01:55:51 am
I think this might actually be a bug I introduced in ENIGMA. The problem is that you are probably not drawing anything else. Try to add draw_set_color(c_red); directly after the players drawing code or add the following if you were using the default drawing:

Code: (edl) [Select]
draw_set_color(c_white);
draw_self();
draw_set_color(c_red);

If that fixes it then that should confirm the bug I think exists. Basically when I introduced the global batching system I don't think I made it flush itself if there isn't any state change at all. I keep randomly hitting this issue myself.
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: hpg678 on September 05, 2017, 05:29:41 am
that's quite interesting to hear Goombert. I've been using ENIGMA on my LINUX machines and I've yet to encounter such a bug. Of course, I've encountered others but that's another story.

The bit of code given is excellent. However for the sake of newbies who may be reading this post, I wish to clarify a few things on two sets of code.

'draw_set_color(c_white)' used in the Draw event sets what is called the base color of the room or object referred to. The base color affects all the other elements, like fonts, text, forms primitives and 3D.
'draw_self()' used in the same Draw event is a function that forces the sprite's image, (whether you indicate one or not) to be drawn.


Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: Hoohee on September 06, 2017, 02:46:18 am
That turned the text red, but it didn't fix my actual problem--yet.  Is this how the full code should look?
Code: [Select]
draw_sprite_ext(sprite_index,0,x,y,image_xscale,image_yscale,image_angle,image_blend,image_alpha);
draw_set_color(c_white);
draw_self();
draw_set_color(c_red);
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: Goombert on September 06, 2017, 09:24:33 am
Yeah, is that in the object that isn't drawing? Strange, and it's exactly what I've encountered before. Basically what I did is make all the general drawing functions go into a single vertex buffer before being sent to the GPU (this is called batching and GameMaker: Studio now does the same thing, it's faster this way). But if you change the drawing color, texture, or draw a shape of a different stride (any kind of a state change) it has to "flush" that vertex buffer to the GPU, as in actually draw the contents of the vertex buffer, clear it and start over.

Anyway, I basically just never added a check to draw the vertex buffer I think if no state change ever occurs, i.e. you draw a few things but never change the texture or color. That was a mistake and should be fixed in ENIGMA if I am truly remembering correctly. I could be wrong, I may have actually added such a check or it may just be malfunctioning in some other way.

One other thing you can try is to draw a circle in place of setting the drawing color to white.
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: Hoohee on September 06, 2017, 01:51:14 pm
I ended up getting the thing to render just by throwing out the code and using the default draw action.  I'm not sure why I had the code, but for now the draw action works.  So on to the next issue.

I have multiple objects that are programmed to jump to the position of another, or near it.  One of these is an accessory that warps to around the player character when a button is held--or at least, it did in Game Maker 8.  For some reason here, though, it gets reversed; instead of the accessory jumping to the position around the player character, the player character jumps to where the accessory starts!  There are other weird things, too, but let's start with this one; why is it happening?
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: Goombert on September 08, 2017, 05:25:56 am
Oh boy, I can't really say without seeing how the "jumping" is done. I am also not that familiar with our collision systems, just never worked on them much. It might be helpful to post the relevant actions or code you are using to make the jumps.
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: hpg678 on September 08, 2017, 07:05:24 am
what you can also do is download a screen recorder Like Snaggit, to record the strangeness you encounter, post it as well as the segment of code.

Snaggit can be downloaded from here http://download.cnet.com/Snagit/3000-2192_4-10004813.html (http://download.cnet.com/Snagit/3000-2192_4-10004813.html)

I also recommend you watch this video..... https://youtu.be/8kHOsRSRbaA (https://youtu.be/8kHOsRSRbaA) .


Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: Hoohee on September 10, 2017, 01:38:21 am
Alright, I have done some troubleshooting experimentation, and it would seem that the Step events are what cause the bug.  I've attached two slightly different versions of a sample "game" I made to figure this out, so if possible run each of them, first in Game Maker and then in Enigma, to duplicate my findings.

"JumpDemonstration" works like this: There is a ball object, and an arrow object.  The arrow starts in a different place, but pressing J makes the arrow jump so it points to the ball.  It doesn't ever jump back in this version, since there's no release event.  This version works identically in Game Maker and in Enigma, proving that, contrary to what I postulated earlier, jumping to positions in itself is not glitched in Enigma.

"JumpDemonstration1" responds to the J button both being pressed and being released.  To do this, I employed a binary variable (called "Jump"), triggered in Create, Key Press, and Key Release events, and checked during the Step event.  Press J, and the arrow jumps and points to the ball; release J, and the arrow jumps back to its original position.  Now try it in Enigma instead: Unlike last version; this one works differently.  No code whatsoever has been changed (at least not that I can see), but in Enigma, it's the ball that jumps when you press J.

What I seem to have discovered is a bug where during Step events, if you tell "Object A" to jump to a position defined by where "Object B" is, "Object B" jumps instead...somewhere; I'm not sure what logic it uses.  Feel free to use those files to dissect this issue further.
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: hpg678 on September 10, 2017, 08:04:55 pm
In the first example you could've add a KEY RELEASE J event and place a JUMP TO START action to the Arrow object to get the same result instead of using a STEP event.

Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: HitCoder on September 11, 2017, 10:40:12 am
This is odd, as checking your logic, the arrow should definitely be jumping to the ball position.
Instead, the ball is jumping to the position you've specified for the arrow to jump to, which is relative to the ball position. This is why the ball glides up and right.
So, I think I know why this is happening. Because the IF statements are "with(object_Ball)", I think the statements that follow this are using this same with(object_Ball)

In which I think if we convert this logic to GML in both circumstances we'd have the following

Code: (EDL) [Select]
with(object_Ball){
        if(Jump==1){
                x=object_Ball.x+5;
                y=object_Ball.y-20;
        }else{
                x=100;
                y=100;
        }
}

In which case, the "with(object_Ball)" tells all of the code in the braces that follow it to run through that object. This would mean that setting x would set the object_Ball.x instead of object_Arrow.x as the code is being told to run through object_Ball remotely.

Where in Game Maker, the jump function switches back to other in this context, and I think with GML the with(other) might be using with(self) instead in which, Enigma would look as the self constant as the current object, in which would be object_Ball. I'm not sure how GM works on the backend (since it's not open source). I only have GM8.1 for reference though.

So using this logic, Game Maker would be doing it sort of like this in contrast to the above code;

Code: (EDL) [Select]
with(object_Ball){
        if(Jump==1){
                with(other){
                        x=object_Ball.x+5;
                        y=object_Ball.y-20;
                }
        }else{
                with(other){
                        x=100;
                        y=100;
                }
        }
}

Not sure why Enigma is handling it like the former, but it kind of makes sense.

So the fix in code would be to use the second code extract in place.

Also, I did test this in "realtime" while typing all of this; everything seems to add up here so I'm fairly confident this is what is happening.

And the solution in the drag-and-drop functions would be to set both jump functions to apply to "other" as follows.
(https://puu.sh/xxaGB/6293734aa9.png)

Tested and works.
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: Goombert on September 11, 2017, 11:22:47 am
Nice work HitCoder, it seems you may have found an actual bug in the with() construct.

There was a case of with() smashing that was causing a memory leak in ENIGMA for a while, but Josh patched that.
https://github.com/enigma-dev/enigma-dev/pull/999

It's possible his changes introduced this regression however, so you could try reverting his changes and see if it occurs.
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: hpg678 on September 11, 2017, 10:00:30 pm
with all due respect, I don't agree such qualify as a basis for finding a bug.

First let me say that I believe it is a tad too much for one to expect GM files to be that compliant with ENIGMA without some type of error at some time.

Now let's examine the files in question.

In the first one, the arrow moves towards the ball by way of the KEYBOARD event. Simple enough.

In the second one, a variable Jump is placed in the Create event of the object Ball. In the Step event in the object Arrow, it is to move towards the ball and back through change states of the variable Jump..... i.e Jump=1 and Jump=0. This action is to be done through the KEY PRESS and KEY RELEASE of the letter J in the object Ball.



Although it runs perfectly in Game Maker, we see a problem in ENIGMA in that when you press 'J' on the keyboard the ball moves and not the arrow. My concern is the placement of objects.  When I remove the arrow object, the ball is in the correct place. When placed back in, chaos returns. It seems then the arrow object or rather the code, is the problem.



https://imgur.com/9yNtyh8 (https://imgur.com/9yNtyh8)


I rewrote the object ball to this:

(https://imgur.com/DH8naJv)https://imgur.com/DH8naJv (https://imgur.com/DH8naJv)

and there you have it.

I believe this shows that there is no bug. I can't be sure but I believe it has to do with how ENIGMA interprets GM code as well as bad code writing. No fault on the coder. We all make mistakes and we're not perfect coders.
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: HitCoder on September 12, 2017, 01:56:29 pm
I believe this shows that there is no bug. I can't be sure but I believe it has to do with how ENIGMA interprets GM code as well as bad code writing. No fault on the coder. We all make mistakes and we're not perfect coders.

I'm still going to have to agree to disagree; while I see no reason to revert such changes which have caused this "bug", since there can still be workarounds due to code logic, the bug present is that the with(object) method of the variable tester is carried through to the jump to position function. This is not how Game Maker's logic is supposed to function in terms of using these drag-and-drop blocks, due to every single one requiring a reference, or control from said object, being newly specified each time.

In this case, I don't think it's necessarily a bug, but, I would not say it is an "incorrect" way of programming it. It is not "bad code writing", as taking such an approach doesn't necessarily make it inferior. It's just another approach that works fine in Game Maker, but Enigma handles the logic differently.

Though, because of discrepencies like this, I personally stick with using GML/EDL rather than using the drag-and-drop blocks, and I personally treat Enigma and Game Maker as different engines/programs/software/tools entirely, despite having identical interfaces and very very similar logic.
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: hpg678 on September 12, 2017, 06:22:20 pm
Ok........ so maybe I came off a bit brazen and critical in my comments about 'bad coding' and some other things i've written. My intention was not to be that way. I apologize.

My intent was to show a more efficient way to solve the problem but somewhere I got carried away. Again I apologize.

I too prefer to use GML/EDL over DRAG N DROP, although at times it becomes necessary to use it. i also Believe I may have misread some of your comments.

Lastly i want to clear up what you may be perceiving as a misunderstanding on your part. I do not consider you in the same class of people whom "I believe it is a tad too much for one to expect GM files to be that compliant with ENIGMA without some type of error at some time". i was generalizing since based on people's past comments on this forum, Game Maker's forum and other places I had researched, that was commonality among them.

i have the deepest praise for ENIGMA and its creators. I think its a brilliant, wonderful and fantastic piece of software. The fact that it is compliant with Game Maker which i spent the majority of my life learning, as well as being able to run on LINUX, is an added bonus.
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: Hoohee on September 13, 2017, 06:41:02 pm
While it's not like every game creation program has to work exactly like Game Maker, it should work exactly like its own internal documentation says it will.  So if there's a workaround and it works so well that no reversion of the program is necessary, at least the text in the drag and drop interface should probably be changed a bit.
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: Hoohee on September 13, 2017, 07:48:54 pm
So, I've been working on getting the revised code into my game, and I get the following compile error:
Quote
Check `object_Mouth::step...Syntax error in object `object_Mouth', Step event:0:
Line 15, position 17 (absolute 537): Expected closing parenthesis before closing brace

Which is bizarre, because looking at the code, it seems like I actually have it:
Code: [Select]
if(sprite_index==sprite_StellaSouthwest) {
                with(other){
                        x=object_Bee.x-15;
                        y=object_Bee.y+27;
                }

Any idea why this error is being triggered?
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: hpg678 on September 13, 2017, 08:13:42 pm
looks like you forgot to write an extra } at the end of your statement

revised version:
 
if(sprite_index==sprite_StellaSouthwest) {//this is orphaned as it stands
                with(other){
                        x=object_Bee.x-15;
                        y=object_Bee.y+27;
                }

} <=this should be at the end....thus the error


the following should simplify matters a little bit

if(sprite_index==sprite_StellaSouthwest)
{
   

     with(other)
         {
           x=object_Bee.x-15;
           y=object_Bee.y+27;
         }

}
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: Goombert on September 14, 2017, 02:00:23 pm
This is definitely a bug, the question is what part.

So the way this works is the lgmplugin that plugs ENIGMA into LateralGM converts all your actions to GML code before sending it to ENIGMA. ENIGMA then converts the GML over to C++.
https://github.com/enigma-dev/lgmplugin/blob/master/org/enigma/EnigmaWriter.java#L1189

Judging by the output in C:\ProgramData\ENIGMA\Preprocessor_Environment_Editable\IDE_EDIT_objectfunctionality.h the bug appears to be in the plugin, because there should actually be a with(-1) meaning self around the action_move_to.

Code: (cpp) [Select]
variant enigma::OBJ_object_Arrow::myevent_step()
{
  { if (timeline_running && timeline_speed!=0) advance_curr_timeline(); }
with((0))
    if(action_if_variable(enigma::varaccess_Jump(int(self)), 1, 0))
  {
    argument_relative = 0;
    action_move_to(enigma::glaccess(int(object_Ball))-> x + 5, enigma::glaccess(int(object_Ball))-> y - 20);
   
  }
  with((0))
    if(action_if_variable(enigma::varaccess_Jump(int(self)), 0, 0))
  {
    argument_relative = 0;
    action_move_to(100, 100);
   
  }
  ;
 
  return 0;
}

This is a new issue that I am surprised wasn't reported before, either way I've filed a bug on the lgmplugin:
https://github.com/enigma-dev/lgmplugin/issues/54

Not sure when it may be fixed, busy working on sumptin' TOP secret so you won't have to worry about this problem ever again.
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: time-killer-games on September 14, 2017, 04:05:24 pm
Not sure when it may be fixed, busy working on sumptin' TOP secret so you won't have to worry about this problem ever again.

Sounds like a YoYoGames squirrel on the loose. :D
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: Hoohee on September 15, 2017, 06:05:26 pm
This is definitely a bug, the question is what part.

So the way this works is the lgmplugin that plugs ENIGMA into LateralGM converts all your actions to GML code before sending it to ENIGMA. ENIGMA then converts the GML over to C++.
https://github.com/enigma-dev/lgmplugin/blob/master/org/enigma/EnigmaWriter.java#L1189

Judging by the output in C:\ProgramData\ENIGMA\Preprocessor_Environment_Editable\IDE_EDIT_objectfunctionality.h the bug appears to be in the plugin, because there should actually be a with(-1) meaning self around the action_move_to.

Code: (cpp) [Select]
variant enigma::OBJ_object_Arrow::myevent_step()
{
  { if (timeline_running && timeline_speed!=0) advance_curr_timeline(); }
with((0))
    if(action_if_variable(enigma::varaccess_Jump(int(self)), 1, 0))
  {
    argument_relative = 0;
    action_move_to(enigma::glaccess(int(object_Ball))-> x + 5, enigma::glaccess(int(object_Ball))-> y - 20);
   
  }
  with((0))
    if(action_if_variable(enigma::varaccess_Jump(int(self)), 0, 0))
  {
    argument_relative = 0;
    action_move_to(100, 100);
   
  }
  ;
 
  return 0;
}

This is a new issue that I am surprised wasn't reported before, either way I've filed a bug on the lgmplugin:
https://github.com/enigma-dev/lgmplugin/issues/54

Not sure when it may be fixed, busy working on sumptin' TOP secret so you won't have to worry about this problem ever again.

Thank you; that worked!  I also went a lot faster when I realized I could click on a close bracket and be shown where it opened.
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: Hoohee on September 17, 2017, 09:18:39 pm
I may have discovered another bug.  For some reason, turning on a user-defined variable (by holding a button) messes with a character's movement.  The character either stops moving, or moves in weird ways.  I haven't been able to duplicate this in my experiment file (the "Jump" one), but I'll keep trying to figure out what's wrong.  In the meantime, if this helps, the character's movement uses variables as well; the hspeed and vspeed variables in the "Step" event.
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: faissaloo on September 20, 2017, 06:56:56 am
I may have discovered another bug.  For some reason, turning on a user-defined variable (by holding a button) messes with a character's movement.  The character either stops moving, or moves in weird ways.  I haven't been able to duplicate this in my experiment file (the "Jump" one), but I'll keep trying to figure out what's wrong.  In the meantime, if this helps, the character's movement uses variables as well; the hspeed and vspeed variables in the "Step" event.
Are you swapping any objects that depend on user input? You might need an io_clear() somewhere
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: Hoohee on September 20, 2017, 04:13:49 pm
I may have discovered another bug.  For some reason, turning on a user-defined variable (by holding a button) messes with a character's movement.  The character either stops moving, or moves in weird ways.  I haven't been able to duplicate this in my experiment file (the "Jump" one), but I'll keep trying to figure out what's wrong.  In the meantime, if this helps, the character's movement uses variables as well; the hspeed and vspeed variables in the "Step" event.
Are you swapping any objects that depend on user input? You might need an io_clear() somewhere

Possibly so, but what do you mean by "swapping"?  I'm not turning an instance into another instance, of that's what you meant.  There are two objects that utilize the one's offending variable, but to test out the bug, I deleted the other object, and it still happens.
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: faissaloo on September 21, 2017, 03:07:44 am
I may have discovered another bug.  For some reason, turning on a user-defined variable (by holding a button) messes with a character's movement.  The character either stops moving, or moves in weird ways.  I haven't been able to duplicate this in my experiment file (the "Jump" one), but I'll keep trying to figure out what's wrong.  In the meantime, if this helps, the character's movement uses variables as well; the hspeed and vspeed variables in the "Step" event.
Are you swapping any objects that depend on user input? You might need an io_clear() somewhere

Possibly so, but what do you mean by "swapping"?  I'm not turning an instance into another instance, of that's what you meant.  There are two objects that utilize the one's offending variable, but to test out the bug, I deleted the other object, and it still happens.
I mean destroying an object and creating another one in its place, that's usually what I've been doing when stuff like this has happened to me
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: Hoohee on September 21, 2017, 03:47:57 pm
So that implies that you've seen such things before.  I'd rather not destroy and replace the object, since that opens up a bunch of other cans of worms, and the current object has too much complex code and things pointing to it not to cause errors from its destruction.  To do this would necessitate rewriting most of the code from scratch, and probably figuring out new ways to do things I had down fine.  None of that pausing happens in Game Maker, so a bug is a bug and a bug deserves research and repair.  Still, any insight into what causes this, and is there a way to fix it that doesn't involve destroying and replacing the player object?
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: faissaloo on September 22, 2017, 09:23:57 am
So that implies that you've seen such things before.  I'd rather not destroy and replace the object, since that opens up a bunch of other cans of worms, and the current object has too much complex code and things pointing to it not to cause errors from its destruction.  To do this would necessitate rewriting most of the code from scratch, and probably figuring out new ways to do things I had down fine.  None of that pausing happens in Game Maker, so a bug is a bug and a bug deserves research and repair.  Still, any insight into what causes this, and is there a way to fix it that doesn't involve destroying and replacing the player object?
No, you misunderstood me, I'm saying that behavior usually happened when I did that, I wasn't suggesting destroying and creating the object as a solution.
Title: Re: Help! Make a Game Maker project compatible with Enigma.
Post by: Hoohee on September 22, 2017, 03:27:49 pm
Oh, then I apologize.  Issue remains, then.