Allies take CPs Problem

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
User avatar
darthvatrayen
Private Recruit
Posts: 24
Joined: Tue Jun 23, 2009 9:58 pm

Allies take CPs Problem

Post by darthvatrayen »

Hello again. I need help. (as usual Q.Q)
Anyway. I am making a new map that involves both ATT and DEF to be allies. I set them as friends but they still took each other's cps. :runaway: Thanks for the help in advance. :bowdown:
User avatar
Tourny
Command Sergeant Major
Command Sergeant Major
Posts: 289
Joined: Sat Sep 27, 2008 5:58 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Crifton
Contact:

Re: Allies take CPs Problem

Post by Tourny »

Are you ready for some scripting? This is this code's objective:

Team 2 Player: *spawns*
Game: Hey, you're on team 2!
Game: *turns him into a team 1 player*

Follow these steps:

1. Open you're lua.
2. Place this code over this (<EDIT) part of the lua:
Hidden/Spoiler:
[code]end



---------------------------------------------------------------------------
-- FUNCTION: ScriptInit
-- PURPOSE: This function is only run once
-- INPUT:
-- OUTPUT:
-- NOTES: The name, 'ScriptInit' is a chosen convention, and each
-- mission script must contain a version of this function, as
-- it is called from C to start the mission.
---------------------------------------------------------------------------
[/code]
Code:
Hidden/Spoiler:
[code]OnCharacterSpawn(
function(player)
if GetCharacterTeam(player) == "%TeamYouWantToChangeFrom%" then
local %MakeUpAVariable% = GetEntityName(player)
SetProperty(%samevariable%, Team, %TeamToChangeTo%)
end
end
)
[/code]
Try this code and see what happens. The Team variables can be ATT or DEF, or also 1, 2, etc, I think.

3. Save your lua.
4. Munge.
5. Play your map.
Post Reply