random att/def

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

random att/def

Post by THEWULFMAN »

Would it be possible to have a lua script that randomizes which team is attacking and which is defending, like the random weather? If so, how? Thanks in advance.

Note, I am really bad a lua scripting, at least anything advanced.
kinetosimpetus
Imperial Systems Expert
Imperial Systems Expert
Posts: 2381
Joined: Wed Mar 25, 2009 4:15 pm
Projects :: A secret project
Games I'm Playing :: Warframe STO

Re: random att/def

Post by kinetosimpetus »

I did this in Rhen Var: Canyon.

Code: Select all

ATT = 1
DEF = 2
--this never changes, ever, no really, i mean it, lol.

if not ScriptCB_InMultiplayer() then
     ALL = math.random(1,2)
     IMP = (3 - ALL)
else
     IMP = 1
     ALL = 2
end
--tada, now the teams will randomly switch which side of the map they are on, :D
--not for use it space, or campaigns, or multiplayer.
Last edited by kinetosimpetus on Fri Jan 28, 2011 12:43 am, edited 1 time in total.
THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

Re: random att/def

Post by THEWULFMAN »

Thanks alot, testing now.
Post Reply