Jump to content


Sven

Member Since 02 Jun 2009
Offline Last Active May 11 2013 07:06 AM

Topics I've Started

Interesting file_exists trouble

16 June 2011 - 01:48 PM

Hi all,

I have noticed something strange and I am wondering if anyone has a simple solution.

I am working on a simple app that will do some "stuff", and it has a .dll that should be checked to see if it exists before using it. This code is executed in the create event of one of my objects. It is the only object in the .gmk and it has only got this code in it. Basically it should work.. right?

if(!file_exists("FlipDll.dll"))
{
    show_message("ERROR: The FlipDll.dll is missing. Please replace this dll and run the program again.");
    game_end();
}
else
{
    show_message("Win!");
}

Essentially I want to later use command line parameters to determine what my application should do. For example, if you drag a file onto the Game Maker .exe one of the parameters that Game Maker receives is the File name of the file dragged. This is how I discovered the issue.
If you drag a file onto the Game Maker .exe it should/does pass the file name as one of the parameters which I will use later in a different part of the (unwritten) code. However if the file you are passing is from another directory that is not the same as the Game Maker .exe then it seems to do the file_exists() check from the directory that the dragged file came from instead of the Game Maker .exe. Clearly that isn't what I want. It should check for the file in the same directory. It seems to me that file_exists() is getting confused on what it should be checking for and where.

Note: I am aware that I can use program_directory/ + the file to fit it. But I would like to know why Game Maker is acting strangely.

Does anyone know what could be causing this issue?

Edit: For clarity.

Thanks,

Sven :)

A quick DLL question *solved*

15 June 2011 - 12:10 PM

Hi Everyone,

Just a quick Q. When passing a String to a C++ DLL does Game Maker pass it as a string variable, LPSTR or as a char * variable.

Thanks,

Sven :)

Collision Detection Article

13 June 2011 - 06:04 AM

Hi Everyone,

I am an avid reader of one of the YoYo Staff's Blog. The life of a Games Programmer - Mike Dailly

I have found a post that I feel is very relevant to the community in general and would like to share a link of it.

It basically outlines and discusses collision detection in Game Maker. I found it well written and informative and feel that members of the community could benefit from it. He also has some good posts regarding other things for those who are interested in following the blog.

You can find the article here: Collision Detection

Thanks,

Sven :)

Room Transition Freeze

06 June 2011 - 04:53 AM

Hi,

I was just wondering if anyone else has encountered this issue before or has a simple solution.
Basically when you are using The GM Room Transitions Extension (tr_melt) and you set transition_steps to a high number ( 800 or so) it will freeze half way and then jump straight to the next room.

Example Issue GM8 File

I was just wondering if this is an issue with my computer? I haven't noticed the problem on any of the other transitions as of yet so it may also be an issue with that specific melt transition.


Any help is greatly appreciated

EDIT: Interestingly enough it doesn't freeze as often if there are any objects in the next room or if there are draw events (for an object) executed right before the room change.

Thanks
Sven :)

Simple Angles of Reflection

05 January 2011 - 11:40 AM

Hi Everyone,

This is probably a simple question but it's got me stumped.
I am trying to create my own version of move_bounce. The reason being I only want my object to bounce against a specific type of object, which is not a solid. This works fine assuming there are no other objects near-by when I bounce, because the option is to bounce against a solid or all. Which brings me to my slight issue.

After some more research I have gotten it to this point.
norm = normal_detect(x,y,other,5,1);
oldDir = point_direction(xprevious,yprevious,x,y);
direction = norm+(norm-(oldDir +180));
x = xprevious;
y = yprevious;
Where normal_detect() is a script from GML Scripts.

Here is the old code I was working with
Spoiler


So the issue is that there are two possible combinations for every collision. Meaning that at some point the vspeed and hspeed are the same, even though there should be a different outcome from the bounce. That means I need an extra "check" or another way of working it out. Which is where the normal etc come in.

In this image the vspeed and hspeed are the same. This outlines why my hspeed and vspeed checks don't work properly.
Posted Image

So what can I do?
The issue now is that when bouncing down or up into a wall, I just go straight through or sometimes I still get stuck

So hopefully someone can help, also if we can avoid massive complex equations that would be great to :)

Thanks :)

-Sven