Monday, April 23, 2012

[SC2] Built in Mod Manager?

Supreme Commander allows you to change from SupCom 2 to SupCom2 DLC1 right in the start screen. Can we tap into that?
I mean how do I add another option after DLC 1 to turn another DLC on?
Anyone looked into this?
Note: I realized if you are modding the original units you wouldn't want to use the same system as the DLC1, so this probably doesn't apply to us. :P
It would still be interesting code to investigate and might have some easter eggs.|||Bastilean|||I *think* the lobby chat functions are still done in Lua (the file that handles them is actually processed both at the main menu and when in game). If we can pass a list of mods to load then we could write a mod-support mod.
Problem is that I don't have anyone to test with, nor would I be willing to buy a second copy of the game.
[PS:] If you put mods into the Sim's __active_mods table as soon as SimInit.lua is run, you can still load mods. The trick is putting mods into that table from the Lobby - which is something the engine does.
IINM, we can read and write files in Sup2 now as well. My idea is that if the host's lobby can send a message to client lobbies, and have them write a list of mods to file, then we can read that file from the Sim when the game starts.|||Loading up multiplayer (not skirmish) while having Revamp installed gives a pop-up that says "mod_detected_warning". Multiplayer obviously still works so there is some kind of mod manager code actively floating around.
But the way mod support in general has been implemented (at least for GPG's purposes) is a bit weird. There are "mod" folders in each of bp.scd, lua.scd, z_dlc1.scd, z_lua_dlc1.scd (all populated with DLC1 stuff). But the Revamp mod has it's own Revamp_Expansion.scd as well, which seems to invoke the "mod_detected_warning".
liveordie: out of curiosity, have you tried to make Revamp follow the "mods" folder structure in the above scd's?|||The mod_detected_warning is nothing more than a mismatch between the *.scd files and the *.enc files.
It's not a mod manager per-say at all. Since the Sim blindly processes all mods that it's told to on blind faith that other Sims will do the same, it relies on the manager to vet what mods everyone has. I expect that if people have two different mods installed, the mod_detected_warning will fire, the game will launch then desync because the mods are different.|||BulletMagnet|||This is why my mod doesnt trigger mod_detected warning =)
BillGates checked for me if this could be done, but his conclusion was indeed that its impossbile/hardcoded.|||Yeah, the engine itself is what handles shadowing etc. You could make a mod folder, have it mounted, insert a mod_info.lua table for it into __active_mods at the beginning of SimInit, but ultimately the engine would ignore your shadow folder, and you wouldn't be able to do anything more than blueprint mods with it anyway.
I haven't looked at the remaining lobby code in depth, but there isn't much of it left, and I'm quite sure that it does not pass an __active_mods to the engine like the FA/Demigod lobbies did. In fact, the game no longer does RuleInit states in the lobby at all, waiting until launch to pre-load blueprints etc, so the only lua state you'd have access to in the lobby is a really limited, probably user-layer state that handles chat and such (as BulletMagnet pointed out).

[SC2] JTAG 360 modding!!

Yes, it's me again. well my iso modding didn't go so well,alot of crashing,freezes, and invisible units,lol.
well i had an old xenon, and jtaged it.now i will mod this game! any useful info would be much apreciated. Thanx. also,ill keep you guys posted on any findings.|||Considering that I'm confident in saying that I'm the only modder on here who has used a JTAG before, I feel that I'm justified in saying that you won't find much help from us.
You'll get a lot of interest from me however. This is something I want to see.|||Look at the blueprint merging thread I just posted, and start with that. You'll only need one .bp file in one folder (with an .scd extension) to start making changes.
Since I assume there's no DLC for the 360 version, put the .bp file inside a folder called e.g. gamedata\mymod.scd\units\, and that will let you make changes to any and all unit blueprints. No need to compress it into an .scd, just naming a folder with .scd is good enough.
Begin with a test change, like reducing the starting health of the UEF ACU, so you can jump right into a skirmish and make sure the file is being used.|||BulletMagnet|||You don't actually need to replace/copy any files to mod. It might help to have an extracted copy of uncompiled_lua.scd on your desktop for reference, but any unit and ability changes that don't require entirely new scripting can be done with a small added blueprint merge file.|||Mithy|||You probably don't need bp.scd because you can't read the files if the JTAG is anything like the PC.
I would start by picking one unit to modify. Go ahead and reply with that unit and I will tell you what I would do with the pc file. You can tell me us if it works.|||damusolja

[FA][SOLVED] MiddleMouse Detection?

Hi,
im trying to detect if the middle mouse button is pressed.. what would be the token for the middle mouse any one know?
i thought it was MBUTTON but its not..
thx :)|||I suggest looking at the template rotate mod, as this has the middle-mouse button as it's trigger.|||Hi,
LOL, yeah that had the answer... :)
Cool thx :)

[SC2][SOLVED] Conflict DLC Base + Shadow when using merge bp

Going over both the base files and shadow units i come across what i would think would be a conflict, Unit UCX0103 Bomb Bouncer has 2 bp files with in the DLC one in the base and one in the shadow with would be a mistake on GPG half.|||It's deeper than that:
- bp.scd/Units/Cybran also has UCX0103
- bp.scd/mods/DLC1/base/Units/Cybran also has UCX0103
- bp.scd/mods/DLC1/shadow/Units/Cybran also has UCX0103
- lua.scd/Units/Cybran also has UCX0103
- lua.scd/mods/DLC1/base/Units/Cybran also has UCX0103
BUT
- lua.scd/mods/DLC1/shadow/Units/Cybran does NOT have UCX0103|||madface|||It's likely an error in DLC.
But are you sure that "mods" is not read/used in bp.scd and lua.scd? The files in the "mods" folder in these scd's are not exactly identical between each other. For example, bp.scd/mods/DLC1/shadow/lua only has a directory for ai and nothing for common, sim, or ui as in lua.scd/mods/DLC1/shadow/lua.|||It might be an 'error', but it isn't really relevant to anything. The blueprint that is being used is the one that loads last, which would be /mods/DLC1/shadow/Units/Cybran/UCX0103/UCX0103_unit.bp.
The only difference between this one and the one within /base is the path to the mesh and walk animation.
The only difference between the one in /units and the two in /mods is the LifeBarOffset (increased so that it's higher), and the fact that it has SHIELD category. These two things were likely bugfixes done in the DLC. Why they weren't done to the copy in the base game, I do not know, but it doesn't much matter one way or another.

The script is not shadowed in /mods/DLC1, therefore the original within /units is the one being used. Again, non-relevant, because the scripts are identical.
Edit: The scripts are only identical in uncompiled_lua.scd. The compiled script in /mods/DLC1/base is different in size from the one in /units, although it's impossible to tell why since it's compiled. It still doesn't matter, because as I understand it, scripts for units in /mods/DLC1/base that already exist in /units are not going to be run, and the original in /units will be used unless it is directly shadowed.

Also, stop comparing bp.scd and lua.scd as though they're different versions of the same thing. bp.scd contains blueprints, while lua.scd contains lua scripts. Of course they have different paths, and of course both of them will be used.|||madface|||liveordie|||Mithy|||Actually, I tried creating a z_ -named scd to override files from lua.scd, and didn't have any luck at all, so I'm not really sure what determines the mount order. Like I've said in other threads, I have a sneaking suspicion that the game 'knows' about certain scd names when doing its file mounting and prefers files from those, because the only way to directly override files in lua.scd or z_lua_dlc1.scd is to put them straight inside those files.|||Mithy|||liveordie|||Mithy|||Maybe they're trying to discourage modding by making it as confusing and annoying as possible to work with game files.
Too bad there are ways around that. >_>|||Mithy

[SUPCOM 1-NEED HELP]Engineers Constructing Engineers

So I modified the code in engineers so that they have their current tech level of engineer in their build tab as well as the engineer of one tech level up.
Example: A T1 Engineer could build T1s and T2s of itself.
However, there is one problem. The game does not recognize them as structures, so I cannot do a "place and click" build order for them, as they are normally made in factories.
How do I get Sup Com 1 to recognize Engineers as buildings for dragging and dropping?
I think it is possible (In the Blackops: Unleashed mod, the UEF had a heavy assault T3 unit of some sort in the structures tab) But I also want Engineers to still have the ability to be produced at a factory.
(Oh, and by the way, I'm not technically making a mod, just rewriting some lines of code in a copy of the units.scd file, and then replacing the current units.scd with the modded one. Don't worry, original is backed up!)
EDIT:
Okay, I've figured it out.
I've put the attributes
'DRAGBUILD',
'NEEDMOBILEBUILD',
In my Engineers' codes. Now they can be built by engineers.
However, when I build them at a factory they act like structures!(Example: I have to "place" one right by the factory to get it to build one ) How
do I get the game to recognize them as a "normal build" when made at factories
and a
'DRAGBUILD',
'NEEDMOBILEBUILD',
when built by engineers?
Oh, and by the way, I just thought of something else:
What piece of code makes structures amphibious?
EDIT: Just had another question. Should I start new topics for new questions or continue in this topic?
Help would be appreciated,
Helios|||First things First, amke sure you post in teh correct forum, Moid Dev Support is for asking questions about the making of mods, while mod talk is for talking about Mods themselves.
Thread Moved.
Mike|||OrangeKnight|||CommanderHelios|||There is no way to make a unit both mobile-buildable and factory-buildable without the side effect of having to place them at the factory.
There is a workaround that involves making a completely new dummy unit that uses the same blueprint and mesh as the actual unit, and in its script's OnStopBeingBuilt, it creates one of the actual unit in its place, and destroys itself. The process appears more or less seamless, and factories still build the original unit (which doesn't have NEEDMOBILEBUILD), while engineers can build the dummy unit.
The dummy unit's categories would need to be adjusted so that NEEDMOBILEBUILD and DRAGBUILD are added, and BUILTBYTIER1/2/3FACTORY is removed and replaced by BUILTBYTIER1/2/3ENGINEER and/or BUILTBYTIER1/2/3COMMANDER as appropriate to make it buildable by engineers/ACUs.

Are you doing this as a merge mod, or just overwriting blueprints?|||Mithy|||CommanderHelios|||Mithy

[FA] FPS Weirdness

Hi,
ive noticed something weird regarding the games fps..
Try this..
start a skirmish with no mods..
press the numpad slash (/) to show the games FPS
now when the commander warps in.. my fps are at 40fps check yours.. (top left of screen)
i have disabled intel/militery range rings on selected units.. and only show them on mouseover.. set this.. important..
when these are set... zoom all the way into the commander.. note your FPS
now carefully use the mouse wheel to zoom out 7 clicks..
note your fps..
now hover your mouse over the commander..
when the range rings appear when the mouse hovers over the commander my FPS DOUBLE and shoot upto 80
ive tried this with split screen also.. the default double split..
the exact same thing happens.. with 2 splits..
now thats weird.. if anything the fps should go down.. NOT up..
anyone now why this is?|||That sounds pretty weird. I don't have an explanation- the range rings are notoriously inefficient.|||Hi,
It could be a fps disply bug, because i have since tested this with fraps..
when the com warps in my fps in fraps says 100fps, when i zoom move around ect..
it goes down to 90 or so for a second then back to 100..
when i do what i posted in the op, fraps says my fps is 85fps when the mouse is hovered over the com showing range rings..
this is prolly a better indication of what is going on.. using fraps..
its a pity we dont have someone to recode the shaders for the range rings..
so that they are NOT so graphicly intensive.. using only a single pass..
why they didnt do those better is beyond beleif.. :/|||We there is that issue and...
Problems with the intel.
Problems with the AI.
Problems with the UI.
Problems with the SIM.

In many respects, it seams as if the folks at GPG aimed very high but were cut off or instructed to wrap things up to box up a finished product. Despite this FA ended u[ being a far better game then SC or SC2.
Resin|||Except that SC2's engine doesn't actually have any of the problem's that FA's does, other than sim speed slowdown with ultra-colossal numbers of objects being simulated.
Cloaking, target tracking, pathfinding, AI, range ring rendering, and UI hitches are all fixed or much better in SC2, and it has a reasonably higher threshold for sim complexity, AND runs better on older systems. I too would like a mod manager, but to say that the game isn't massively improved on a really basic level is misguided at best.

Domino, I would guess that the in-game frame counter is showing something weird like UI update rate, and not actual render framerate. Why showing a range ring would affect that, I do not know, but it would explain the huge gap between in-game and FRAPS.|||Beta 3603 patch also shows some changes related to FPS being shown..If you have a chance, you can check that out too..My rig is not good enuff to help you test :(|||Hi,
Thx for the comments guys :) it is prolly a ui bug, so ill take it as busted :/

this is off topic.. but..
i reckon i could get the mod man working in sc2 i mean the modman ui showing like in fa, to what end i do not know.. as far as i know hooking dont work.. so loading a mod would be a futile attemp no?
i reckon i could get the mod man working and showing in game within a week.
but if the mods arent actually loaded.. or are not possible to be loaded there is no point wasting my time doing it is there?|||Have you actually looked in depth at the SC2 UI? Most of it isn't exactly accessible.
Hooking shouldn't be a problem, I found a workaround for that that just needs some multiplayer issues ironed out. But passing a list of mods to the sim is a problem, since it's the engine or compiled UI/lobby code doing that. Even if you can get a makeshift UI going in the lobby state, how would you pass the list of mods to the sim and/or UI?
Even if you edit simInit.lua and stuff mod tables into __active_mods, that doesn't make the engine do anything with those mods. It would let e.g. my hooking script iterate __active_mods and look for hooks, but getting that information into the sim except via an external mod manager is basically impossible. And I can already use some kind of makeshift mod_info.lua system to set up fake mod folders anyway.|||Hi,
i briefly looked,
thats what i meant.. getting the modman to show could be done.. but then what happens after that is exactly what im talking about..
Domino

[SC2] Assisted Building

I think assisted building might actually be possible to implement. Using All Factions mod, you can successfully have all 3 ACUs simultaneously target structures to assist in building. There is also a noticeable change in building rates when done so. I'm thinking that this should also be possible to implement with engineers.
But I'm not sure if this is an on/off feature or if it's possible to define per structure how many assisted builders are permissible. I would really like to be able to set how many builders can assist via a function, ex., something like a/(a+b) so that as b increases the added contribution of assisting builders approaches 0, i.e., to avoid infinite build assistance. 'a' would be unique to each structure/unit.|||Currently the assistance is 1, 1/3, 1/9, etc. At least that is what I have been told by a GPG member, and I have no reason to doubt it. Any assistance past the first is highly unnoticeable.
I am surprised you saw a noticeable affect from the 2nd and third ACU. Maybe the system is more complicated than we were lead to believe.|||Assist building isn't possible but assisting factory's when there building has always been there.|||If ACUs can assist each others' building, then it is possible, but it might have significant side effects. But it's probably not possible to change the diminishing returns.