I need enemy unit not spawn & not appear in selection screen

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
Deviss
Master of the Force
Master of the Force
Posts: 3772
Joined: Tue Aug 12, 2008 7:59 pm
Projects :: Clone Wars Extended
Games I'm Playing :: BF2

I need enemy unit not spawn & not appear in selection screen

Post by Deviss »

hi there :D i am making conversion armor idea :P, so i need enemy team soldier class dont spawn ingame and not appear in unit selection screen, i tried watching geonosis campaign lua but icant find the function :S please help

:mrgreen:
for example:
if humanplayer use team 2 (cis) then
if humanplayer get 99999999999 points then
unlock class (soldier or cis_inf_rifleman)
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: I need enemy unit not spawn & not appear in selection sc

Post by lucasfart »

Let me get this straight. You want the player to be forced onto a team....I think there is a function/line for that, somewhere at the start of all the campaign maps, which forces the player onto a certain team...
User avatar
SW_elite
Filthy Thief
Filthy Thief
Posts: 507
Joined: Sat Jan 02, 2010 6:43 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: Australia!!!

Re: I need enemy unit not spawn & not appear in selection sc

Post by SW_elite »

Go into your Lua code for the mission you want. Just say you wanna take out the sniper, then you get rid of the line saying "imp_inf_sniper".

ReadDataFile("SIDE\\imp.lvl",
"imp_inf_rifleman",
"imp_inf_rocketeer",
"imp_inf_engineer",
"imp_inf_sniper",
"imp_inf_officer",
"imp_inf_dark_trooper",
"imp_hero_bobafett",
"imp_fly_destroyer_dome" )

That's it!
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: I need enemy unit not spawn & not appear in selection sc

Post by lucasfart »

It might be better, however to just set the unit count for the unit you don't want to 0, or if you don't want a whole side, set the side unit count to 0........Also, i think there is a command used at the start of the stock geo campaign which doesn't allow the other team to spawn....
Deviss
Master of the Force
Master of the Force
Posts: 3772
Joined: Tue Aug 12, 2008 7:59 pm
Projects :: Clone Wars Extended
Games I'm Playing :: BF2

Re: I need enemy unit not spawn & not appear in selection sc

Post by Deviss »

for example is geonosis campaign you cant use rep_inf_ep2_rocketeer until you complete previous mission so i want make the same :) , but using IF and THEN so put if player human team 2 (cis) then need gain 99999 points for unlock rep_inf_ep3_rocketeer or if gain 99999 points then unlock soldier class :)
User avatar
StarkillerMarek
Rebel Colonel
Rebel Colonel
Posts: 611
Joined: Wed Aug 12, 2009 4:42 pm
Location: I may be back.

Re: I need enemy unit not spawn & not appear in selection sc

Post by StarkillerMarek »

Deviss wrote:for example is geonosis campaign you cant use rep_inf_ep2_rocketeer until you complete previous mission so i want make the same :) , but using IF and THEN so put if player human team 2 (cis) then need gain 99999 points for unlock rep_inf_ep3_rocketeer or if gain 99999 points then unlock soldier class :)
So, let me get this straight.

You want, if the humanplayer is on the CIS team, to need to gain 99999 points to unlock a certain unit?
Deviss
Master of the Force
Master of the Force
Posts: 3772
Joined: Tue Aug 12, 2008 7:59 pm
Projects :: Clone Wars Extended
Games I'm Playing :: BF2

Re: I need enemy unit not spawn & not appear in selection sc

Post by Deviss »

StarkillerMarek wrote:
Deviss wrote:for example is geonosis campaign you cant use rep_inf_ep2_rocketeer until you complete previous mission so i want make the same :) , but using IF and THEN so put if player human team 2 (cis) then need gain 99999 points for unlock rep_inf_ep3_rocketeer or if gain 99999 points then unlock soldier class :)
So, let me get this straight.

You want, if the humanplayer is on the CIS team, to need to gain 99999 points to unlock a certain unit?
exact :D you always understand my bad english xD
User avatar
StarkillerMarek
Rebel Colonel
Rebel Colonel
Posts: 611
Joined: Wed Aug 12, 2009 4:42 pm
Location: I may be back.

Re: I need enemy unit not spawn & not appear in selection sc

Post by StarkillerMarek »

I don't know how check to see what team the player is on, but the scripts "AddUnitClass"(see the geonosis script) and the "SetProperty" (points to unlock) can be used to get the other to things you want to happen happen.


I can probably arrange it into a lua code if someone could tell me how to do the first part.
Deviss
Master of the Force
Master of the Force
Posts: 3772
Joined: Tue Aug 12, 2008 7:59 pm
Projects :: Clone Wars Extended
Games I'm Playing :: BF2

Re: I need enemy unit not spawn & not appear in selection sc

Post by Deviss »

StarkillerMarek wrote:I don't know how check to see what team the player is on, but the scripts "AddUnitClass"(see the geonosis script) and the "SetProperty" (points to unlock) can be used to get the other to things you want to happen happen.


I can probably arrange it into a lua code if someone could tell me how to do the first part.
myers made this for me:

Code: Select all

    AddUnit = OnCharacterDeath(
        function(killer)
        if IsCharacterHuman(killer) then
            if GetCharacterTeam(killer) == 2 then
                if GetTeamPoints(2) > 99999 then
                    AddUnitClass(2, "cis_inf_rifleman", 0)
                    end
                end
            end
        end
    )
   
end
2 is because cis team is 2 and using this anyway cis_inf_rifleman appear in unit screen selection :S
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: I need enemy unit not spawn & not appear in selection sc

Post by lucasfart »

You know how to add a player to a team, right? Well in the spot where you define the unit count and name, remove the unit you don't want, say for instance the rocketeer. Then when you want them to be useable on the map, use the AddUnitClass command.

This is basicly what Starkiller was talking about...
Deviss
Master of the Force
Master of the Force
Posts: 3772
Joined: Tue Aug 12, 2008 7:59 pm
Projects :: Clone Wars Extended
Games I'm Playing :: BF2

Re: I need enemy unit not spawn & not appear in selection sc

Post by Deviss »

lucasfart wrote:You know how to add a player to a team, right? Well in the spot where you define the unit count and name, remove the unit you don't want, say for instance the rocketeer. Then when you want them to be useable on the map, use the AddUnitClass command.

This is basicly what Starkiller was talking about...
there is a little problem... i need have that unit as first so i cant remove it from setupteams section :mrgreen:
Post Reply