Quickly threw those lines into a conquest lua, didn't change anything and got a non CTD sev 3 error about trying to call and gobal setting or something, trying to go by memmory, did do some other looking, would those lines work in the conquest lua in the scripts directory (not the mode scripts but the other ones)Teancum wrote:Been doing more research as to how team colors get set. I found something in ifs_freeform_main.lua in assets/shell that tipped me off. Now I'm just trying to get it to work on a per-game basis
TSTc_con.lua:Does it look like I'm referencing anything weird?Hidden/Spoiler:
Custom Command Posts (FAQ)
Moderator: Moderators
-
- Gametoast Staff
- Posts: 2244
- Joined: Sat May 13, 2006 12:34 am
- Projects :: Not sure keep changing my mind.
- xbox live or psn: No gamertag set
- Location: Origin name GT_FragMe
- Contact:
Re: Custom Command Posts
- Maveritchell
- Jedi Admin
- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
Re: Custom Command Posts
I did some looking last night too, and I'm not sure that "teamColor" has any meaning as far as conquest goes. Inferring from the freeform scripts it came in, that color corresponds to menu screens and not ingame anything.FragMe! wrote:Quickly threw those lines into a conquest lua, didn't change anything and got a non CTD sev 3 error about trying to call and gobal setting or something, trying to go by memmory, did do some other looking, would those lines work in the conquest lua in the scripts directory (not the mode scripts but the other ones)Teancum wrote:Been doing more research as to how team colors get set. I found something in ifs_freeform_main.lua in assets/shell that tipped me off. Now I'm just trying to get it to work on a per-game basis
TSTc_con.lua:Does it look like I'm referencing anything weird?Hidden/Spoiler:
- 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: Custom Command Posts
True, but teamColor is defined in the exe, and it drives all of the HUD colors in the .hud files, so it's definitely something that gets used. I only found one instance of teamColor in the exe, so unless there's a weird array hidden somewhere in there then the colors are defined elsewhere. I scoured all resource files with a hex editor trying to find references of it, but only found it in the shell, that's why I'm trying to override it in LUA (I realize that it's probably not called anywhere and thusly it says "precomputed colors" in the LUA).
Oh, and I realized that I should have used this instead of self. Figured that out later on.
I know I can dynamically change the CP color via the gametype_conquest lua, but it's sortof superfluous if we can't actually specify whole team colors. It would only be good for non-aligned locals (like Tuskens on Tatooine).
Oh, and I realized that I should have used this instead of self. Figured that out later on.
I know I can dynamically change the CP color via the gametype_conquest lua, but it's sortof superfluous if we can't actually specify whole team colors. It would only be good for non-aligned locals (like Tuskens on Tatooine).
-
- Second Lance Corporal
- Posts: 117
- Joined: Sat Nov 22, 2008 5:43 pm
- Projects :: Something old
- xbox live or psn: No gamertag set
- Location: Finland
Re: Custom Command Posts
Tryed this code:
But I got an munge error that said something about unexpected symbols near '=' at this line:
Hidden/Spoiler:
Hidden/Spoiler:
- Fiodis
- Master of the Force
- Posts: 4145
- Joined: Wed Nov 12, 2008 9:27 pm
- Projects :: Rannoch + Tientia + Tools Programming
Re: Custom Command Posts
Maybe you spelt "function" with a "k"?
-
- Second Lance Corporal
- Posts: 117
- Joined: Sat Nov 22, 2008 5:43 pm
- Projects :: Something old
- xbox live or psn: No gamertag set
- Location: Finland
Re: Custom Command Posts
Hmm, I just copied it from another .lua but I'll try it out.
EDIT: It still gives me this error:
EDIT: It still gives me this error:
Hidden/Spoiler:
- Fiodis
- Master of the Force
- Posts: 4145
- Joined: Wed Nov 12, 2008 9:27 pm
- Projects :: Rannoch + Tientia + Tools Programming
Re: Custom Command Posts
Well, from what I know about error logs, the "46" is the line of the LUA with the problem. Counting the code you showed us, I see 25 lines.
-
- Second Lance Corporal
- Posts: 117
- Joined: Sat Nov 22, 2008 5:43 pm
- Projects :: Something old
- xbox live or psn: No gamertag set
- Location: Finland
Re: Custom Command Posts
Hidden/Spoiler:
- 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: Custom Command Posts
Open it in Notepad, hit CTRL + G, then type 46 to go to line 46.
-
- Second Lance Corporal
- Posts: 117
- Joined: Sat Nov 22, 2008 5:43 pm
- Projects :: Something old
- xbox live or psn: No gamertag set
- Location: Finland
Re: Custom Command Posts
Well, it is this line: GetTeamColor = function(this, team)
- 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: Custom Command Posts
I'm pretty sure that's because team is undefined. You haven't told it what team is. But I'm not 100% sure on that since I'm not really clear on how LUA declares everything.
- [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: Custom Command Posts
Basically you are doing MyVariable = 4, 5 which isn't valid syntax. Should MyVariable have the value four or five? You do use commas in the event callbacks because those are really parameters to a function: EventFunction(ResultFunction, FilterString).Yodakid wrote:Hidden/Spoiler:
If you don't understand what I'm saying, just remove the red comma.
I'm sorry I'm not helping you guys out on this. I only have Ubuntu on my laptop and haven't been able to get swbf2 running on it yet. If I ever get it working under linux, I'll get back to modding. I don't know what you guys expect to do by just creating tables with values in them. You still have to tell the game to do something with your teamColor tables. If you expected the game to call some type of InitTeamColor() function like it calls ScriptPostLoad() (I don't think it does so, but I don't know for sure), then at the very least you have to move them outside of ScriptPostLoad().
You can try using IFObj_fnSetColor() or ScriptCB_IFObj_SetColor(), but CPs aren't directly IFObjs. You will need to access the .cp part of the CP object.
- 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: Custom Command Posts
Changing the CP color is easy in gametype_conquest -- it's all of the other colors that's the problem. That's why we need to directly access the teamColor global variable.
- [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: Custom Command Posts
I am saying that there is no such thing, at least from a Lua stand point. The FakeConsole's Print Nested Globals command prints out every global variable and its value. It doesn't show a color table, only the ScriptCB functions the game uses to get the colors for the stat screens and the like.Teancum wrote:...we need to directly access the teamColor global variable.
Has anyone tried ODF values such as?:
Color = "255 100 50 alliance"
- 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: Custom Command Posts
Well, it's there, I don't know what to tell you. It's referenced in the exe, in the Galactic Conquest luas, and the HUD files reference teamColor repeatedly. It's there, and it's used many times. All I'm trying to find out is if we can re-reference it from the exe to override the defaults.
-
- Second Lance Corporal
- Posts: 117
- Joined: Sat Nov 22, 2008 5:43 pm
- Projects :: Something old
- xbox live or psn: No gamertag set
- Location: Finland
Re: Custom Command Posts
Hmm, tryed a few codes and now I got this:
Witch causes a CTD.
Hidden/Spoiler:
- 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: Custom Command Posts
What does your LUA look like?
-
- Second Lance Corporal
- Posts: 117
- Joined: Sat Nov 22, 2008 5:43 pm
- Projects :: Something old
- xbox live or psn: No gamertag set
- Location: Finland
Re: Custom Command Posts
Hidden/Spoiler:
- [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: Custom Command Posts
You can't just put game function outside of ScriptPostLoad() or ScriptInit() like that. Those SetTeamColor() functions are being run as soon as the game loads the map script and the map script seems to be one of the first things to be loaded. SetTeamColor() doesn't exist at that point in the loading stage.
- Frisbeetarian
- Jedi
- Posts: 1233
- Joined: Wed Sep 12, 2007 3:13 pm
Re: Custom Command Posts
Up until now, we've just talked about the color of the holo for the command post. I can't imagine that changing the holo ODF would change color of the take over icons that appear under the mini map, so how would we change this? Would having access to, and then changing the teamColor variable change these colors? I figure no one really knows; I'm really just throwing this out there as something into which we should look.