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 - Josh @ Dreamland

1411
Announcements / Recent Events
« on: March 21, 2011, 10:55:20 AM »
Though I didn't intend to post any announcements on the matter, since some of our contributors don't tread on the IRC, I think it's better to say what's been going on, with all that is ENIGMA related.

- IsmAvatar is still working on the options panel. We think. The options panel will be what allows users to compile for different platform.
- I added a set of functions to ENIGMA's interface that allow LateralGM to retrieve function lists, so now even new functions will have some parameter list to fall back on, though it is apparent that we will need our own function manual to reference first (some of the parameter lists are ugly and unhelpful).
- IsmAvatar added those parameter lists to the function lists, but only one overload of them. She'll probably do something else with them later.
- Ism and I started LGM's own text editor, since we can't seem to find a competent Java editor that's self-contained. You can see more about that in other threads across the forum.
- A lot of bugs have been fixed from the tracker, and a lot more have been posted. Most of the new ones are trivial and make my head hurt.
- A List of Little Things that Need Done has been created on the Wiki. If you want to help, that's a good place to start.
- ENIGMA now exports font info to the game, but not glyph metrics, which will be appended later. Fonts should be completely done before this thread has five posts.
- I have begun work on a new coercer for the purposes of array bound (in the [] ) safety (they need casted to int for C++ arrays) and switch statements. The coercer is necessary for switch() because I need to spawn a temp variable for iterative comparison, and am not prepared to use C++0x for 'auto' in one place.
- Ism has made some 4200 bugfixes in LGM as Polygone continued to point them out.
- TGMG got ENIGMA a little closer to working on Mac out of the box. He and I are both waiting on Ism to finish the options panel.
- Ism removed the forced 'Metal' theme in LateralGM; now users can enjoy the native theme or customize it as has been done by Java-acquainted people here in the past. It hasn't been compiled and rolled into ENIGMA yet, but will in the near future.
- TGMG has been working diligently to make ENIGMA compile the GM6 examples. They're mostly done, but a couple of things are still missing, which I may start to fill in randomly.

Bugfixes include the following:
- Segfault when reading more than one path or timeline (LGM wrote structures of the wrong length, causing misalignment)
- Compile error for var mod var, var = long... some others. All operators should work now (except 2.5 % 2; use 2.5 mod 2)
- Collision event behaves more like GM (thanks, TGMG)
- DND problems are mostly resolved

Some modifications to the site have been made.
- 30 spam accounts have been deleted. If some of them actually weren't spam, I apologize.
- Members without posts can't do anything until they post. Meaning, no spam.
- I've reimplemented the Regex verification that was destroyed last SMF update. Also, "Remember me" works again, in case you didn't notice.
- ALL contributors can now post news.

In the bigger scope of things, ENIGMA now has the collision functions implemented with bbox checking. Since r9k disappeared, we don't have polygon-based collisions (or any of his code for them), but we may have a surprise in store on the matter, when testing week's over.
And as I mentioned, thanks to TGMG, ENIGMA can very nearly compile the GM6 standard examples.

As far as where I want to see this project go next, we need to corner something that GM still hasn't. I look at these magnificent games manufactured in GM, and I just think of one dedicated soul, waiting for minutes as Game Maker compresses all 46,000 sprites so he can test again. ...It's kind of frightening. As such, I want a format that allows saving only modified resources, as I've mentioned elsewhere in the forum. That format will likely be zip.

So. I'm going to finish fonts, then the coercer for [] and switch(), and then I'm going to finish ENIGMA's widget functions, and reactivate R3's super cow powers.
Ism's going to procrastinate the options panels some more.

Peace.

1412
Off-Topic / Introductions
« on: March 16, 2011, 09:34:35 AM »
In an effort to end this forum's war on spam, I've made it so it's virtually impossible to spam until you've made a post. The side effects of that include the inability for new members who are here legitimately to edit their profile or do other personalizations one would typically do upon registration. So, this topic is for humans who would like to have somewhere legitimate to post so they can edit their profiles and use the messaging systems.

So yes, say hi, and say something to make the admins think you're here because you are genuinely interested in what goes on here.

1413
In that case, you would have to edit the controller I described to draw those two HUDs. Add those images you drew atop the chickens as backgrounds, and use draw_background to display them. Use the following to populate it, in the draw event as well of course:
Code: (GML) [Select]
global.list = "";
with <PARENT OBJECT NAME>
{
  global.list += object_get_name(object_index) + "#";
}
draw_text(<x coordinate of objective HUD> + 16, 16, global.list);

This code requires that the students enter an English name for each child object.


The inventory HUD will make the game more complicated. Game Maker does not allow for multiple inheritance (nor does ENIGMA at the moment). That being the case, in the destroy event for each findable inventory item (i.e., your skeleton key), you will need to execute a code. You will also need a sprite for them as they will appear in the inventory, including any borders. Keep them all the same dimensions so it looks presentable. Give them each three subimages; the first subimage will be drawn in the HUD when it isn't selected, and the second will be drawn there when it is, and the third will be drawn at the cursor.

You will need a Game Start event in the controller:
Code: (GML) [Select]
global.inventory = "";
global.inventory_sprite = -1;
global.inventory_selected = -1

Then, just after you draw the other HUD,
Code: (GML) [Select]
var i, xx, yy; xx = 16; yy = <HUD Y COORDINATE> + 16;
for (i = 0; global.inventory[i] != ""; i += 1)
{
  draw_sprite(global.inventory_sprite[i], global.inventory_selected = i, xx, yy);
  xx += sprite_get_width(global.inventory_sprite[i]) + 4;
  if (xx + sprite_get_width(global.inventory_sprite[i]) > room_width-16) {
    xx = 16; yy += sprite_get_height(global.inventory_sprite[i]) > room_width-16) + 4;
  }
}

Add a Global Left Pressed event to the controller.
Code: (GML) [Select]
if (mouse_y > <HUD Y COORDINATE>)
{
  for (i = 0; global.inventory[i] != ""; i += 1)
  {
    if (mouse_x > xx and mouse_x < xx+sprite_get_width(global.inventory_sprite[i])
        and mouse_y > yy and mouse_y < yy + prite_get_height(global.inventory_sprite[i]) > room_width-16)) {
      global.inventory_selected = i;
      exit;
    }
    xx += sprite_get_width(global.inventory_sprite[i]) + 4;
    if (xx + sprite_get_width(global.inventory_sprite[i]) > room_width-16) {
      xx = 16; yy += sprite_get_height(global.inventory_sprite[i]) > room_width-16) + 4;
    }
  }
}

Again in the controller's draw event,
Code: (GML) [Select]
if (global.inventory_selected != -1)
  draw_sprite(global.inventory_sprite(global.inventory_selected), 2, mouse_x, mouse_y); // Draw the selected item at the mouse

Again in the controller, on Global Mouse Release:
Code: (GML) [Select]
global.inventory_selected = -1; // Clear the selected item
The inventory collectibles, as I mentioned, need to have something special in them to add them to the inventory. This is a script that you will call in the destroy event of EACH collectible inventory object; call it inventory_add(name,sprite):
Code: (GML) [Select]
var i;
for (i = 0; global.inventory[i] != ""; i += 1) {}
global.inventory[i] = argument0;
global.inventory_sprite[i] = argument1;
global.inventory[i+1] = "";
global.inventory_sprite[i+1] = -1;
A sample call is inventory_add(object_get_name(object_index),spr_inv_skeleton_key);.

This next script is inventory_remove(name or id).
Code: (GML) [Select]
var i;
if (is_string(argument0))
{
  var found; found = false;
  for (i = 0; gobal.inventory[i] != ""; i++)
  if (gobal.inventory[i] == argument0) {
    found = true; break;
  }
  if (!found) exit;
}
else i = argument0;
if (i == gobal.inventory_selected)
    gobal.inventory_selected = -1;
while (gobal.inventory[i] != "")
{
    gobal.inventory[i] = gobal.inventory[i+1];
    gobal.inventory_sprite[i] = gobal.inventory_sprite[i+1];
}

As an example, your treasure chest would make this check in its Mouse Press event:
Code: (GML) [Select]
if (gobal.inventory_selected != -1)
  if (gobal.inventory[gobal.inventory_selected] == "Skeleton Key")
  {
    instance_destroy();
    instance_create(x,y,obj_secret_hidden_object);
    inventory_remove(gobal.inventory_selected);
  }



I recommend that you provide the students with the two scripts, if they are not very good with code.
I've not tested any of the above code, but I have some confidence it will work if you put a little time into it.
You can send this to her as well, again with my regards. I can't continue abstract work on this game if it grows any more complicated, but I'm happy to answer questions. Peace.

1414
Oh, the irony. Look, fede, you're an asset after all!

Anyway, no problem. Happy to help. I read over my post again, and I think I should clarify that the controller needs placed in each room with hidden objects, while the parent object doesn't need instantiated anywhere, except implicitly through the child objects the students will be placing.

1415
Seems interest isn't very high, likely because most of us are C/Java programmers or are on Linux. Have you tried the 64Digits community? They're a good balance of intelligence and... well, free time or boredom, I guess. Whatever component is missing here.

The problem may also be that a hidden object game is essentially 2 percent programming, 95 percent graphics, and 3 percent level design. Assuming you can provide the graphics, the procedure is simple (I will describe a more redundant, less technical method). You can deliver it to her with my regards, or you can wait and see if someone will draft out a GM6 of it.

1) Create a sprite for each hidden object.
2) Create backgrounds that are full of clutter and scenery, such as a messy classroom or a busy city street, as I assume is in the game you mentioned.
3) Create an object with any name (have your students assign it a name of their choice, but give them an example). This will be the parent object. It will not have a sprite. This is the most difficult concept in the operation. It has but one event, "Mouse Press", in which a few simple calls are made: effect_create_above() with your choice of particle as a flashy effect, instance_destroy() to remove the object from play, and score += 1 to, well, add to the score.
4) Create a controller object. This object checks in the step event, if (!instance_exists(<the parent object's name>)) room_goto_next();. This will keep the game going once they've found them all.
5) Have the students create several objects, setting the parent of each to the first object and setting the sprite to a different hidden object sprite. Have them place the objects in a separate folder for each scene to teach them organization skills.
6) Create a room for each background scene they've made. Have them place the objects from that category in them. Add a room to the end, and in it, set the background to a big, "You Win!" image. Optionally, in the room start code, add show_message("You win! Score: " + string(score));. Of course, the score will always be the same, unless you have the controller keep track of time.

Game Maker should automatically display the score in the caption. If it doesn't, use room_caption = "Score: " + string(score); in the step event of the controller.

Out of curiosity, how did you find out about this board?

1416
Proposals / Re: Obliterating "inst" from functions.
« on: March 13, 2011, 11:08:02 PM »
I guess the macro would be fine, but keeping a global just wouldn't work.

1417
Function Peer Review / Re: move_wrap
« on: March 11, 2011, 09:01:49 AM »
...
His point is, if you have functions, post them here. I'm not going to do anything with them, and no one else gives a shit about your functions unless they're posted here. So post them, or drop them.

1418
Proposals / Re: Welcome PM
« on: March 10, 2011, 09:34:58 AM »
Heh, don't worry, Griggs, I'm working on it. The coercer's a piece of shit, and so I'm replacing it before I can allow switching odd types.

1419
Proposals / Re: globalvar
« on: March 10, 2011, 09:29:21 AM »
It'll work if the parser can read it. Hell, it'd work if you stuck it right into definitions. Just not in syntaxquirks.h; you'll notice an ifdef around it prevents the parser from reading it.

1420
Proposals / Re: room_speed
« on: March 04, 2011, 02:21:16 PM »
rs = room_speed, polygone.

Sleep(1000/room_speed) assumes ideal framerate; it pretends that no time at all was consumed between the end of that frame and the frame before.

I realize now that it should be handled instead by a timer, at the beginning of the frame. Should the frame take longer than 1/room_speed seconds, the timer would fire before its completion, harmlessly posting an event in the queue to be handled. Upon completing that frame, the event code will be received, and the next frame will fire, immediately setting the timer to 1/room_speed again. I may need to use a thread for it on Linux, but on Windows, it's simple and the best way. Meaning I'm going to make someone else do it. Maybe.

1421
Proposals / Re: Action functions plugin writing
« on: March 03, 2011, 09:23:35 AM »
Indeed. Even if it didn't, we could use && instead of the comma for true, and || instead of it for false, in the case of if().

1422
Proposals / Re: Obliterating "inst" from functions.
« on: March 03, 2011, 12:06:41 AM »
No.

1423
Function Peer Review / Re: action_move_to
« on: March 03, 2011, 12:04:05 AM »
You can use that for now. Until TGMG commits his changes, which include an argument_relative. See the discussion in this thread.

1424
Proposals / Re: Avatar Size
« on: March 02, 2011, 09:52:01 PM »
Er, all the avatars here are 96x96... Look at Fede's. And, well, everyone's who isn't you. :P

1425
Proposals / Re: Action functions plugin writing
« on: March 02, 2011, 09:40:46 PM »
If I may bud in, we have plenty of solutions to this issue.

1. Encase everything in {}.
{ argument_relative = true; action_do_shit(); }
2. Comma.
argument_relative = true, action_do_shit();
3. Parentheses and comma. This will solve if().
if((argument_relative=true, action_if(fuck_you)))
  ;

You'll find this more accurately mimics GM's behavior. Particularly the last one. (argument_relative = false, do_shit()) is rather form-fitting, syntactically.

IsmAvatar: `int required` is the required parameter. Int was an example. He was implying that the function would be backwards compatible, but would allow LGM to set an argument relative. I object because the additional stack push and assignment is baloney.