PDA

View Full Version : *punch* "Wake up!"



Edward
03-26-2003, 12:16 AM
Hi!
I require a COG. I have a level filled with sleeping enemies. Now I want to do like this, if I happen to do the slightest punch on one of these enemies, everyone will awake and attack me! Question: How?

/Edward
------------------
To COG, or not to COG, what a question...

[This message has been edited by Edward (edited March 26, 2003).]

gbk
03-26-2003, 09:12 AM
Just how many enemies are we talking about here?

------------------
Createthingatpos(GBK, 0, '0 0 0', '0 0 0');

Edward
03-26-2003, 12:32 PM
Lets say... One JO Level!
But hay! every one within the same room will do! I think I'll be having 10-20...

/Edward

gbk
03-26-2003, 01:33 PM
I saw the word 'JO' and started typing out the URL to my 'Wrong thread' image... http://forums.massassi.net/html/tongue.gif



# 03/2003 GBK
Symbols
Message Damaged
Thing Enemy0
Thing Enemy1
Thing Enemy2
Thing Enemy3
Thing Enemy4
Thing Enemy5
Thing Enemy6
Thing Enemy7
Thing Enemy8
Thing Enemy9
Thing Enemy10
Thing Enemy11
Thing Enemy12
Thing Enemy13
Thing Enemy14
Thing Enemy15
Thing Enemy16
Thing Enemy17
Thing Enemy18
Thing Enemy19
Int I=0 Local
End
Code
Damaged:
For(I=0;I<20;I=I+1) Clearactorflags(Enemy0[I], 0x200000);
Stop;
End


I am assuming your using the 200k actor flag to get them to sleep...

------------------
Createthingatpos(GBK, 0, '0 0 0', '0 0 0');

Edward
03-26-2003, 02:20 PM
I don't know what flag I'm using. I'm using aisleep.cog

Edward
03-27-2003, 12:45 PM
I hate to breake it to you, but it didn't work! I managed to kill 8 people without getting hurt myself! I'm using JK and I punch people and no reaction!

/Edward

Oops sorry! Forgot that any tab or spaces I copy from here I'll have to fix in Notepad...

[This message has been edited by Edward (edited March 27, 2003).]

Edward
03-27-2003, 12:53 PM
Still won't work!


------------------

Edward
03-29-2003, 05:40 AM
HEEEEEEEEELLLLLLLLLOOOOOOOOO!!!!!!!!!!

SaberMaster
03-29-2003, 08:32 AM
The 0x200000 Actor flag is for players, aisleep uses the 0x2000 AI Flag.

Remove all your copies of the aisleep cog and use this one, should work fine the first time:



# ai_awake.cog
#
# A cog to put x number of enemies to sleep and wake them up upon damage to one.
#
# [GBK + SM]
#================================================= =============#
symbols

thing enemy
thing enemy1
thing enemy2
thing enemy3
thing enemy4
thing enemy5
thing enemy6
thing enemy7
thing enemy8
thing enemy9
thing enemy10
thing enemy11
thing enemy12
thing enemy13
thing enemy14
thing enemy15
thing enemy16
thing enemy17
thing enemy18
thing enemy19

int i local
int done local
int enemyNum

message startup
message damaged

end
#================================================= =============#
code
#------------------------------------------------------
startup:
// disable ai.
for(i=0, done=0; i < enemyNum; AISetMode(enemy[i], 0x2000), i=i+1);

Return;
#------------------------------------------------------
damaged:
if(done) Return; done=1;
// enable and awaken ai.
for(i=0; i < enemyNum; AIClearMode(enemy[i], 0x2000), AISetMode(enemy[i], 0x200), i=i+1);

Return;
#------------------------------------------------------
end


If you need the cog modified, just ask. Parsec, BTW, will not accept some of the syntax used there, but don't worry about it.

Good luck. http://forums.massassi.net/html/wink.gif

------------------
Author of the JK DataMaster (http://www.geocities.com/sabersdomain/fileframe.html), Parsec (http://www.geocities.com/sabersdomain/fileframe.html), Scribe (http://www.geocities.com/sabersdomain/fileframe.html), and the EditPlus Cog Files (http://www.geocities.com/sabersdomain/fileframe.html).

[This message has been edited by SaberMaster (edited March 29, 2003).]

gbk
03-29-2003, 09:50 AM
WTF?!?! http://forums.massassi.net/html/eek.gif

------------------
Createthingatpos(GBK, 0, '0 0 0', '0 0 0');

Edward
03-29-2003, 10:56 AM
Hi!
Guess what, SaberMaster! Your COG didn't work either! Sure the enemies fell asleep but they didn't wake up when I punched them. I killed everyone in one level without getting hurt!

/Edward

SaberMaster
03-29-2003, 11:24 AM
It's probably something with the level. My cog uses the same method of sleeping and waking ai that aisleep uses, so I know it can work. If you can't figure it out, send me the level, and I'll find the problem. I also changed the above script a little.

And, GBK, I did document the extended for loop syntax in the datamaster - and it is standard C++. http://forums.massassi.net/html/wink.gif

------------------
Author of the JK DataMaster (http://www.geocities.com/sabersdomain/fileframe.html), Parsec (http://www.geocities.com/sabersdomain/fileframe.html), Scribe (http://www.geocities.com/sabersdomain/fileframe.html), and the EditPlus Cog Files (http://www.geocities.com/sabersdomain/fileframe.html).

[This message has been edited by SaberMaster (edited March 29, 2003).]

DogSRoOL
03-29-2003, 01:05 PM
you need to have a mask after each of the things in the symbols section for the damaged message. Add "mask=0x408" after each of the things in the above cog, and it should work.

------------------
May the forks be with you.

Edward
03-29-2003, 02:21 PM
<font face="Verdana, Arial" size="2">Originally posted by GBK:
WTF?!?! http://forums.massassi.net/html/eek.gif

</font>

http://edward.leuf.org/eds_pics/edw.jpg

/Edward

Edward
03-29-2003, 02:32 PM
OK! It worked! But the thing is that when I punch someone, they all say "Stop" or "Kill" or "Hault", collect in one spot, and do nothing until I either jump over them or go up an elevator.

/Edward