okay i have a cog that is near completed but i need some help. The cog generates an enemy once the player enters sector1 then the enemy is supposed to walk to a thing and then partol between 2 frames that need to loop. Then when the player sees the enemy the enemy is supposed to stop look at the player and then the enemy would attack the player. If the enemy is killed another one is supposed to respawn and start all over again. Then once the player enters sector2 it is supposed to destroy the enemy and it is finished. The problem i have is i can't figure out where i can stick the stuff for the frames where it will loop until the cog is finished.
i need to stick this in there somewhere
here is the rest of the cog where should i stick it
also if u see any other errors point them out
i need to stick this in there somewhere
Code:
AiSetMoveThing(enemy, ghost2); //move enemy to ghost position AiSetMoveFrame(enemy, 1); //now move enemy along his frames AiSetMoveFrame(enemy, 2); AiSetMoveFrame(enemy, 1);
here is the rest of the cog where should i stick it
Code:
# ROX Cog Script # # ENEMYPATHGENERATOR.COG # # Creates enemy and has him follow frames until player is seen. # #[Han5678} symbols thing player local thing ghost1 thing ghost2 thing enemy local template enemy sector sector1 linkid=1 sector sector2 linkid=2 int cur_num=0 local int cur_alive=0 local int generate_num=1 local int max_alive local message startup message entered message pulse message killed message sighted end # ======================================================================================== code starup: player = GetLocalPlayerThing(); return; # ........................................................................................ entered: if (GetSenderId() == 1) //if it is first sector create player { SetPulse(1); } else if (GetSenderId() == 2) // if it is second sector kill him and call it a day { DestroyThing(enemy); SetPulse(0); } return; # ........................................................................................ pulse: if((cur_alive < max_alive)) //see if we have room for one more enemy { enemy = CreateThing(enemy, ghost1); // if so create him and make it so we can't have any more CaptureThing(enemy); // enemies cur_num = cur_num + 1; cur_alive = cur_alive + 1; if(cur_num >= generate_num) SetPulse(0); } return; # ........................................................................................ killed: cur_alive = cur_alive - 1; //if he is killed set pulse to replace him SetPulse(1); return; # ........................................................................................ sighted: StopThing(enemy); //if the player sees him stop the enemy and make him go after player AISetInterest(enemy,player); return; end
also if u see any other errors point them out
roses are red, violets are blue, I am schizophrenic, and I am too!