Page 1 of 1

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

Posted: Wed May 26, 2010 9:33 pm
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)

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

Posted: Thu May 27, 2010 2:01 am
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...

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

Posted: Thu May 27, 2010 2:02 am
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!

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

Posted: Thu May 27, 2010 2:12 am
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....

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

Posted: Thu May 27, 2010 10:10 am
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 :)

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

Posted: Thu May 27, 2010 3:55 pm
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?

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

Posted: Thu May 27, 2010 3:59 pm
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

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

Posted: Thu May 27, 2010 4:03 pm
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.

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

Posted: Thu May 27, 2010 4:17 pm
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

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

Posted: Thu May 27, 2010 5:58 pm
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...

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

Posted: Thu May 27, 2010 6:00 pm
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: