Posted by Jeff Clark on March 13, 1998 at 09:56:00:
In Reply to: Cogking or Stealth or Alexi..please read! posted by Elanthil on March 13, 1998 at 07:32:49:
> hey..I THINK I found a way to protect a player from being attacked (I like this better than making him invulnerable as THIS WAY, the enemy goes about its business, patrolling, etc, but wont shoot at the player..I hope..it just seems more elegant than dumbing down the enemy or making him invulnerable).
> Please tell me if this will work or not, and if not, what to change to fix it:
> # Jedi Knight Cog Script
> #
> # plyrprot1.cog
> #
> # protect player for specified time(non-target)
> #
> # [RD]
> #
> # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
> # ========================================================================================
> symbols
> message startup
> thing player local
> int sleeptime
> end
> # ========================================================================================
> code
> startup:
> #grab the player
> player = GetLocalPlayerThing();
> #make the player a non target
> SetPhysicsFlags(player,0x100000);
> #set a timer and wait for it to run out
> SetTimer(sleeptime);
I would probably use sleep(sleeptime), but that may very well
be out of ignorance.
> #make player a target again
> ClearPhysicsFlags(player,0x100000);
> end
Looks good to me. I am NOT a cog expert though. I have a
question though? Why don't you write the cog and test it
yourself. It would seem to me to be less time consuming
than getting online, and posting the cog as a message.
Happy to answer, but I think that this would work just
fine if you tested it yourself.