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 - polygone

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 »
466
Announcements / Re: Happenings
« on: February 02, 2011, 06:12:07 am »
Everything looks A OK now.

So what's planned next?  :)

467
Proposals / Re: unable to parse (obj.variable) = value;
« on: January 28, 2011, 08:13:12 am »
I was under the impression the syntax was strictly as follows:
Code: [Select]
(obj).variable = value;

If GM is suddenly allowing that sort of thing, I will remove all checks related to assignment operators. That will add compatibility with stream structures like cout, anyway.
It's always allowed that sort of thing. It doesn't care about the brackets:

Code: [Select]
(((((script())).meh.hello))) = (script().derp);
(variable) = value;

It's all perfectly valid. Only thing that isn't valid is:

Code: [Select]
variable.(loc) = value

468
Proposals / mask_index
« on: January 27, 2011, 03:40:20 pm »
Currently instances are always using their sprite for collisions instead of their mask index The mask_index variable is not being set, it just stays at 0.


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

469
Proposals / #RESOLVED# unable to parse (obj.variable) = value;
« on: January 27, 2011, 02:37:41 pm »
GM is able to parse:

Code: [Select]
(obj.variable) = value;Whereas Enigma appears unable.


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

470
Proposals / Re: 2 bugged GM files
« on: January 27, 2011, 02:09:26 pm »
OK that other file is definitely a bug with the background. It's drawing the purple background in the foreground regardless.

471
Function Peer Review / Re: move_contact functions optimised for bbox
« on: January 27, 2011, 01:17:34 pm »
OK wrote it in C++ now. I've let it return the distance the instance moved, maybe it should return the instance it collides with though (but that would make it less efficient).

Code: (C++) [Select]
double move_contact_object(double angle, double dist, const int object, const bool precise = false, const bool solid_only = false)
{
  const double contact_distance = ((precise) ? 0.000001 : 1);
  dist = abs(dist);
  angle = ((angle mod 360) + 360) mod 360;
  enigma::object_collisions* const inst1 = ((enigma::object_collisions*)enigma::instance_event_iterator->inst);
  const int quad = int(angle/90.0);
  for (enigma::inst_iter *it = enigma::fetch_inst_iter_by_int(object); it != NULL; it = it->next)
  {
    const enigma::object_collisions* inst2 = (enigma::object_collisions*)it->inst;
    if (inst2->id == inst1->id || solid_only && !inst2->solid) {continue;}

    if (inst2->x + inst2->bbox_right >= inst1->x + inst1->bbox_left && inst2->y + inst2->bbox_bottom >= inst1->y + inst1->bbox_top && inst2->x + inst2->bbox_left <= inst1->x + inst1->bbox_right && inst2->y + inst2->bbox_top <= inst1->y + inst1->bbox_bottom)
    {
      dist = 0;
      break;
    }
   
    switch (quad)
    {
      case 0:
        if ((inst2->x + inst2->bbox_left > inst1->x + inst1->bbox_right || inst1->y + inst1->bbox_top > inst2->y + inst2->bbox_bottom) &&
        direction_difference(angle, point_direction(inst1->x + inst1->bbox_right, inst1->y + inst1->bbox_bottom, inst2->x + inst2->bbox_left, inst2->y + inst2->bbox_top)) >= 0  &&
        direction_difference(angle, point_direction(inst1->x + inst1->bbox_left, inst1->y + inst1->bbox_top, inst2->x + inst2->bbox_right, inst2->y + inst2->bbox_bottom)) <= 0)
        {
          if (direction_difference(angle, point_direction(inst1->x + inst1->bbox_right, inst1->y + inst1->bbox_top, inst2->x + inst2->bbox_left, inst2->y + inst2->bbox_bottom)) > 0)
          {
            dist = min(dist, (inst1->y + inst1->bbox_top - (inst2->y + inst2->bbox_bottom) - contact_distance)/sin(degtorad(angle)));
          }
          else
          {
            dist = min(dist, (inst2->x + inst2->bbox_left - (inst1->x + inst1->bbox_right) - contact_distance)/cos(degtorad(angle)));
          }
        }
      break;
      case 1:
        if ((inst1->x + inst1->bbox_left > inst2->x + inst2->bbox_right || inst1->y + inst1->bbox_top > inst2->y + inst2->bbox_bottom) &&
        direction_difference(angle, point_direction(inst1->x + inst1->bbox_left, inst1->y + inst1->bbox_bottom, inst2->x + inst2->bbox_right, inst2->y + inst2->bbox_top)) <= 0  &&
        direction_difference(angle, point_direction(inst1->x + inst1->bbox_right, inst1->y + inst1->bbox_top, inst2->x + inst2->bbox_left, inst2->y + inst2->bbox_bottom)) >= 0)
        {
          if (direction_difference(angle, point_direction(inst1->x + inst1->bbox_left, inst1->y + inst1->bbox_top, inst2->x + inst2->bbox_right, inst2->y + inst2->bbox_bottom)) > 0)
          {
            dist = min(dist, (inst2->x + inst2->bbox_right - (inst1->x + inst1->bbox_left) + contact_distance)/cos(degtorad(angle)));
          }
          else
          {
            dist = min(dist, (inst1->y + inst1->bbox_top - (inst2->y + inst2->bbox_bottom) - contact_distance)/sin(degtorad(angle)));
          }
        }
      break;
      case 2:
        if ((inst1->x + inst1->bbox_left > inst2->x + inst2->bbox_right || inst2->y + inst2->bbox_top > inst1->y + inst1->bbox_bottom) &&
        direction_difference(angle, point_direction(inst1->x + inst1->bbox_right, inst1->y + inst1->bbox_bottom, inst2->x + inst2->bbox_left, inst2->y + inst2->bbox_top)) <= 0  &&
        direction_difference(angle, point_direction(inst1->x + inst1->bbox_left, inst1->y + inst1->bbox_top, inst2->x + inst2->bbox_right, inst2->y + inst2->bbox_bottom)) >= 0)
        {
          if (direction_difference(angle, point_direction(inst1->x + inst1->bbox_left, inst1->y + inst1->bbox_bottom, inst2->x + inst2->bbox_right, inst2->y + inst2->bbox_top)) > 0)
          {
            dist = min(dist, (inst1->y + inst1->bbox_bottom - (inst2->y + inst2->bbox_top) + contact_distance)/sin(degtorad(angle)));
          }
          else
          {
            dist = min(dist, (inst2->x + inst2->bbox_right - (inst1->x + inst1->bbox_left) + contact_distance)/cos(degtorad(angle)));
          }
        }
      break;
      case 3:
        if ((inst2->x + inst2->bbox_left > inst1->x + inst1->bbox_right || inst2->y + inst2->bbox_top > inst1->y + inst1->bbox_bottom) &&
        direction_difference(angle, point_direction(inst1->x + inst1->bbox_right, inst1->y + inst1->bbox_top, inst2->x + inst2->bbox_left, inst2->y + inst2->bbox_bottom)) <= 0  &&
        direction_difference(angle, point_direction(inst1->x + inst1->bbox_left, inst1->y + inst1->bbox_bottom, inst2->x + inst2->bbox_right, inst2->y + inst2->bbox_top)) >= 0)
        {
          if (direction_difference(angle, point_direction(inst1->x + inst1->bbox_right, inst1->y + inst1->bbox_bottom, inst2->x + inst2->bbox_left, inst2->y + inst2->bbox_top)) > 0)
          {
            dist = min(dist, (inst2->x + inst2->bbox_left - (inst1->x + inst1->bbox_right) - contact_distance)/cos(degtorad(angle)));
          }
          else
          {
             dist = min(dist, (inst1->y + inst1->bbox_bottom - (inst2->y + inst2->bbox_top) + contact_distance)/sin(degtorad(angle)));
          }
        }
      break;
    }
  }
  inst1->x += cos(degtorad(angle))*dist;
  inst1->y -= sin(degtorad(angle))*dist;
  return dist;
}

inline int move_contact_all(const double direction, const double speed, const bool precise = false)
{
  return move_contact_object(direction, speed, all, precise);
}

inline int move_contact_solid(const double direction, const double speed, const bool precise = false)
{
  return move_contact_object(direction, speed, all, precise, true);
}

inline int move_contact(const double direction, const double speed, const bool precise = false)
{
  return move_contact_object(direction, speed, all, precise);
}

472
Proposals / Re: 2 bugged GM files
« on: January 26, 2011, 07:11:33 am »
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.

473
Proposals / Re: Div operator on script return value
« on: January 26, 2011, 07:06:41 am »
Whatttt?

Looks like no response. Fine I'll use the stupid tracker, argh. Does that thing still get read though?

474
Proposals / Re: 2 bugged GM files
« on: January 25, 2011, 12:13:12 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:
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.

475
Proposals / Uninitialised variables
« on: January 25, 2011, 08:20:59 am »
Uninitialised variables seem to always be treated as 0 instead of throwing an error for me. Intended for now?

Note this is quite a bitch for debugging sometimes.


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

476
Proposals / #RESOLVED# Div operator on script return value
« on: January 25, 2011, 06:59:35 am »
Code: (EDL) [Select]
45 div 90The statement returns 0 correctly.

Code: (EDL) [Select]
script() div 90Where script() returns 45, makes the statement return 0.5 incorrectly.


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

477
Proposals / #RESOLVED# Declaring variable using script return
« on: January 25, 2011, 06:56:12 am »
Enigma seems unable to parse this:

Code: (EDL) [Select]
var variable = script();

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

478
Proposals / Text and Fonts
« on: January 25, 2011, 06:52:26 am »
Can you please clarify exactly what the state of texts and fonts are. No text is being drawn for me and draw_set_font() is giving a compilation error.

479
Proposals / 2 bugged GM files
« on: January 25, 2011, 05: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.

480
Announcements / Re: Happenings
« on: January 25, 2011, 05:05:27 am »
However directly after installing, I tried to run a GM file. And I got this error:

Quote
Unknown compilation settings for your platform. Perhaps your platform isn't supported.
I no longer got it after restarting LGM though.

But when I tried to run again, I got this error:

Quote
This application has failed to start because OpenAL32.dll was not found.
But after installing OpenAL manually Enigma appears to all be working correctly :)

So congrats, I think the hard part is all done now.

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 »