Various UMS+Modding Questions

Help - Resources - AI Scripting - Grafting - Plugins - Modding Projects
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
User avatar
Hydrolisk
Posts: 39
Joined: Mon Sep 15, 2008 8:39 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Various UMS+Modding Questions

Postby Hydrolisk » Wed Jul 25, 2012 2:32 pm

Hello. I am primarily a modder with novice-tier programming skills who is currently working on a mapmod RPG project. As such, I have a lot of interdisciplinary questions.

(Being the lazy ass I am, I have not yet opened up the General Plugin Template Project in a while, and I have not looked extensively at BWAPI at all (or ever), so some of these questions might be a little silly. Sorry.)

Currently, the tools I am using/have include DatEdit, GPTP, FireGraft, IceCC, SCMDraft2, MPQDraft, LO? Edit, BinEdit, PyMS, RADVideo, ShadowFlare's GRP converter and playlist plugin, ThunderGraft, TBL Pad, WinMPQ... I think that covers the most important ones. You could also count BWAPI, although I haven't touched it yet. I am quite experienced with most of these.

Here are my questions. (For some, I expect it necessary to use multiple methods both in direct and indirect communication in order to implement. The mapmod will be played on a 3-player UMS map with all Computer slots used.)

1) Is it possible to control music and sounds?

2) Is it possible to manipulate graphics and sounds outside of StarCraft's engine? E.g. importing a media library into a plugin's code. (Working with DirectX, SDL, OpenGL, or such in tandem with StarCraft?)

3) Can you stop sounds (with any method) played through the trigger system?

4) There are a bunch of entries in orders.dat that are marked as unused, but I am dubious - 12 Attack Ground, 13 Hover, 16 Nothing 1, 17 Power Up, 24 Nothing 3, 104 Guardian Aspect, 174 Warp In are all marked as unused, but 12, 104, and 174 look pretty sketchy, as if they may be used somewhere. Are they actually unused everywhere?

5) Can the successful activation of a normal spell be detected? (E.g. Psi Storm, Parasite, Ensnare, Stim Pack, etc.) (Such that this might trigger a cooldown.)

6) Plugins: Is it possible to set shield value (99% certain, just double checking) for a unit that has shields enabled (this detail I am not sure about)? Does shield value have to be both non-zero and enabled, just non-zero, or just enabled?

7) Is it possible to change a unit's weapons without resorting to unit ID changes?

8) What are /all/ effects of unit ID swapping?

9) Does anyone have Quantum's contact info? (Developer of MPQDraft and ThunderGraft.) I figure he probably knows how to work some sinister sorcery - I already see some sort of sound stopping function in ThunderGraft's source code.

10) Is it possible to remove a unit with plugins (without the death animation, so that the removal is like the trigger action)?

11) [s]Is it possible to set, decrease, or increase an upgrade or tech with a plugin? (Maybe BWAPI can do this?)[/s] Scratch this, I'm pretty sure it is entirely possible with one of BWAPI's addons. Moreover, I'm also sure I could tell the AI to upgrade or research only when a specific condition is met (although a resource requirement is the most I need I think.)

Thank you very much for your time.

EDIT:

12) I read somewhere that hypertriggers can run up to a frequency of 11.9 MHz (might have recalled incorrectly). How does this interact with GPTP's nextFrame()? E.g. Through a trigger, I create a Reaver and the action immediately following is "Set Hangar Count to 1." In nextFrame(), killReaversWithNoScarabs() executes. Is it at all possible that the creation of the Reaver coincides with the moment before nextFrame() and change to hangar count coincides with the moment after nextFrame(), such that the Reaver is killed before it is given a Scarab? I.e. Reaver Created with 0 Scarabs -> Reaver killed in nextFrame() -> Set Hangar Count is obsolete.

I read in the BWAPI docs that the logical frame rate of SC is theoretically infinite, so I figure that the above situation is (theoretically) not possible. But I don't know for certain as my technical knowledge of SC at this level is lacking.

P.S.

Sorry for the wall of text. Staredit.net doesn't have many active people that know SC on this sort of level. It also feels like a bunch of people like DoA and Quantum are no longer with SC at anymore...

13) I see that there are namespaces and enumerations for upgrades and techs, but how do I use them?
Thank you for your time.
RavenWolf
Posts: 45
Joined: Sat Jun 25, 2011 1:03 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Postby RavenWolf » Fri Jul 27, 2012 1:31 am

Heinermann
Posts: 362
Joined: Thu Apr 26, 2007 12:42 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Postby Heinermann » Fri Jul 27, 2012 7:35 pm

[quote name='New-/Hydrolisk' date='25 July 2012 - 03:32 PM' timestamp='1343226731' post='11007']
1) Is it possible to control music and sounds?
[/quote]
Of course you can. Maps have the "Mute/Unmute unit speech." action and the "PlayWAV" action. You can also mod the .WAV files that are in the MPQ.

[quote name='New-/Hydrolisk' date='25 July 2012 - 03:32 PM' timestamp='1343226731' post='11007']
2) Is it possible to manipulate graphics and sounds outside of StarCraft's engine? E.g. importing a media library into a plugin's code. (Working with DirectX, SDL, OpenGL, or such in tandem with StarCraft?)
[/quote]
Yes. Starcraft uses DirectDraw and DirectSound, which are components of DirectX.

[quote name='New-/Hydrolisk' date='25 July 2012 - 03:32 PM' timestamp='1343226731' post='11007']
3) Can you stop sounds (with any method) played through the trigger system?
[/quote]
Not that I know of. However, I believe muting and then un-muting your sound manually will stop all trigger-played sounds.

[quote name='New-/Hydrolisk' date='25 July 2012 - 03:32 PM' timestamp='1343226731' post='11007']
4) There are a bunch of entries in orders.dat that are marked as unused, but I am dubious - 12 Attack Ground, 13 Hover, 16 Nothing 1, 17 Power Up, 24 Nothing 3, 104 Guardian Aspect, 174 Warp In are all marked as unused, but 12, 104, and 174 look pretty sketchy, as if they may be used somewhere. Are they actually unused everywhere?
[/quote]
Not entirely sure. We could log the data in BWAPI to determine which orders are used and which are not. I know that Nothing 1 and Nothing 3 are unused though.

[quote name='New-/Hydrolisk' date='25 July 2012 - 03:32 PM' timestamp='1343226731' post='11007']
7) Is it possible to change a unit's weapons without resorting to unit ID changes?
[/quote]
You can change the unit type's weapon ID.

[quote name='New-/Hydrolisk' date='25 July 2012 - 03:32 PM' timestamp='1343226731' post='11007']
10) Is it possible to remove a unit with plugins (without the death animation, so that the removal is like the trigger action)?
[/quote]
Yes. In fact trigger actions are in a nice array of function pointers which you can just call (the address is in BWAPI, look for "BW/Offsets.h"). There is possibly a better function for it that doesn't require a location ID.

[quote name='New-/Hydrolisk' date='25 July 2012 - 03:32 PM' timestamp='1343226731' post='11007']
11) [s]Is it possible to set, decrease, or increase an upgrade or tech with a plugin? (Maybe BWAPI can do this?)[/s] Scratch this, I'm pretty sure it is entirely possible with one of BWAPI's addons. Moreover, I'm also sure I could tell the AI to upgrade or research only when a specific condition is met (although a resource requirement is the most I need I think.)
[/quote]
BWAPI does not do this. You would use a plugin to modify upgrades/techs (especially decreasing an upgrade).

[quote name='New-/Hydrolisk' date='25 July 2012 - 03:32 PM' timestamp='1343226731' post='11007']
I read in the BWAPI docs that the logical frame rate of SC is theoretically infinite, so I figure that the above situation is (theoretically) not possible. But I don't know for certain as my technical knowledge of SC at this level is lacking.
[/quote]
It is the graphical frame rate that is infinite. Logical frames are run once every 42ms on fastest. Each logical frame forwards the game state by 1 tick. BWAPI's onFrame callback is run once every logical frame.
User avatar
Hydrolisk
Posts: 39
Joined: Mon Sep 15, 2008 8:39 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Postby Hydrolisk » Sat Jul 28, 2012 4:16 pm

Thank you for your time.
User avatar
Hydrolisk
Posts: 39
Joined: Mon Sep 15, 2008 8:39 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Postby Hydrolisk » Fri Aug 03, 2012 2:58 am

I am using GPTP at the moment and I am trying to use FMOD ( http://www.fmod.org ) in tandem with the GPTP.

My problem is that I simply cannot use an #include "fmod.hpp" to import FMOD and get it working. When I try test it, although the FMOD test code component works properly (the music I am trying to stream works), funny things seem to happen to SCBW, such as it is impossible to order an attack (the button and targetting works, but the attack cannot be processed), loading a second map after quitting a first one will crash SC, and SC crashes on exit of the program.

I suspect this has something to do with the rearrangement of SCBW's addresses, but I'm not sure.

Is there any way I can use FMOD in a way that won't destabilize SC?

As of this moment, I am thinking of developing some sort of side program that constantly checks for a text file in the mod's directory, and if it is there, play the sound/music. But, if anyone has any knowledge on this issue, it would be greatly appreciated for that person to post.
Thank you for your time.

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Return to “StarCraft Modding”

Who is online

Users browsing this forum: Bing [Bot] and 0 guests