Jump to content


Davido01

Member Since 23 Jan 2010
Offline Last Active Feb 16 2012 05:47 PM

Posts I've Made

In Topic: Problem with drawing score and health with views

15 February 2012 - 02:27 AM

Is the controller_main object visible? Drawing doesn't do anything if the calling object is not visible.

In Topic: Forced X and Y - Solved

05 February 2012 - 01:55 PM

Put solved in the title so people do not wate their time on a solved problem. :)

In Topic: Need Help with making an enemy

28 January 2012 - 06:37 PM

Or rather than making it 10x more complicated with D & D, you can use GML. Sounds like you are getting to the stage now where you need the extra flexibility provided by GML.

The collision circle way probably works but I always do this for checking distance ranges between objects.

Create:

weaponRange = 100

Step: (can also use an alarm so it checks every certain number of steps but that needs additional code)

if distance_to_object(objEnemy) <= weaponRange
{
    //shooting code
}

In Topic: Artifical Intellegence Spawn and respawning

22 January 2012 - 12:56 AM


You are going to need to provide code so we can see what is wrong. And what do you mean by "just spawned the newly spawned characters"?

if ally<=3
{
instance_create(x,y,ally)
}

also i don't know where to put the spawn code even if the code is right.


Probably the best place to put the code is in an alarm for the object you are spawning. In the destroy event set the alarm[0] to the value of how long you want the ally to remain dead. If it was 5 seconds then you would use room_speed * 5. Then it would activate that code and spawn your object at the spawnpoint.

Use a with construction so you can access the spawnpoint you are spawning the object at, so you can use its x, y values for when you create the ally.

As to your problem I am still not sure. If you could add more detailed information that would help. I assume your if ally <= 3 is to make it not spawn any more allies if there are already 4 allies. Exactly why do you need this? Surely you won't be spawning any allies unless one has died anyway? More information on exactly how your spawning system works would be helpful.

In Topic: very specific question

22 January 2012 - 12:46 AM


You need a seperate global variable for each type of buidling do you not? Perhaps a global array where each object uses a unique number to as the index to the array. That way when the objectt is destroyed it can set the correct part of the array.


I am not understanding, what are you trying to suggest to me?


A list that is global essentially. With each one of the indexes being the variable for each building. Easier to handle than variables, but will still need the same number as the number of buildings there are.