FC:Is it possible to add units to a map ingame? If so, how?
Moderator: Moderators
-
Eaol
- Major

- Posts: 510
- Joined: Fri Jul 31, 2009 5:49 pm
- Location: Everywhere.
FC:Is it possible to add units to a map ingame? If so, how?
Fake Console Question:
Is it possible to add units to a map ingame? If so, how?
Thank you in advance, regardless of the answer.
Is it possible to add units to a map ingame? If so, how?
Thank you in advance, regardless of the answer.
- 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: FC:Is it possible to add units to a map ingame? If so, how?
it is possible to load them in after a certain condition is met using the lua. Not sure if its possible while ingame using the Fake Console but you can do it in the middle of a campaign using
AddUnitClass(ALL, "all_inf_soldier",7,8)
It is set up like a unit with the last numbers setting min and max on field, the middle is your units name, and the start is the team, (REP, CIS, ALL, IMP normally)
AddUnitClass(ALL, "all_inf_soldier",7,8)
It is set up like a unit with the last numbers setting min and max on field, the middle is your units name, and the start is the team, (REP, CIS, ALL, IMP normally)
- Teancum
- Jedi Admin

- Posts: 11080
- Joined: Wed Sep 07, 2005 11:42 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Indiana
Re: FC:Is it possible to add units to a map ingame? If so, how?
They have to be loaded into memory already, but then you can use AddUnitClass() to make them selectable. I suppose you can try using ReadDataFileInGame(), to load new units into memory, but I don't think anyone has ever tried using that verb.
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: FC:Is it possible to add units to a map ingame? If so, how?
Are you asking to increase the unit counts or add new units to the teams? A FC command already exists for increasing the unit counts. For adding new units, just add them in the Code Console like you would in the lua mission script.
ReadDataFile() does work while the level is being played. However if you load something on a server, any connecting clients will crash if they don't also load it before the item is spawned.
ReadDataFile() does work while the level is being played. However if you load something on a server, any connecting clients will crash if they don't also load it before the item is spawned.
- Fierfek
- High General

- Posts: 805
- Joined: Wed Jul 01, 2009 4:38 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Somewhere in the Galaxy (Most Likely Scrapping Tinnies)
Re: FC:Is it possible to add units to a map ingame? If so, how?
Pretty much what they said. Someone asked this question some time last year:
forums/viewtopic.php?f=25&t=19337
I don't know if that will help or not.
forums/viewtopic.php?f=25&t=19337
I don't know if that will help or not.
-
myers73
- Lieutenant General

- Posts: 690
- Joined: Fri Apr 03, 2009 11:04 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Atlanta, GA xfire=myers73 IngameName=mYers
Re: FC:Is it possible to add units to a map ingame? If so, how?
im having trouble with this, Im pretty sure that you cant use ReadDataFile ingame because I tried loading a superbattledroid to IMP but failed
i used:
ReadDataFile("cis.lvl", "cis_inf_rifleman");AddUnitclass(IMP, "cis_inf_rifleman", 1, 2)
i used:
ReadDataFile("cis.lvl", "cis_inf_rifleman");AddUnitclass(IMP, "cis_inf_rifleman", 1, 2)
- Teancum
- Jedi Admin

- Posts: 11080
- Joined: Wed Sep 07, 2005 11:42 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Indiana
Re: FC:Is it possible to add units to a map ingame? If so, how?
I didn't know LUA actually used ; as a line terminator. I thought it was ignored. Did you try it with a space between the two verbs?
-
myers73
- Lieutenant General

- Posts: 690
- Joined: Fri Apr 03, 2009 11:04 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Atlanta, GA xfire=myers73 IngameName=mYers
Re: FC:Is it possible to add units to a map ingame? If so, how?
just tried that, doesnt work, maybe run the ReadDataFile then exit then run addunitclass
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: FC:Is it possible to add units to a map ingame? If so, how?
Try the code in the PostScriptLoad() function. If it doesn't work there, then it won't work in the Code Console.
-
myers73
- Lieutenant General

- Posts: 690
- Joined: Fri Apr 03, 2009 11:04 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Atlanta, GA xfire=myers73 IngameName=mYers
Re: FC:Is it possible to add units to a map ingame? If so, how?
yeah, ReadDataFile doesnt work in ScriptPostLoad
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: FC:Is it possible to add units to a map ingame? If so, how?
Try using ReadDataFileInGame(). I guess I was using ReadDataFile in ScriptInit and thinking it was in ScriptPostLoad...
The custom user scripts supported by v1.3 are loaded in ScriptInit (they are loaded by the ReadDataFile("ingame.lvl")) call. ReadDataFile will work in a custom user script, but unless you want it to run on every map, it is a bit more complicated than that.
The custom user scripts supported by v1.3 are loaded in ScriptInit (they are loaded by the ReadDataFile("ingame.lvl")) call. ReadDataFile will work in a custom user script, but unless you want it to run on every map, it is a bit more complicated than that.
