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.


Topics - crxtrdude

Pages: 1
1
Programming Help / changing depth of instances.
« on: January 07, 2016, 09:48:40 pm »
Hey, I've been on the works on a Freerunning platformer based on an old game maker game, with newer cleaner code and new moves.

I've almost finished the meat of my code, but I've hit a snag. The blocks I used are similar to the 1980s Prince of Persia, so they have this 3D look to them. As such, when the player hits the wall to the left, the player should be behind the wall and the opposite, player should be in front.

Now, I'm struggling to do something like that. I use sprites instead of backgrounds, since I will be designing the game along with a map maker.

Is there a way to do so without messing up the entire level depth? I've been experimenting with the blocks in the level, checking if the player's y was greater than the y of the block, but it messed up the levels. Maybe using the player would do such?

2
Hey guys, I've got this thing that was quirking me here. Not sure where to put it, but I'll just place it here.

To replicate, I made a local float like this:

Code: [Select]
local float hsp;
hsp = 0;

...

Now supposed if that code was in the create of a parent entity.

We then make a child for it, obj_player for example then in the  creation script, we want to inherit what was there:

Code: [Select]
event_inherited();
...

When I do that, an error gives off like this:

Code: [Select]
error: invalid initialization of reference of type 'float&' from expression of type 'var'
       case obj_player: return ((OBJ_obj_player*)inst)->hsp;
                                                        ^

Just an heads up for you guys.

3
Programming Help / Getting min and max of variables without min and max.
« on: December 24, 2015, 11:47:06 am »
I want to use min and max on my own variables (in the example is hsp) and it had the error:

Quote
error: 'hsp' was not declared in this scope

Also in subsequent variables as well.

Is there a way to do something like this without using min and max? I'm using this in a script. I think it's related to this issue.

4
Programming Help / Getting the parent id
« on: December 20, 2015, 12:45:46 am »
If object_get_parent doesn't work so far, how to get the id of the parent entity?

5
Programming Help / My platform generation code does not work in ENIGMA.
« on: December 06, 2015, 08:11:52 am »
Firstly, I don't know what to expect when pressing the debug mode for Enigma, I want to know what would come out in Windows. Apparently it's screwed up by the antivirus I have or something?

Secondly, I made some kind of way to make a map maker for my platform game. the map maker I made works, you could put blocks and player into the maker and then save it using file_text commands. When I incorporated the load code to my platformer, which reads the text file and then puts the instances again. I ran it on Game Maker, it works, but when I placed it on Enigma, it seemingly didn't run the function to put the objects into the level.

The thing works like this, you read the text file and put the values of the objects (along with their X and Y coords) into an array. The reason for this is so that I could go to another transitory room to resize the map room. When the map is resized, I go to the map room, read the array and make the instances.

If the debug mode apparently works, I might see something that will lead me to the solution.

I'll share the code probably later if someone would respond with the debug thing.

Pages: 1