Ive been making a game for a couple of weeks now, and have encountered a problem which I can't figure out. I'm using pmo for the ai of the enemies, and each enemy has two parts arms(which rotate 32 directions)and the body. The coding is fairly simple and all ive done is create an object on the player when they have activated the enemy, always have the body & arms look at that object and if the enemy is facing left or right, "player is pressing left/right" accordingly. Now it works ok, with a few bugs but I just can't get more than one enemy working. I've changed all the relevant events and stuff to a qualifier in case that would help, but it doesnt make any difference.
The enemy guys dont respond, and once one has been destroyed, all the arms for all the other guys are destroyed too, not the body, even though their both instructed to be destroyed...
There must be another way, i've thought about having objects at enemy locations and creating the arms and body that way instead of copying, but I have no idea on how i would come about that.
I hope all that doesnt look too confusing.
Thanks for your time
the part about when the enemy being destroyed all the arms and legs or whatever dissappear. let me guess. when you attack the enemy a number is added to A,B,C etc value of body and when that value is a certain number destroy the the body and limbs, or when collision with body destroy it and limbs. only one body will dissapear cause its the only one with that value or is being hit but when you have it destroy the arms along whith body it thinks you want to destroy all of them. end result all limbs dissapear. at least thats whats happening to me in a tank game im trying to make. the tank and its cannon would dissapear along with all the other tanks cannons but the tanks would still be there.i couldnt figure it out either. im working on it though. this would take along time but animate the body with arms in all 32 directions.
Actually I've assigned the enemy guys to a qualifier (bad) and every hit of the a bullet subtracts 1 from alt value. The enemies body is the one with the qualifier, not the arms. When alt value = 0, destroy bad and arms.
thats basically what i said. except your using a qualifier instead of one of the values for the enemy object. it still thinking when the body is destroyed to destroy all arms cause theyre not included in some sort of value.
hold on, i had an idea. im gonna test it out.
whatever you do, dont delete this feed.
also make a value or qualifier for the arms
if the arms are overlapping the body always set their value to bodies value
then just like you have body<=0 destroy body or bad put when arms<=0 destroy arms
this should only set the value of the arms of the enemy your attacking to the value of the body so when the body=0 so do the arms and only those arms are destroyed. hope i said that right and it makes sense.i hope it works for you. it worked in my test.
Sweet, thanks, thats one problem solved. now all i need to figure out is why they aren't responding correctly. I think i need to get some web space so people can see whats happening...
When you run SPREAD A NUMBER, it takes each object in that collection and assigns a number to it, then steps it. For instance, say you have three instances of the GUARD Object. If you were to spread the value 1 on the GUARD Objects? The first guard would have the value 1. The second, 2, and the third, naturally, 3.
This has a whole array of other uses too. It's a great way to assign unique IDs to every enemy. Once you've done that, you can easily use a FASTLOOP to run a routine for each guard ONE AT A TIME. You could make ONE guard shoot a bullet and run it through a fastloop, so that when it strikes you have a way of knowing where it came from. Of course, you could shoot the bullet and assign the Guards now-unique ID to the bullet too.
If you have an event like 'When GUARD is stopped', it'll only run if atleast one guard is stopped, right? Well some people don't realize that it'll select ALL of the guards that are not moving. Spreading a number then will only affect stopped guards then. I don't know why you'd do that there, but you can. Maybe you could do it to assign goal markers for movement? 'Create marker', 'Set marker to guard X/Y', 'Start Guard moving'
It's terribly useful. I found it pretty handy for my pathfinding work.
Current Projects:
Bomb Squad (Total Progress - 3%)
:: Current Task Progress: 40%
:: Current Task - Level Editor Shell
ok here is the 'training' mission.plz exuse everything that looks dodegy and crap, I intend to vastly improve everything, 'thats just there to remind me what goes where'
oh and when you do shoot the first guy and he runs at you all jerky-like, that doesnt usually happen neither.
use the arrows to move, havent changed the controls to wsad yet, and try to ignore the shooting direction bugs.
<IMG
oh and if anyone has a good idea for something to put in the background behind the
'mountains' would be great.
src="./sitegfx/edited.gif"></IMG> Edited by the Author.
why do you use the platform extension in a top view game? I could look through you cca, but I dont have the extension, and having some problems installing the bonus packs...If you remove the platform extension I could help you.
And I am really curious - what are you using the extension for in your game!?