Playable jedi hero

Started by MatyTheWolf, November 05, 2017, 11:41:14 PM

Previous topic - Next topic
Yeah, this section:
SetTeamName(REP, "Republic");
    SetTeamIcon(REP, "rep_icon");
    AddUnitClass(REP, "rep_inf_clone_trooper",11)
    AddUnitClass(REP, "rep_inf_macewindu",0)     --was:  AddUnitClass(REP, "rep_inf_arc_trooper",3)
    AddUnitClass(REP, "rep_inf_clone_pilot",4)
    AddUnitClass(REP, "rep_inf_clone_sharpshooter",4)
    AddUnitClass(REP, "rep_inf_jet_trooper",3)
    SetHeroClass(REP, "rep_inf_macewindu")
    SetAttackingTeam(ATT);

--  CIS Stats
    SetTeamName(CIS, "CIS");
    SetTeamIcon(CIS, "cis_icon");
    AddUnitClass(CIS, "cis_inf_battledroid",11)
   AddUnitClass(CIS, "cis_inf_countdooku",0) --was AddUnitClass(CIS, "cis_inf_assault",3)
    AddUnitClass(CIS, "cis_inf_pilotdroid",4)
    AddUnitClass(CIS, "cis_inf_assassindroid",4)
    AddUnitClass(CIS, "cis_inf_droideka",3)
    SetHeroClass(CIS, "cis_inf_countdooku")

--  Attacker Stats
   SetUnitCount(ATT, 22)  --note was 25, decrease by 3 because 3 was in the replaced line
    SetReinforcementCount(ATT, 200)
    AddBleedThreshold(ATT, 31, 0.0)
    AddBleedThreshold(ATT, 21, 0.75)
    AddBleedThreshold(ATT, 11, 2.25)
    AddBleedThreshold(ATT, 1, 3.0)

--  Defender Stats
    SetUnitCount(DEF, 22) --note was 25, decrease by 3 because 3 was in the replaced line
    SetReinforcementCount(DEF, 200)
    AddBleedThreshold(DEF, 31, 0.0)
    AddBleedThreshold(DEF, 21, 0.75)
    AddBleedThreshold(DEF, 11, 2.25)
    AddBleedThreshold(DEF, 1, 3.0)


Quote from: Abraham Lincoln. on November 04, 1971, 12:34:40 PM
Don't believe everything you read on the internet

Quote from: Led on November 16, 2017, 06:41:33 PM
Yeah, this section:
SetTeamName(REP, "Republic");
    SetTeamIcon(REP, "rep_icon");
    AddUnitClass(REP, "rep_inf_clone_trooper",11)
    AddUnitClass(REP, "rep_inf_macewindu",0)     --was:  AddUnitClass(REP, "rep_inf_arc_trooper",3)
    AddUnitClass(REP, "rep_inf_clone_pilot",4)
    AddUnitClass(REP, "rep_inf_clone_sharpshooter",4)
    AddUnitClass(REP, "rep_inf_jet_trooper",3)
    SetHeroClass(REP, "rep_inf_macewindu")
    SetAttackingTeam(ATT);

--  CIS Stats
    SetTeamName(CIS, "CIS");
    SetTeamIcon(CIS, "cis_icon");
    AddUnitClass(CIS, "cis_inf_battledroid",11)
   AddUnitClass(CIS, "cis_inf_countdooku",0) --was AddUnitClass(CIS, "cis_inf_assault",3)
    AddUnitClass(CIS, "cis_inf_pilotdroid",4)
    AddUnitClass(CIS, "cis_inf_assassindroid",4)
    AddUnitClass(CIS, "cis_inf_droideka",3)
    SetHeroClass(CIS, "cis_inf_countdooku")

--  Attacker Stats
   SetUnitCount(ATT, 22)  --note was 25, decrease by 3 because 3 was in the replaced line
    SetReinforcementCount(ATT, 200)
    AddBleedThreshold(ATT, 31, 0.0)
    AddBleedThreshold(ATT, 21, 0.75)
    AddBleedThreshold(ATT, 11, 2.25)
    AddBleedThreshold(ATT, 1, 3.0)

--  Defender Stats
    SetUnitCount(DEF, 22) --note was 25, decrease by 3 because 3 was in the replaced line
    SetReinforcementCount(DEF, 200)
    AddBleedThreshold(DEF, 31, 0.0)
    AddBleedThreshold(DEF, 21, 0.75)
    AddBleedThreshold(DEF, 11, 2.25)
    AddBleedThreshold(DEF, 1, 3.0)

Ah, alright, now I know what I have to edit to play the jedi in the clone wars era. What do I have to do so I can play Luke or Vader on the different maps? If you can tell me this one last thing I think I might be able to edit the files the right way :P

Do the equivalent in the other era.  You will get the hang of it.

I suggest you make a change or two, make the new mission, try it, make more changes, etc.

Also, keep backups of  the original scripts, and backups of any mods that you like.

If you get a cool mod that you want to share, you can upload it to our downloads area :cheers:
Quote from: Abraham Lincoln. on November 04, 1971, 12:34:40 PM
Don't believe everything you read on the internet

Quote from: Led on November 16, 2017, 08:09:57 PM
Do the equivalent in the other era.  You will get the hang of it.

I suggest you make a change or two, make the new mission, try it, make more changes, etc.

Also, keep backups of  the original scripts, and backups of any mods that you like.

If you get a cool mod that you want to share, you can upload it to our downloads area :cheers:
Yep, I will experiment around with some of the numbers, too bad english isn't my first language.
About the 'other era' thing. In order to also unlock the other era's jedi, I have to simply copy and paste the rebel/empire stats into the file if the map? It's that easy? :D

November 17, 2017, 05:23:57 AM #19 Last Edit: November 17, 2017, 05:25:29 AM by Dark_Phantom
I don't have my modding files with me, but to get the jedi from other eras (say Mace Windu in GCW), then you must add this above the code Led gave you (with the other chunks that say "readdatafile".
Code (lua) Select
ReadDataFile("SIDE\\rep.lvl",
"rep_inf_macewindu");

Then you can swap Mace Windu (rep_inf_macewindu) for one of the other units.
This can be easily replicated with Count Dooku as well.  I don't think they have any unique sounds so that should be adequate.
The BOBclan:  A Rich History


Quote from: Unit 33 on November 29, 2014, 03:44:44 AM
'Please, tell me more about the logistics of the design of laser swords being wielded by space wizards' - Some guy on the internet.

Quote from: Dark_Phantom on November 17, 2017, 05:23:57 AM
I don't have my modding files with me, but to get the jedi from other eras (say Mace Windu in GCW), then you must add this above the code Led gave you (with the other chunks that say "readdatafile".
Code (lua) Select
ReadDataFile("SIDE\\rep.lvl",
"rep_inf_macewindu");

Then you can swap Mace Windu (rep_inf_macewindu) for one of the other units.
This can be easily replicated with Count Dooku as well.  I don't think they have any unique sounds so that should be adequate.

I don't think he was meaning cross-era, just how to play Vader in the GCW. 

But, once we get him to learn mission LUA, many things are possible :)
Quote from: Abraham Lincoln. on November 04, 1971, 12:34:40 PM
Don't believe everything you read on the internet

Oops, my bad.  Oh well, it's good to know.
In GCW, it should be just swapping out "AddUnitClass(IMP,imp_inf_dark_trooper,3)" with imp_inf_darth_vader.  Same goes for Luke Skywalker.
Happy mission modding!
The BOBclan:  A Rich History


Quote from: Unit 33 on November 29, 2014, 03:44:44 AM
'Please, tell me more about the logistics of the design of laser swords being wielded by space wizards' - Some guy on the internet.

I got targeted by the AI as soon as I turned Instant Action Heroes ON. Thing is, two jedi spawned; one for each team. Do you guys think there's a way to keep the jedi from spawning? Or at least the one that's on the same team as me :D

November 17, 2017, 11:58:12 AM #23 Last Edit: November 17, 2017, 12:00:02 PM by Led
Quote from: MatyTheWolf on November 17, 2017, 11:45:29 AM
I got targeted by the AI as soon as I turned Instant Action Heroes ON. Thing is, two jedi spawned; one for each team. Do you guys think there's a way to keep the jedi from spawning? Or at least the one that's on the same team as me :D

You can set the hero class as another unit (like sniper) or you can try to just delete that hero class line.

The hero class is just an unplayable AI line that only spawns one unit.  I can be anything (defined in that era).

This line
SetHeroClass(REP, "rep_inf_macewindu")

is the hero class line.

change it to
SetHeroClass(REP, "rep_inf_clone_trooper")
Quote from: Abraham Lincoln. on November 04, 1971, 12:34:40 PM
Don't believe everything you read on the internet

November 17, 2017, 03:57:15 PM #24 Last Edit: November 17, 2017, 04:00:07 PM by MatyTheWolf
Quote from: Led on November 17, 2017, 11:58:12 AM
You can set the hero class as another unit (like sniper) or you can try to just delete that hero class line.

The hero class is just an unplayable AI line that only spawns one unit.  I can be anything (defined in that era).

This line
SetHeroClass(REP, "rep_inf_macewindu")

is the hero class line.

change it to
SetHeroClass(REP, "rep_inf_clone_trooper")

If I change the hero class to a normal trooper unit like the guy with the rocket launcher, do I also have to edit the number in SetUnitCount?

Also, is there a way to make the Tusken guys on the vanilla Tatooine map playable? I thought it might be possible as there are mods for the Tusken on custom maps but I only play on the vanilla ones.

Quote from: MatyTheWolf on November 17, 2017, 03:57:15 PM


If I change the hero class to a normal trooper unit like the guy with the rocket launcher, do I also have to edit the number in SetUnitCount?

Also, is there a way to make the Tusken guys on the vanilla Tatooine map playable? I thought it might be possible as there are mods for the Tusken on custom maps but I only play on the vanilla ones.

You do not need to edit SetUnitCount for the hero, since only one will spawn.  The hero can be any unit.


And yes, on Tatooine, you can play as a Tusken--just edit the mission LUA to put a tusken in one of the selectable slots (like instead of sniper or something).

One you get good with mission LUA, we can show you how to do side modding and make your own units and maps  :cheers:

Quote from: Abraham Lincoln. on November 04, 1971, 12:34:40 PM
Don't believe everything you read on the internet

November 17, 2017, 09:33:40 PM #26 Last Edit: November 19, 2017, 11:36:06 PM by MatyTheWolf
Quote from: Led on November 17, 2017, 08:18:25 PM
You do not need to edit SetUnitCount for the hero, since only one will spawn.  The hero can be any unit.


And yes, on Tatooine, you can play as a Tusken--just edit the mission LUA to put a tusken in one of the selectable slots (like instead of sniper or something).

One you get good with mission LUA, we can show you how to do side modding and make your own units and maps  :cheers:

Awesome pawsome! I meant if it's possible to play the team Tusken on the vanilla Tatooine map so I can help the Tusken to win the battle :D Not only one Tusken. There's a mod that allows you to play the Naboo Royal Guard on Theed, normally you have to play CIS, so I thought it might be easy for you to tell me what I have to do in order to make the team 'Tusken' playable and spawn at their command posts and such :)

Edit: I've edited the lua files and can now play as a jedi on any map, in any era. Only one problem: For the AI to target me normally, I have to put a jedi in SetHeroClass which spawns one additional jedi besides myself. Is there any way to freeze or keep that additional jedi from spawning? That's the only thing I can't figure out for now. :P