Pages: [1]
  Print  
Author Topic: 2 bugged GM files  (Read 2059 times)
Offline (Male) polygone
Posted on: January 25, 2011, 05:45:38 AM

Contributor
Location: England
Joined: Mar 2009
Posts: 810

View Profile
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.
« Last Edit: March 05, 2011, 04:30:20 PM by polygone » Logged
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
Offline (Female) IsmAvatar
Reply #1 Posted on: January 25, 2011, 12:01:00 PM

LateralGM Developer
LGM Developer
Location: Pennsylvania/USA
Joined: Apr 2008
Posts: 891

View Profile Email
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?
Logged
Offline (Male) polygone
Reply #2 Posted on: January 25, 2011, 12:13:12 PM

Contributor
Location: England
Joined: Mar 2009
Posts: 810

View Profile
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:
Quote
Exception 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.
« Last Edit: January 25, 2011, 12:21:56 PM by polygone » Logged
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
Offline (Female) IsmAvatar
Reply #3 Posted on: January 25, 2011, 03:08:26 PM

LateralGM Developer
LGM Developer
Location: Pennsylvania/USA
Joined: Apr 2008
Posts: 891

View Profile Email
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.
Logged
Offline (Unknown gender) TheExDeus
Reply #4 Posted on: January 25, 2011, 06:06:56 PM

Developer
Joined: Apr 2008
Posts: 1919

View Profile
Quote
Resource 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:
Code: [Select]
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.
Logged
Offline (Male) polygone
Reply #5 Posted on: January 26, 2011, 07:11:33 AM

Contributor
Location: England
Joined: Mar 2009
Posts: 810

View Profile
Quote
Resource 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:
Code: [Select]
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.
Logged
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
Offline (Female) IsmAvatar
Reply #6 Posted on: January 26, 2011, 11:39:06 AM

LateralGM Developer
LGM Developer
Location: Pennsylvania/USA
Joined: Apr 2008
Posts: 891

View Profile Email
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.
Logged
Offline (Male) polygone
Reply #7 Posted on: January 27, 2011, 02:09:26 PM

Contributor
Location: England
Joined: Mar 2009
Posts: 810

View Profile
OK that other file is definitely a bug with the background. It's drawing the purple background in the foreground regardless.
Logged
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
Offline (Male) polygone
Reply #8 Posted on: March 05, 2011, 03:13:02 AM

Contributor
Location: England
Joined: Mar 2009
Posts: 810

View Profile
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.
« Last Edit: July 14, 2011, 07:26:33 AM by polygone » Logged
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
Offline (Female) IsmAvatar
Reply #9 Posted on: March 05, 2011, 02:09:43 PM

LateralGM Developer
LGM Developer
Location: Pennsylvania/USA
Joined: Apr 2008
Posts: 891

View Profile Email
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.
Logged
Offline (Male) polygone
Reply #10 Posted on: March 05, 2011, 02:54:58 PM

Contributor
Location: England
Joined: Mar 2009
Posts: 810

View Profile
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
« Last Edit: March 05, 2011, 04:31:39 PM by polygone » Logged
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
Pages: [1]
  Print