Making heroes earnable/unlockable [Solved]
Moderator: Moderators
-
- Sith
- Posts: 1433
- Joined: Thu Jan 23, 2014 6:01 am
- Projects :: Star Wars - Battlefront III Legacy
- xbox live or psn: El_Fabricio#
- Location: Right behind you :)
Making heroes earnable/unlockable [Solved]
Hey all,
my currently problem is simple but for me..it`s not.
I want to make a hero earnable. Then a player earns points to unlock him then the hero can not be played. It shows up: There are to many units.." But he is only playable for the player, not by the bots.
I had this problem on a few other maps but I never got it solved. I guess there`s a line that says: LockableforthisUnit = 1....But I'm not sure, because I can't find a line similar to this one.
If anyone can help me I`d be very thankful.
my currently problem is simple but for me..it`s not.
I want to make a hero earnable. Then a player earns points to unlock him then the hero can not be played. It shows up: There are to many units.." But he is only playable for the player, not by the bots.
I had this problem on a few other maps but I never got it solved. I guess there`s a line that says: LockableforthisUnit = 1....But I'm not sure, because I can't find a line similar to this one.
If anyone can help me I`d be very thankful.
Last edited by thelegend on Fri Sep 26, 2014 12:47 pm, edited 1 time in total.
-
- Chief Warrant Officer
- Posts: 348
- Joined: Fri Jun 06, 2014 6:58 am
- Projects :: SWBF2 Sides Overhaul Mod
- xbox live or psn: No gamertag set
- Location: Senlis, France
Re: Making heroes earnable/unlockable
Maybe "Point to Unlock" ?
Here is an ODF for this kinf of unit, maybe that can helped:
Here is an ODF for this kinf of unit, maybe that can helped:
Hidden/Spoiler:
-
- Sith
- Posts: 1433
- Joined: Thu Jan 23, 2014 6:01 am
- Projects :: Star Wars - Battlefront III Legacy
- xbox live or psn: El_Fabricio#
- Location: Right behind you :)
Re: Making heroes earnable/unlockable
Ah..I forgot to write I actually use this line "PointstoUnlock". It works for all default units, but not for heroes. And that's my problem. But thank you for help.
-
- Chief Warrant Officer
- Posts: 348
- Joined: Fri Jun 06, 2014 6:58 am
- Projects :: SWBF2 Sides Overhaul Mod
- xbox live or psn: No gamertag set
- Location: Senlis, France
Re: Making heroes earnable/unlockable
Maybe, make heroes not appears as a hero, but as a special unit (like the dark trooper) ?
-
- Sith
- Posts: 1433
- Joined: Thu Jan 23, 2014 6:01 am
- Projects :: Star Wars - Battlefront III Legacy
- xbox live or psn: El_Fabricio#
- Location: Right behind you :)
Re: Making heroes earnable/unlockable
Hm..they are actually normal units. I want to make them exactly like in Suun Rar: Desert City there you can earn a jedi and only the palyer can play as him. That's what I mean.
-
- Command Sergeant Major
- Posts: 260
- Joined: Mon Apr 18, 2011 2:53 pm
- Projects :: Underground City The Complex [WIP]
Re: Making heroes earnable/unlockable
I'm bit a confused by your question, if you could elaborate it a bit more, I'd be grateful.
So - if I understood it well - there is an error message showing up beginning with: There is too many units..., or sth like that?
Also, you can add heroes to the normal unit setup, just as you would a unit (like in place of the 'special' class or something), but maybe you have to change their ClassParents.
So - if I understood it well - there is an error message showing up beginning with: There is too many units..., or sth like that?
Also, you can add heroes to the normal unit setup, just as you would a unit (like in place of the 'special' class or something), but maybe you have to change their ClassParents.
-
- Sith
- Posts: 1433
- Joined: Thu Jan 23, 2014 6:01 am
- Projects :: Star Wars - Battlefront III Legacy
- xbox live or psn: El_Fabricio#
- Location: Right behind you :)
Re: Making heroes earnable/unlockable
Hm..ok. I will describe that more detailed.
I have a hero. He only should be playable for the players, not by the bots. But I want him unlockable. So yo have to earn points to get him, but...then I can select my unit ingame it shows up, below my unit (Who is now completly black): "To many units already exist"
Here an example .odf of my captain rex and also my map.lua file if it helps:
Odf(Default):
And my .lua file:
I did put out the Sound section or it would be a bit too long.
Edit: I am calling him "rep_rex". His name was "rep_hero_rex" but It did not work.
I have a hero. He only should be playable for the players, not by the bots. But I want him unlockable. So yo have to earn points to get him, but...then I can select my unit ingame it shows up, below my unit (Who is now completly black): "To many units already exist"
Here an example .odf of my captain rex and also my map.lua file if it helps:
Odf(Default):
Hidden/Spoiler:
Hidden/Spoiler:
Edit: I am calling him "rep_rex". His name was "rep_hero_rex" but It did not work.
-
- Command Sergeant Major
- Posts: 260
- Joined: Mon Apr 18, 2011 2:53 pm
- Projects :: Underground City The Complex [WIP]
Re: Making heroes earnable/unlockable
Oh, ok. Now I understand. Well, to be honest I don't think you can do that directly by a command. What you can do is to change the hero lines e.g:
hero1 = { "rep_hero_anakin",0, 0}, to hero1 = { "rep_hero_anakin",0, 1}.
But then the AI will spawn as them. So you should check through LUA when somebody spawns as one of them, and if it's an AI kill it, and add 1 reinforcement to the team to 'pretend' it didn't happen.
The following code may not be working, cause I'm not good at LUA.
This is quite a complicated workaround, but this is what I can think about for now. I'll keep searching.
hero1 = { "rep_hero_anakin",0, 0}, to hero1 = { "rep_hero_anakin",0, 1}.
But then the AI will spawn as them. So you should check through LUA when somebody spawns as one of them, and if it's an AI kill it, and add 1 reinforcement to the team to 'pretend' it didn't happen.
The following code may not be working, cause I'm not good at LUA.
Code: Select all
OnCharacterSpawn( function(character)
if GetCharacterUnit(character == "rep_hero_anakin" and IsCharacterHuman(character) == false then
KillObject(character) and AddReinforcements(1, 1)
end
-
- Master Sergeant
- Posts: 166
- Joined: Sun Mar 31, 2013 2:56 pm
- Projects :: Cato Neimoidia- Invasion
- xbox live or psn: No gamertag set
Re: Making heroes earnable/unlockable
In Suun Ra all i did was put this line in the properties section of the odf:
And then in the team setup part where you specify how many of each unit i just put this:PointsToUnlock = "80"
So only one unit can play as that character at a time. It doesnt bar the AI from taking up that slot though, so i cant help you there. And in my experience you never see that character being played when you're on the same team as the character. only when you're the opposing team. Life for example when you play as the republic you never see Quinlan Vos spawn as AI, but if you played as the CIS you would most likely see him being played by AI.special = { "cis_hero_whatever",1, 1},
-
- Sith
- Posts: 1433
- Joined: Thu Jan 23, 2014 6:01 am
- Projects :: Star Wars - Battlefront III Legacy
- xbox live or psn: El_Fabricio#
- Location: Right behind you :)
Re: Making heroes earnable/unlockable
Hm..well. That also would be nice if my enemy plays as a hero. I will try that.
- AnthonyBF2
- Sith
- Posts: 1255
- Joined: Wed Aug 21, 2013 3:55 pm
- Projects :: PS2+PSP Overhaul
Re: Making heroes earnable/unlockable
From my take, you want the human to access this unit, but not the ai units.
AddUnitClass(CIS, "your character's odf name here")
-put your team of course
This I think allows the human to select it, but you are not defining a min/max for ai units.
AddUnitClass(CIS, "your character's odf name here")
-put your team of course
This I think allows the human to select it, but you are not defining a min/max for ai units.
-
- Sith
- Posts: 1433
- Joined: Thu Jan 23, 2014 6:01 am
- Projects :: Star Wars - Battlefront III Legacy
- xbox live or psn: El_Fabricio#
- Location: Right behind you :)
Re: Making heroes earnable/unlockable [Solved]
Ah thank you so much JazzMaster. I did make the changes you told me and now it works. Thank you.