PDA

View Full Version : Enemy and Friend Cog



SithGhost
06-22-2002, 07:00 PM
In my level you disguise yourself as a stormtrooper. While you have the disguise on, stormtroopers will not attack you. When you take it off they will. But if you attack them while you have the suit on, then they will keep attacking you.

I don't think this is very hard to do, but I do have one question before I start writing it. How do I dynamically set if an actor is against me or an allie through cog?

------------------
Script Warehouse (http://24.191.89.234:800/WD/)
The Jedi's Saber (http://24.191.89.234:800/tjs/index.html)

gbk
06-22-2002, 07:03 PM
Its all in the AI file. Just fun an array through all of the objects in a levels, looking for enemy stormtroopers. When found, change its AI to something non-volatile and back.

------------------
I used to believe that we only want what we can't have. I was wrong. The truth is, the wonderful truth is, we only want what we think we can't have.

JK editing resources (http://www.tbns.net/GBK/ol/index.htm).

SithGhost
06-22-2002, 08:16 PM
So I'll have to replace the friendly stormtrooper with a mean one through cog?

------------------
Script Warehouse (http://24.191.89.234:800/WD/)
The Jedi's Saber (http://24.191.89.234:800/tjs/index.html)

gbk
06-23-2002, 04:03 AM
For(I=0;I<=Getthingcount();I=I+1) If(Getthingtemplate(I) == Troop_type) AIsetclass(I, New_AI);


A loop to change every enemy of a specific template to a new AI file.

------------------
I used to believe that we only want what we can't have. I was wrong. The truth is, the wonderful truth is, we only want what we think we can't have.

JK editing resources (http://www.tbns.net/GBK/ol/index.htm).

SithGhost
06-23-2002, 08:14 PM
Thanks. http://forums.massassi.net/html/biggrin.gif


One more question (as of now) what message should I use?

------------------
Script Warehouse (http://24.191.89.234:800/WD/)
The Jedi's Saber (http://24.191.89.234:800/tjs/index.html)

gbk
06-24-2002, 07:49 AM
Startup:
Sleep(.5);
For(I=0;I<=Getthingcount();I=I+1) If(Getthingtemplate(I) == Troop_type) { Capturething(I); AIsetclass(I, Gentle_AI); }
Stop;

Damaged:
If(Getthingparent(Getsourceref()) != Player || AImad) Stop;
AImad=1; //AImad is an int, make it 0 and local.
For(I=0;I<=Getthingcount();I=I+1) If(Getthingtemplate(I) == Troop_type) AIsetclass(I, Mad_AI);
Stop;




I have no idea how you are handling the 'removal' of the stormie outfit, but add something similar to the second array to that action.

------------------
I used to believe that we only want what we can't have. I was wrong. The truth is, the wonderful truth is, we only want what we think we can't have.

JK editing resources (http://www.tbns.net/GBK/ol/index.htm).

SithGhost
06-24-2002, 01:44 PM
All I did was edit the Tuskan Clothing cogs to display differant text and change the template.

Thanks. http://forums.massassi.net/html/smile.gif

------------------
Script Warehouse (http://24.191.89.234:800/WD/)
The Jedi's Saber (http://24.191.89.234:800/tjs/index.html)