View unanswered posts | View active topics It is currently Thu Jan 16, 2025 5:35 am



Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
 Toggle enemies in 1 player skirmish 
Author Message
User avatar

Joined: Fri Dec 22, 2006 4:20 am
Posts: 4772
Location: Good news everyone!
Reply with quote
Post Re: Toggle enemies in 1 player skirmish
If you'd have fun doing it, of course!


Sun Sep 06, 2009 10:02 pm
Profile WWW
DRLGrump
User avatar

Joined: Tue Nov 07, 2006 1:26 am
Posts: 2037
Location: Jerking off in a corner over by the OT sub-forum
Reply with quote
Post Re: Toggle enemies in 1 player skirmish
CrazyMLC wrote:
Put this code on a custom made actor, or even the brain (You just wont be able to do most missions that include a brain).
Code:
function Update(self)
   for actor in MovableMan.Actors do
      if actor.Team ~= self.Team then
         actor:ClearAIWaypoints();
      end
         actor:GetController():SetState(Controller.WEAPON_FIRE,false);
      end
   end
end

This basically means: If any actors are not on the same team as this actor, then make it not move, and not fire.

They will still wave their gun around and such, and point it at you though.
Perfect for making a comic, eh?

How do you attach that script?


Mon Sep 07, 2009 3:00 pm
Profile
User avatar

Joined: Fri Jul 24, 2009 9:03 am
Posts: 159
Reply with quote
Post Re: Toggle enemies in 1 player skirmish
In an actor, a brain or otherwise you can add the line ScriptPath = yourluafile.lua replacing the name with your lua file, I used AI.lua but you can chose any name (I think), this line goes in the .ini file and CrazyMLC's code goes in the lua file.

EDIT: Slightly outdated but I found that this code works better-
function Update(self)
*for actor in MovableMan.Actors do
**if actor:GetController().InputMode ~= 1 then
**actor:GetController().InputMode = 3
**end
*end
end

(Replace * with a tab)


Mon Sep 07, 2009 4:16 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 18 posts ]  Go to page Previous  1, 2

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.042s | 14 Queries | GZIP : Off ]