• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Need Info] SC2 Demo Mod Questions

Status
Not open for further replies.
Level 1
Joined
Sep 30, 2013
Messages
3
Let me start by saying that I do not own SC2 currently. I am looking to create a demo for some custom hardware, and I need to know if SC2 would be a suitable platform for that demo. There are three problems that I believe I may encounter with SC2, which I would like to figure out before making any purchases and requests.


The first question: is it possible to have a custom overlay appear over the generic UI. Best example I can give:
- Toggling caps lock toggles whether the overlay is present.
- The overlay is slightly transparent and covers the portion of the UI to the right of the minimap.
- The overlay will update visually in real time information that pertains to the user's input (such as detailed information about all units that are hot keyed)


The second question: is it possible to script the UI in such a way that it changes what units you have selected. For example, if a stream of reinforcements are way pointed and en route to the center of the map where the rest of the army is, can it be scripted that when boxing around the main army, the UI automatically adds to the selection the reinforcements that are en route to any location within that box.


The third and most difficult question: is it possible to mod StarCraft II to recognize new "buttons", such as unidentified keys on a keyboard. The following conditions are known:
- SC2 would need to accept data with a range of 256 (the inputs are not all digital [0 or 1]).
- The buttons (data) may (probably) will not be listed under Window's defined keys.
- SC2 would require some kind of script to interpret what to do with the data.
- SC2 needs to read the data several times a second.

I cannot give too many details as nothing is set in stone as to how it must work, but one possible method is StarCraft II obtaining values directly from the PC's ram.

The only examples of mods possibly doing similar things are mods that have global scoreboards or local settings. This is similar to extracting data from a text file, but that file is constantly being updated by another program and has to be read by SC2 several times a second.

If anyone has some answers regarding these questions (especially #3), that will determine if SC2 modding can handle the necessary conditions for the demo. That said, if anyone is interested in possibly helping with the creation of this mod, if it is possible, send me a PM for more specific details.
 
Level 9
Joined
Dec 21, 2006
Messages
490
you can do a completely custom ui with dialogs. if it is singleplayer you can even track the position of the mouse elsewise it produces too much nettraffic.

to your third question - that won't be easy but i think i have read that you can read in a bankfile as often as you want. so you could use this xml-file to give data to sc2. BUT you would need a program to write in the XML file in the first place.
 
Level 1
Joined
Sep 30, 2013
Messages
3
Thanks for the suggestion. I'm open to others, but I've done some research on the XML possibility.

It may take some effort, but the hardware is capable of writing XML files. However, my hardware won't be able to write the XML as SCII reads it, unless I am mistaken.

Therefore, would the following work:
- Once plugged in, my hardware writes its values to Windows approximately every 10ms, and creates a XML file with pointers to those values.
- SCII needs to read that XML file approximately every 10-25ms.
- The XML, when read, presumably would determine what the values of the pointed data are at that time and report those to SCII.
- SCII handles what to do with the obtained values via scripts/UI.

Forgive me for any mistaken understandings as I have not coded with XMLs before. If this sounds feasible, I will most likely proceed in the SCII direction with the demo and then be looking for help with that.
 
Level 9
Joined
Dec 21, 2006
Messages
490
those sc2 xml files are quite simple. writing a program to write a proper sc2 bank file should not be such a hard task.
xml file with pointers? that sounds wierd to me. for sc2 you have to write those values directly into the xml, but anyway i have doubts that sc2 is able to perform as fast as you want it to. you should check out sc2mapster and ask the guy who has done tests with periodically bank reading.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
- SCII needs to read that XML file approximately every 10-25ms.
The lowest resolvable time in SC2 is 0.0625 at normal speed. You will need to speed the game up at least 2.5 times to be able to resolve at the required rate which may have the unwanted effect of making everything appear to be running in fast forward as well as consume 2.5 times the CPU resources per unit time.
 
Level 1
Joined
Sep 30, 2013
Messages
3

It is the hardware's drivers which is pre-Windows coding.


Muhahahahaaa: Thanks for pointing me to SC2mapster. They had the solution and gave me the info I needed.

Dr Super Good: Same info that I received from SC2mapster. The game can read up to once per frame. The demo I have planned will be less intensive than a normal 1v1 map at least in the number of units/buildings and map size. It is reassuring to hear it from a second source.


After looking at tutorials and the gimped editor that comes with the free version, I can see that everything I wanted to do should be possible. Solved & thanks.
 
Status
Not open for further replies.
Top