Staredit Network > Forums > Modding Discussion > Topic: GPTP PLUGINS DUMPSTER
GPTP PLUGINS DUMPSTER
Feb 15 2017, 6:17 am
By: Corbo  

Feb 15 2017, 6:17 am Corbo Post #1

ALL PRAISE YOUR SUPREME LORD CORBO

Alright so the purpose of this topic is to share plug ins.

I'm currently making a few plug ins and I intend to post whatever I feel like sharing for everyone's use because #PowerToThePeople. I'm nowhere near being an expert at this, I am not a programmer and I am an idiot. So there's that. Here's a few guidelines for this topic, though:

  • If anyone else feels like posting their own I'll make sure to keep this post organized with a nice list to show them all.
  • If anyone feels like requesting or giving ideas that could work too, I guess.
  • While one can just post their code or plug ins keep in mind this topic is aimed for the fools so it would be nice if you included a brief explanation on how to use them too.
  • Grabbing something? Don't be an asshole and give credit where credit is due.

PLUGINS INDEX
  • None yet.




fuck you all

Feb 15 2017, 6:32 am Corbo Post #2

ALL PRAISE YOUR SUPREME LORD CORBO

TERRAIN AFFECTS UNITS

Ever wanted to have units be affected by terrain other than being blocked by it? Ever wanted terrain to have much more involvement in gameplay than just sitting there decoratively?

Then this plug in is for you!

With this plug in you'll be able to affect units depending on which tile/tileset group they're standing on. This will also give you access to tileset flags so, there's that for you to use too.

Here's how it works:
  • You need structs for the MTXM and the Tile section of a map, additionally I added a mapSize struct too
  • You need pointers to those sections
  • You need code to do stuff!

Here's the code for the structs AND the pointers:
Code
// Adds MTXMTile info struct...
struct MTXMTile {
    u16 megatile : 4;
    u16 megatileGroup : 12;
};

// Adds Tile info struct...
struct Tile {
u16 index;
u16 buildable;
u16 unk6; // I don't remember what any of these are
u16 unk7;
u16 unk8;
u16 unk9;
u16 unk10;
u16 unk11;
u16 unk12;
u16 unk13;
u16 tiles[16];
};

// Adds mapSize info struct...
struct mapSizeStuff{
    u16 width;
    u16 height;
};

// Adds pointer to MTXM map tile data
SCBW_DATA(MTXMTile**, MTXM, 0x005993C4);
// Adds pointer to megaTileArray data
SCBW_DATA(Tile**, megaTileArray, 0x00628458);
// Adds pointer to mapSize data
SCBW_DATA(mapSizeStuff*, mapSize,0x0057F1D4);

Paste this in scbwdata.h ideally to keep things tidy you'll paste it near other tileset related stuff. I pasted mine after SCBW_DATA(ActiveTile**, activeTileArray, 0x006D1260);


Here's the code to make it do stuff:
Code
if (unit->id == UnitId::marine && unit->unusedTimer == 0 && (*MTXM)[unit->getTileX() + unit->getTileY()*mapSize->width].megatileGroup == 4){
                unit->damageHp(256); // This is how you damage a unit
                unit->sprite->createOverlay(ImageId::Flames1Type1_Small, 0, 0, 0); // This is because FIREZ
}

Paste this in game_hooks.cpp after the //Write your code here line in the unit loop

Here's how it works, the code that does the magic is this: (*MTXM)[unit->getTileX() + unit->getTileY()*mapSize->width].megatileGroup == 4
That's getting the unit's position and finding out which megatileGroup it is in. If it's 4 then it will execute actions inside the {} in this case I went with mtg == 4 because that's the megatilegroup for lava in ashworld. Additional requirements, like I restricted my code to only run on marines and when an unused timer is set to 0, because otherwise units would die quickly.

My actions were damage a unit 1HP and create a fire overlay.

Here's the result:

This is from when every unit would catch on fire xD


GPTP Version: GPTP-For-VS2008-Update-4

Post has been edited 6 time(s), last time on Feb 15 2017, 6:44 am by Corbo.



fuck you all

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[09:45 am]
SiKiN -- Yea cheers but I think I'll land on 20db, hes fine how he is.
[08:53 am]
Pr0nogo -- run that over your file and see how it matches up, normalize it to 90-99% afterwards and you're probably all set
[08:52 am]
Pr0nogo -- I don't know how to do it in audacity, I use audition 1.5 (easy to find for free), and my hardlimit settings look like this: https://i.imgur.com/5Mdxn4V.png
[07:33 am]
SiKiN -- I mean I think it sounds loud enough, and I dont know how to do what youre saying. http://www.staredit.net/sc1db/file/4400/
[06:34 am]
Pr0nogo -- it raises the sound floor, which will have varying effects, e.g. if there's quiet background noise it will get amplified more than the louder samples of the waveform
[06:33 am]
Pr0nogo -- what you'll want to investigate is dynamics processing, or at the very least hard limiting
[06:07 am]
SiKiN -- Can't really go higher than 20db or is screws the voice up something shocking.
[06:05 am]
SiKiN -- I increased to 12db, did ok. Hydralisk attacks where still louder. So I changed to 20db and you can definitely hear it now but its still pretty quiet. Still though I can hear it. So done deal.
[05:37 am]
Pr0nogo -- unless it's a new bug with the remaster
[05:36 am]
Pr0nogo -- there is no issue with equalization, he just didn't have his sounds normalized
Please log in to shout.


Members Online: Roy, jun3hong, SiKiN, amariyrussell