Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → *punch* "Wake up!"
*punch* "Wake up!"
2003-03-25, 9:16 PM #1
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).]
Edward's Cognative Hazards
2003-03-26, 6:12 AM #2
Just how many enemies are we talking about here?

------------------
Createthingatpos(GBK, 0, '0 0 0', '0 0 0');
And when the moment is right, I'm gonna fly a kite.
2003-03-26, 9:32 AM #3
Lets say... One JO Level!
But hay! every one within the same room will do! I think I'll be having 10-20...

/Edward
Edward's Cognative Hazards
2003-03-26, 10:33 AM #4
I saw the word 'JO' and started typing out the URL to my 'Wrong thread' image... [http://forums.massassi.net/html/tongue.gif]

Code:
# 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, 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');
And when the moment is right, I'm gonna fly a kite.
2003-03-26, 11:20 AM #5
I don't know what flag I'm using. I'm using aisleep.cog
Edward's Cognative Hazards
2003-03-27, 9:45 AM #6
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's Cognative Hazards
2003-03-27, 9:53 AM #7
Still won't work!


------------------
Edward's Cognative Hazards
2003-03-29, 2:40 AM #8
HEEEEEEEEELLLLLLLLLOOOOOOOOO!!!!!!!!!!
Edward's Cognative Hazards
2003-03-29, 5:32 AM #9
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:

Code:
# 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, 0x2000), i=i+1);

Return;
#------------------------------------------------------
damaged:
        if(done) Return; done=1;
	// enable and awaken ai.
	for(i=0; i < enemyNum; AIClearMode(enemy, 0x2000), AISetMode(enemy, 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, Parsec, Scribe, and the EditPlus Cog Files.

[This message has been edited by SaberMaster (edited March 29, 2003).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2003-03-29, 6:50 AM #10
WTF?!?! [http://forums.massassi.net/html/eek.gif]

------------------
Createthingatpos(GBK, 0, '0 0 0', '0 0 0');
And when the moment is right, I'm gonna fly a kite.
2003-03-29, 7:56 AM #11
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
Edward's Cognative Hazards
2003-03-29, 8:24 AM #12
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, Parsec, Scribe, and the EditPlus Cog Files.

[This message has been edited by SaberMaster (edited March 29, 2003).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2003-03-29, 10:05 AM #13
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.
Catloaf, meet mouseloaf.
My music
2003-03-29, 11:21 AM #14
Quote:
<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's Cognative Hazards
2003-03-29, 11:32 AM #15
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
Edward's Cognative Hazards

↑ Up to the top!