Non-modtools command equivalents?

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Non-modtools command equivalents?

Post by Teancum »

So I've come to the point that I really need some debug/cheat functions on the Xbox - having to test map after map gets monotonous and I need to set up some commands in a fake console. Some of these verbs I've never used, some things I want to do I have no idea if I can, and some I'm listing so I don't forget to do them. I'm looking for any possible help:
1. Show Framerate -- is there even a lua command that can do this? It'd be really helpful for locking down how maps run, particularly in split screen. I didn't see it referenced in a search of the forums, but it may still exist on the Xbox XBE.
2. Immediate Victory/Defeat -- I know there's MissionVictory() and MissionDefeat(), but what are the parameters? Just the team ID? I.E. MissionVictory(1)? Do I have to specify defeat for the other team?
3. Invincible -- I've got some ideas, but most of them involve SetProperty() or SetClassProperty(). What I want to do is divide invincibility or psuedo-invicibility (a la the SWBF1 heroes) based on whether they're human or not. That way I can have "Invincible - Humans", "Invincible - AI" and "Invincible - All"
4. Print Debug Output -- I was thinking sortof a hack. Basically this function would just print localization strings based on thing I specify in ScriptPostLoad(). So I may have a boolean I need to check, and I can set a localization string based on that in ScriptPostLoad()... or maybe several strings. If a condition is one way, I set the variable to one string, if it's something else, another string. PrintDebugOutput() would run through those strings, printing one by one until it's done. I'm looking for ideas on how to build that function. I know I could use an array of string I want it to print, then set those, but I'm far from comfortable with LUA, so the implementation is a little fuzzy.
5. Tag Humans -- This might be fairly simple. For multiplayer it would run a loop through all human players, putting the yellow CTF tag above them. This would be used to test for any lag issues, whether people get dropped using certain code, just finding your friends, etc.
6. Disable Offensive Force Powers -- Push/Pull/Choke/Saber Throw. Should be a matter of using SetProperty() to make the force power cost more energy than the player has, no? I would probably do one-off implementations of this, as some folks may want this or that power to still be active. I could maybe even do a "all Jedi have [x] and [y] powers" with SetProperty(), but I'd have to do that before any spawning. Or replace push/pull with boosts, etc.
7. DisableVehicles -- probably another FOR loop that looks for all vehicle spawns, then kills them off.
8. Unlimited Energy -- Probably something like the Invincible. Split by Humans/AI/Everyone, but with vehicles added.
9. Unlimited Ammo -- Split commands like Unlimited energy
10. Disable Effects -- I was planning on using IsEffectActive() for specific effects (like award weapons) and if they are SetEffectActive() to turn it off. It would have to some sort of infinite loop to turn it of any time an effect gets activated. That might end up being a little costly on the CPU, but I wouldn't think so - it's a very simple loop. I just get the name, set it to on or off based on the command, then move on to the next effect. Trouble is, I don't know how those verbs work.
11. Heros Can't Grab Flag -- another semi-simple one, using CanCharacterInteractWithFlag(). Haven't used this verb before either, but getting the hero and using them in that command seems easy enough if I can figure it out.
12. AI Can't Drive Vehicles -- really easy, ForceAIOutOfVehicles(0 or 1)
13. Humans Only -- easy, AllowAISpawn(false). But can I just have one parameter? The instances I have require teams to be specified.
14. Give [x] Bonus -- I would assume this is as simple as ActivateBonus(), but is it usable outside of Galactic Conquest, and what are the parameters?
15. Increase/Decrease reinforcements by 25 -- AddReinforcements(TEAM, 25), right? Could be used per team or for both
16. Disable/Enable Awards -- ScriptCB_SetPlayerAwardsEnabled(0 or 1)
17. Change Two Player Split Mode -- ScriptCB_SetHorizontalSplitScreen(0 or 1)
18. Enable Extra Vehicles -- Simple enough, add vehicle spawns to the physical maps (in ZeroEdit) with only ClassHISAtk and ClassHISDef properties set, then use SetHistorical(0 or 1). Might be fun to add extra vehicles into each map. Uber mode would have them by default, other modes would get them if this was enabled.
19. Classic Flying In Space -- SetGroundFlyerMap(0 or 1). Disables boosting and rolls
20. ... I'm sure there's others, but I can't think of any more. Ideas? I'm looking for both fun cheats and also useful debug stuff that I can build.


I have ideas on most of these, but if someone else has already done it and has code examples, it's a lot faster than rewriting it to the Xbox which has no debug logs.
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: Non-modtools command equivalents?

Post by lucasfart »

I don't know much about any of those things you've got idea's for but all the info about activatebonus is in the link:
http://www.gametoast.com/forums/viewtop ... 27&t=12015

it does work outside galactic conquest....on pc anyways but you can only have 1 per team and some don't work on multiplayer (these are all for pc and i'm not sure if its the same for xbox)
myers73
Lieutenant General
Lieutenant General
Posts: 690
Joined: Fri Apr 03, 2009 11:04 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Atlanta, GA xfire=myers73 IngameName=mYers

Re: Non-modtools command equivalents?

Post by myers73 »

for the disable force powers, just change the weapon to a fusion cutter or something using LUA
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Non-modtools command equivalents?

Post by [RDH]Zerted »

I'll get the source for what I have left of the v1.3 patch online within a week. It contains all the FakeConsole command code.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Non-modtools command equivalents?

Post by Teancum »

Awesome -- you're a lifesaver. :thumbs:
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Non-modtools command equivalents?

Post by [RDH]Zerted »

The little bit of recovered v1.3 source code is online at http://zerted.getmyip.com/swbf2.xhtml

I also put up the map for v1.3 r129. I'll be on Spring break starting in a few hours, so if the server goes down during the next week I won't be able to fix it until I get back.
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Non-modtools command equivalents?

Post by Fiodis »

I don't seem to be able to open xhtml files with my Firefox. Is it possible to upload it in another format?
Post Reply