Unit Upgrading
Moderator: Moderators
- Dakota
- Field Commander

- Posts: 991
- Joined: Mon Dec 06, 2010 8:21 pm
- Projects :: making random weapon assets
- xbox live or psn: PS3 beats xbox
- Location: at a computer desk floating around in space
Unit Upgrading
i need to know if there is an lua code or something that will make a player change their class after a certain ammount of points but i also need it to not kill them or at least make them spawn in the same location instantly.
Example: a player gets 5 points, then changes into a different class and then gets 5 more points and then goes to a different class.
Is this possible? If not, are there work arounds?
Example: a player gets 5 points, then changes into a different class and then gets 5 more points and then goes to a different class.
Is this possible? If not, are there work arounds?
- Locutus
- 1st Lieutenant

- Posts: 420
- Joined: Fri Jun 04, 2010 10:08 am
- Projects :: Stargate Battlefront Pegasus
- Location: Germany
- Contact:
Re: Unit Upgrading
It is possible.
Play Mav's Beach Trooper Mod in survival mode
Play Mav's Beach Trooper Mod in survival mode
-
THEWULFMAN
- Space Ranger
- Posts: 5557
- Joined: Tue Aug 17, 2010 3:30 pm
- Projects :: Evolved 2
- Location: Columbus, Ohio
- Contact:
Re: Unit Upgrading
You can change the class with SetClassProperty, and then reselect the unit at a command post without ever dying. Or kill and respawn the unit in the same exact place without the need of going to a command post. The conditions where the unit class changes are something different altogether. There are many ways to meet a condition, I do not know them all or specifics. It's been a long time since I did any Lua coding. I don't think you can check number of points, I'm not sure.
- Dakota
- Field Commander

- Posts: 991
- Joined: Mon Dec 06, 2010 8:21 pm
- Projects :: making random weapon assets
- xbox live or psn: PS3 beats xbox
- Location: at a computer desk floating around in space
Re: Unit Upgrading
points or kills would work, also i needed the unit to change without going to a command post, the mod is going to be an arena type wave mode thing. and what did you mean with changing the class with setclassproperty? would it work for the individual player?THEWULFMAN wrote:You can change the class with SetClassProperty, and then reselect the unit at a command post without ever dying. Or kill and respawn the unit in the same exact place without the need of going to a command post. The conditions where the unit class changes are something different altogether. There are many ways to meet a condition, I do not know them all or specifics. It's been a long time since I did any Lua coding. I don't think you can check number of points, I'm not sure.
if all of this is too complicated or impossible i could just have the unit have to walk to a central cp to upgrade :/
-
THEWULFMAN
- Space Ranger
- Posts: 5557
- Joined: Tue Aug 17, 2010 3:30 pm
- Projects :: Evolved 2
- Location: Columbus, Ohio
- Contact:
Re: Unit Upgrading
Dakota wrote:points or kills would work, also i needed the unit to change without going to a command post, the mod is going to be an arena type wave mode thing. and what did you mean with changing the class with setclassproperty? would it work for the individual player?
if all of this is too complicated or impossible i could just have the unit have to walk to a central cp to upgrade :/
SetClassProperty is a SWBF2 Lua command.
Here's an example:SetClassProperty("the name of the class we're changing", "what part of that class we're changing", "what we're changing it to")
Basically you could change the class property you want, get the unit's matrix (the actual position of where it is on the map), kill the unit, and then respawn the unit at it's matrix.SetClassProperty("rep_inf_ep3trooper", "MaxHealth", "600")
Changing the class like this is not perfect. It will only affect newly spawned units. So if you change the class, the currently spawned units of the class won't change. If you die and then respawn, you will see the new changes.
- Dakota
- Field Commander

- Posts: 991
- Joined: Mon Dec 06, 2010 8:21 pm
- Projects :: making random weapon assets
- xbox live or psn: PS3 beats xbox
- Location: at a computer desk floating around in space
Re: Unit Upgrading
i know about setclassproperty but i don't know the setclassproperty code for changing a unit into another unit.
also setclassproperty is for the entire class, i would need it to change just 1 player into a different class, it would have to work on multiplayer too.
also setclassproperty is for the entire class, i would need it to change just 1 player into a different class, it would have to work on multiplayer too.
-
THEWULFMAN
- Space Ranger
- Posts: 5557
- Joined: Tue Aug 17, 2010 3:30 pm
- Projects :: Evolved 2
- Location: Columbus, Ohio
- Contact:
Re: Unit Upgrading
You change specific things in the class, but it's still the same class. You can change model, weapon, health, shields, speed, etc. Whatever you need for the new unit.Dakota wrote:i know about setclassproperty but i don't know the setclassproperty code for changing a unit into another unit.
This can't be done in multiplayer. Plain and simple. You can't edit a specific unit, only an entire class.Dakota wrote:also setclassproperty is for the entire class, i would need it to change just 1 player into a different class, it would have to work on multiplayer too.
- Dakota
- Field Commander

- Posts: 991
- Joined: Mon Dec 06, 2010 8:21 pm
- Projects :: making random weapon assets
- xbox live or psn: PS3 beats xbox
- Location: at a computer desk floating around in space
Re: Unit Upgrading
so i don't need setclassproperty at all. i don't need to change the class, i need to change a unit into a different class, like if you where a trooper, you get some kills, and change classes into a rocketeer.
-
THEWULFMAN
- Space Ranger
- Posts: 5557
- Joined: Tue Aug 17, 2010 3:30 pm
- Projects :: Evolved 2
- Location: Columbus, Ohio
- Contact:
Re: Unit Upgrading
Dakota wrote:so i don't need setclassproperty at all. i don't need to change the class, i need to change a unit into a different class, like if you where a trooper, you get some kills, and change classes into a rocketeer.
If it has to be done in Multiplayer, then yes.
- Dakota
- Field Commander

- Posts: 991
- Joined: Mon Dec 06, 2010 8:21 pm
- Projects :: making random weapon assets
- xbox live or psn: PS3 beats xbox
- Location: at a computer desk floating around in space
Re: Unit Upgrading
yes to what?
-
THEWULFMAN
- Space Ranger
- Posts: 5557
- Joined: Tue Aug 17, 2010 3:30 pm
- Projects :: Evolved 2
- Location: Columbus, Ohio
- Contact:
Re: Unit Upgrading
Dakota wrote:yes to what?
If it has to be done in multiplayer in the way described beforehand, then the only way to do it is to slowly unlock more classes. 6 points unlocks the sergeant, 15 unlocks the captain, 30 unlocks the general, and so forth.Dakota wrote:so i don't need setclassproperty at all. i don't need to change the class, i need to change a unit into a different class, like if you where a trooper, you get some kills, and change classes into a rocketeer.
- lucasfart
- Sith

- Posts: 1440
- Joined: Tue Feb 24, 2009 5:32 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Australia
Re: Unit Upgrading
Correct me if I'm wrong, but he means instantly - not at the unit selection screen. He wants the unit, upon reaching 5 kills, to be instantly killed and respawn at the same place with the next trooper up(rifleman to rocketeer, etc.), without affecting the sides reinforcements.
-
Marth8880
- Resistance Leader
- Posts: 5042
- Joined: Tue Feb 09, 2010 8:43 pm
- Projects :: DI2 + Psychosis
- xbox live or psn: Marth8880
- Location: Edinburgh, UK
- Contact:
Re: Unit Upgrading
I'm no coder, but from what I've read across the boards in the past, that doesn't sound entirely plausible.
-
THEWULFMAN
- Space Ranger
- Posts: 5557
- Joined: Tue Aug 17, 2010 3:30 pm
- Projects :: Evolved 2
- Location: Columbus, Ohio
- Contact:
Re: Unit Upgrading
lucasfart wrote:Correct me if I'm wrong, but he means instantly - not at the unit selection screen. He wants the unit, upon reaching 5 kills, to be instantly killed and respawn at the same place with the next trooper up(rifleman to rocketeer, etc.), without affecting the sides reinforcements.
This can't be done. Specifically this part. You can't do this online. Not without breaking the intended gameplay. I'm sure he wants a bunch of people who as they play get rewarded for playing well with better units instantaneously. It can't be done. Singleplayer? Somewhat, yes. You can kill and respawn someone (this would affect the reinforcement count) to update the class after editing the class with Lua.
The best way I know of to do this online is to have a bunch of unit classes, each better than the last and each requiring more points to be able to play it. Then just going to a CP to select it.
- Dakota
- Field Commander

- Posts: 991
- Joined: Mon Dec 06, 2010 8:21 pm
- Projects :: making random weapon assets
- xbox live or psn: PS3 beats xbox
- Location: at a computer desk floating around in space
Re: Unit Upgrading
ok then, i guess i'll just have the cp in a place where people can easily find it...
-
THEWULFMAN
- Space Ranger
- Posts: 5557
- Joined: Tue Aug 17, 2010 3:30 pm
- Projects :: Evolved 2
- Location: Columbus, Ohio
- Contact:
Re: Unit Upgrading
Dakota wrote:ok then, i guess i'll just have the cp in a place where people can easily find it...
If I may make a suggestion, why not make the CP the center of the map? Make it this large epic structure, one that no one will miss. It's impressive setup will make it instantly clear how important it is. Just a thought.
- Dakota
- Field Commander

- Posts: 991
- Joined: Mon Dec 06, 2010 8:21 pm
- Projects :: making random weapon assets
- xbox live or psn: PS3 beats xbox
- Location: at a computer desk floating around in space
Re: Unit Upgrading
its already in the center, i've set up cover around it too
i may make some mini bunkers on a few maps though.
i'm planning 4 arenas, a lava one, a forest/jungle one, ice one, and a desert one. i'm working on the lava one now, i call it "The Pit"
i may make some mini bunkers on a few maps though.
i'm planning 4 arenas, a lava one, a forest/jungle one, ice one, and a desert one. i'm working on the lava one now, i call it "The Pit"
-
CressAlbane
- Master Bounty Hunter

- Posts: 1519
- Joined: Fri Dec 18, 2009 8:02 am
- Projects :: CTF Arenas
- Location: ¿uoıʇɐɔoן ʎɯ sıɥʇ sı
Re: Unit Upgrading
Couldn't you just add reinforcements to the team that the player is on?THEWULFMAN wrote: You can kill and respawn someone (this would affect the reinforcement count) to update the class after editing the class with Lua.
- Dakota
- Field Commander

- Posts: 991
- Joined: Mon Dec 06, 2010 8:21 pm
- Projects :: making random weapon assets
- xbox live or psn: PS3 beats xbox
- Location: at a computer desk floating around in space
Re: Unit Upgrading
i thought about that, too, but then decided that it would get annoying when you kill a few units then you die and get a better unit, it would mess withCressAlbane wrote:Couldn't you just add reinforcements to the team that the player is on?THEWULFMAN wrote: You can kill and respawn someone (this would affect the reinforcement count) to update the class after editing the class with Lua.
i decided to go with the defend the bunker senario. there is 1 cp in the bunker or a cp behind some cover in a defendable location and you try to survive, yet there will always be the guys who run out into the field to attack <.<
(goes off to find a good version of xsi to make a fancy looking multistory bunker even though he knows ai don't like multi-story things but yet why would the ai go there if it is only a person or group of people defending it.)
