Pages: 1
Author Topic: 2 bugged GM files  (57,051 Views)
Offline (Unknown gender) polygone

Contributor
Joined: Mar 2009
Posts: 794
View profile
Posted on: January 25, 2011, 10:45:38 AM
I was just going through some old examples. Can someone else please test these GM files to clarify.

http://www.box.net/shared/zk9oi4trrj

In this file the object is not visible for some reason.

Tracker Reference:
http://enigma-dev.org/tracker/ticket.php?id=80


----------------
#RESOLVED#
http://www.box.net/shared/vh554hae7j

In this file the first time you open the object properties, then click save the object name gets cleared. Also it will not run while the action_move icon is in the creation event, it just does nothing upon trying to execute.
Offline (Unknown gender) IsmAvatar

LateralGM Developer
LGM Developer
Joined: Apr 2008
Posts: 877
View profile
Reply #1 Posted on: January 25, 2011, 05:01:00 PM
Please run from the terminal and see if it outputs any kind of errors or strange output.

Also, when you say the object is not visible, *where* is the object not visible? In the LGM resource tree? In the LGM room editor? In the game when running?
Offline (Unknown gender) polygone

Contributor
Joined: Mar 2009
Posts: 794
View profile
Reply #2 Posted on: January 25, 2011, 05:13:12 PM
Quote from: IsmAvatar on January 25, 2011, 05:01:00 PM
Please run from the terminal and see if it outputs any kind of errors or strange output.
Yes, I don't know why I didn't do that..

This is error is being thrown when trying to run:
QuoteException in thread "Thread-19" java.util.regex.PatternSyntaxException: Unexpected internal error near index 1\
^
        at java.util.regex.Pattern.error(Unknown Source)
        at java.util.regex.Pattern.compile(Unknown Source)
        at java.util.regex.Pattern.<init>(Unknown Source)
        at java.util.regex.Pattern.compile(Unknown Source)
        at java.lang.String.replaceAll(Unknown Source)
        at org.enigma.EnigmaWriter.toString(EnigmaWriter.java:906)
        at org.enigma.EnigmaWriter.getActionsCode(EnigmaWriter.java:883)
        at org.enigma.EnigmaWriter.populateObjects(EnigmaWriter.java:582)
        at org.enigma.EnigmaWriter.populateStruct(EnigmaWriter.java:124)
        at org.enigma.EnigmaWriter.prepareStruct(EnigmaWriter.java:109)
        at org.enigma.EnigmaRunner$3.run(EnigmaRunner.java:513)
And I see what the issue is with the object name being cleared. It's because there is a space used in the object resource name, which apparently makes LGM just clear it.

Quote
Also, when you say the object is not visible, *where* is the object not visible? In the LGM resource tree? In the LGM room editor? In the game when running?
When running the game. I think it might have something to do with the background but I'm not entirely sure what it is.
Offline (Unknown gender) IsmAvatar

LateralGM Developer
LGM Developer
Joined: Apr 2008
Posts: 877
View profile
Reply #3 Posted on: January 25, 2011, 08:08:26 PM
PatternSyntaxException will be corrected in the next revision. Thanks for the report.
Resource names should allow spaces in LGM, so the behavior you describe is not desired. I'll investigate.
Problems during game run are Josh's area. It may be a depth-related issue - e.g. it is being drawn, but something else is drawn overtop of it so you can't see it.
Offline (Unknown gender) TheExDeus

Developer
Joined: Apr 2008
Posts: 1,860
View profile
Reply #4 Posted on: January 25, 2011, 11:06:56 PM
QuoteResource names should allow spaces in LGM, so the behavior you describe is not desired.
Actually it could be desired (like showing an error). Because yeah, GM allows this too, but then assigning this resource is impossible. Like if you have "object 0" you will not be able to get the id for that object like so:with (object 0){}That will clearly show an error, and so maybe this should not be encouraged? On the other hand, while writing this I kind of guess that it is up to the user, and if the system allows this, then be it. On the other hand if LGM or ENIGMA should of be rewritten just to allow this, then I wouldn't see the point.
Offline (Unknown gender) polygone

Contributor
Joined: Mar 2009
Posts: 794
View profile
Reply #5 Posted on: January 26, 2011, 12:11:33 PM
Quote from: HaRRiKiRi on January 25, 2011, 11:06:56 PM
QuoteResource names should allow spaces in LGM, so the behavior you describe is not desired.
Actually it could be desired (like showing an error). Because yeah, GM allows this too, but then assigning this resource is impossible. Like if you have "object 0" you will not be able to get the id for that object like so:with (object 0){}That will clearly show an error, and so maybe this should not be encouraged? On the other hand, while writing this I kind of guess that it is up to the user, and if the system allows this, then be it. On the other hand if LGM or ENIGMA should of be rewritten just to allow this, then I wouldn't see the point.
It's still possible to reference the index using D&D or control in GML via parenting. Note the same issue exists with duplicate resource names which GM also allows.

Spaces certainly do not appear to be allowed in LGM at the moment though.
Offline (Unknown gender) IsmAvatar

LateralGM Developer
LGM Developer
Joined: Apr 2008
Posts: 877
View profile
Reply #6 Posted on: January 26, 2011, 04:39:06 PM
After looking it over, it appears that the textfield does not allow you to type the space character, and attempting to add a space to the tree node will cause the space to be removed once editing has finished. This behavior is appropriate. However the behavior of clearing the name entirely because [a loaded game contained a resource with a space] is completely inappropriate and should be fixed as soon as I get a chance.
Offline (Unknown gender) polygone

Contributor
Joined: Mar 2009
Posts: 794
View profile
Reply #7 Posted on: January 27, 2011, 07:09:26 PM
OK that other file is definitely a bug with the background. It's drawing the purple background in the foreground regardless.
Offline (Unknown gender) polygone

Contributor
Joined: Mar 2009
Posts: 794
View profile
Reply #8 Posted on: March 05, 2011, 08:13:02 AM
I have been trying to debug this myself. I have found that the result of this bug is actually due to two issues:

1) background_showcolor is not used

In roomsystem.c background_color is defined using:

Code (C++) Select
background_showcolor = (backcolor!=-1);
Instead of from the background_showcolor boolean from LGM.

Note that when this is fixed GSscreen.cpp also needs updating. It uses (in 2 places):

Code (C++) Select
      if (background_showcolor)
      {
         int clearcolor=((int)background_color)&0xFFFFFF;
         glClearColor(__GETR(clearcolor)/255.0,__GETG(clearcolor)/255.0,__GETB(clearcolor)/255.0, 1);
         glClear(GL_COLOR_BUFFER_BIT);
      }

An else statement should be added to this clearing the screen in black (as GM does).


2) The instance's parent draw code is not being executed in my particular file.

EDIT: No longer a problem.
Offline (Unknown gender) IsmAvatar

LateralGM Developer
LGM Developer
Joined: Apr 2008
Posts: 877
View profile
Reply #9 Posted on: March 05, 2011, 07:09:43 PM
Make sure that sprite_index is populated. If it is not, then the default value will always be 0, regardless of inheritance or sprite settings. A good trick might be to duplicate your sprite0, and then replace the original with a red X, and never use it. That way, if you ever do try to draw a sprite and the index is accidentally 0, you'll know right away.
Offline (Unknown gender) polygone

Contributor
Joined: Mar 2009
Posts: 794
View profile
Reply #10 Posted on: March 05, 2011, 07:54:58 PM
EDIT:

Found the issue once and for all. The sprite_width has not been set and thus is equal to 0. I was dividing by it and assigning to image_angle which is why the sprite was not shown.

That means the only problem actually is:
1) background_showcolor is not used
Pages: 1