Staredit Network > Forums > Modding Assistance > Topic: Two firegraft plugin requests
Two firegraft plugin requests
Apr 17 2017, 8:04 am
By: Pr0nogo
Pages: < 1 2 3 4 >
 

May 9 2017, 6:51 am Pr0nogo Post #21



As I'm not sure if Corbo is still interested in this, I'm bumping the thread. The project will be finished within the next few weeks and I am in need of the following:

CONSUME:
-Must heal hit points for a value pulled from an unused weapon (e.g. Weapon ID 117)
-Otherwise, must behave as normal

INFESTED DURAN:
-Must regenerate energy faster after an unused upgrade has been researched (e.g. Upgrade ID 18)
-The upgrade will have 2 levels to it
-The energy regen values should be as follows:
No upgrade - standard regen speed
1 upgrade - 1.5x regen speed
2 upgrades - 2x regen speed

Please let me know if you are able to help. Thanks!




May 9 2017, 11:59 am Voyager7456 Post #22

Responsible for my own happiness? I can't even be responsible for my own breakfast

I'll post something later today, Pr0nogo.



all i am is a contrary canary
but i'm crazy for you
i watched you cradling a tissue box
sneezing and sniffling, you were still a fox


Modding Resources: The Necromodicon [WIP] | Mod Night
My Projects: SCFC | ARAI | Excision [WIP] | SCFC2 [BETA] | Robots vs. Humans | Leviathan Wakes [BETA]


May 9 2017, 8:44 pm KYSXD Post #23



Well, I think this lines can achieve what you want to do:

For the Consume behaviour:

Code
   /// in wpnspellhit.cpp
   /// from line 411 (void ConsumeHit() function)
   void ConsumeHit(CUnit* attacker, CUnit* target) {

       if(
           target != NULL &&
           !(target->status & UnitStatus::Invincible) &&
           getSpellStatString(target,TechId::Consume,attacker->playerId) == 0 //returning a value != 0 means there was an error
       )
       {

           incrementUnitDeathScores(target,attacker->playerId);
           target->remove();

           if(!(target->status & UnitStatus::IsHallucination)) {

               /// KYSXD
               /// For use with WeaponId namespace
               s16 healtRegen = weapons_dat::DamageAmount[117] * 256; /// WeaponId = 117
               attacker->setHp(attacker->hitPoints + healtRegen);

               u16 energyMax = attacker->getMaxEnergy();

               if((energyMax - attacker->energy) > 12800) //12800 is 50 energy ingame
                   attacker->energy = energyMax;
               else
                   attacker->energy += 12800;

           }

       }

   } //void ConsumeHit(CUnit* attacker, CUnit* target)



For the Duran's upgrade behaviour:

Code
   /// In update_unit_state.cpp
   /// from line 83 (else statement of 'if(unit->energy == maxEnergy)')
   else {

       /// KYSXD:
       /// Normal energy regen
       u16 energyRegen = 8;

       /// KYSXD:
       /// For use with UpgradeId namespace
       if(unit->id == UnitId::Hero_InfestedDuran)
       {
           switch(scbw::getUpgradeLevel(unit->playerId, 18)) /// UpgradeId 18
           {
               case 1:
                   energyRegen *= 1.5;
                   break;
               case 2:
                   energyRegen *= 2;
                   break;
               default:
                   break;
           }                  
       }

       /// KYSXD:
       /// New modified regen
       unit->energy += energyRegen;

       if(unit->energy > maxEnergy)
           unit->energy = maxEnergy;

   }



These should do the job.




May 9 2017, 9:36 pm Voyager7456 Post #24

Responsible for my own happiness? I can't even be responsible for my own breakfast

Or KYSXD could just beat me to it. :P



all i am is a contrary canary
but i'm crazy for you
i watched you cradling a tissue box
sneezing and sniffling, you were still a fox


Modding Resources: The Necromodicon [WIP] | Mod Night
My Projects: SCFC | ARAI | Excision [WIP] | SCFC2 [BETA] | Robots vs. Humans | Leviathan Wakes [BETA]


May 10 2017, 5:36 am Pr0nogo Post #25



Thanks KYSXD! How would I compile these into GPTP?




May 10 2017, 12:08 pm Voyager7456 Post #26

Responsible for my own happiness? I can't even be responsible for my own breakfast

Download this: https://github.com/BoomerangAide/GPTP-For-VS2008

Replace the code mentioned in the comments with KYSXD's code (in update_unit_state.cpp and wpnspellhit.cpp).

Build the Visual Studio project. It will generate a .qdp file. I believe by default it will go in the Debug directory, but you can change that in the project settings.



all i am is a contrary canary
but i'm crazy for you
i watched you cradling a tissue box
sneezing and sniffling, you were still a fox


Modding Resources: The Necromodicon [WIP] | Mod Night
My Projects: SCFC | ARAI | Excision [WIP] | SCFC2 [BETA] | Robots vs. Humans | Leviathan Wakes [BETA]


May 10 2017, 12:52 pm Pr0nogo Post #27



I don't see an executable anywhere, so I assume I need to use notepad++ or some other compiler to actually modify the code? Or is it because I don't have VS 2008 correctly installed? The readme doesn't clear any of this up. Thanks for your help so far, it is much appreciated!




May 10 2017, 12:56 pm Voyager7456 Post #28

Responsible for my own happiness? I can't even be responsible for my own breakfast

If you have VS correctly installed, you should be able to open the "GPTP.sln" file, which will launch Visual Studio. You don't strictly need VS2008, I use 2010 and it works fine. I haven't tested with newer versions though.



all i am is a contrary canary
but i'm crazy for you
i watched you cradling a tissue box
sneezing and sniffling, you were still a fox


Modding Resources: The Necromodicon [WIP] | Mod Night
My Projects: SCFC | ARAI | Excision [WIP] | SCFC2 [BETA] | Robots vs. Humans | Leviathan Wakes [BETA]


May 11 2017, 6:01 am Pr0nogo Post #29



Every time I attempt to build the project after copy and pasting the code from KYSXD's post, it throws a fatal error and numerous other nonfatal errors. The fatal one is sometimes in update_unit_state.cpp and sometimes in wpnspellhit.cpp. In both cases, the fatal error is at the last line of the cpp's code and says that the left hook '{' is not matched. I've tried placing a right hook '}' but that hasn't helped. Any ideas?




May 11 2017, 5:29 pm Corbo Post #30

ALL PRAISE YOUR SUPREME LORD CORBO

I've compiled KYSXD's code for you. Let me know the results.

Attachments:
GPTP.qdp
Hits: 1 Size: 497.5kb



fuck you all

May 11 2017, 10:14 pm KYSXD Post #31



Corbo, please tell me that this time you turned off the hooks that aren't in use.




May 12 2017, 2:24 am Pr0nogo Post #32



Still crashing whenever marines attack. Can you try KYSXD's code instead of your own?




May 12 2017, 2:51 am Voyager7456 Post #33

Responsible for my own happiness? I can't even be responsible for my own breakfast

I don't know what Corbo is doing that's causing that issue. Maybe he's not using a fresh GPTP install?

Pr0nogo, try this. Extraneous hooks are disabled and I tested both Consume and Marines attacking. I just threw it together and was too lazy to test the unused upgrades, but there shouldn't be an issue.

Post has been edited 1 time(s), last time on May 12 2017, 11:59 am by Voyager7456.



all i am is a contrary canary
but i'm crazy for you
i watched you cradling a tissue box
sneezing and sniffling, you were still a fox


Modding Resources: The Necromodicon [WIP] | Mod Night
My Projects: SCFC | ARAI | Excision [WIP] | SCFC2 [BETA] | Robots vs. Humans | Leviathan Wakes [BETA]


May 12 2017, 3:47 am Pr0nogo Post #34



Marine attacking no longer crashes, but Consume's graphic appears when cast and the unit it's cast on isn't killed, and no energy/life is restored. This occurs both when the plugin is imported in my existing exe and when the plugin is the only modified data in a fresh exe. Here's the fresh exe for reference.




May 12 2017, 10:54 am Corbo Post #35

ALL PRAISE YOUR SUPREME LORD CORBO

Quote from Voyager7456
I don't know what Corbo is doing that's causing that issue. Maybe he's not using a fresh GPTP install?

Pr0nogo, try this. Extraneous hooks are disabled and I tested both Consume and Marines attacking. I just threw it together and was too lazy to test the unused upgrades, but there shouldn't be an issue.

After the first two times I tried I actually redownloaded and used a fresh install. Share your consume+hooks code?



fuck you all

May 12 2017, 12:05 pm Voyager7456 Post #36

Responsible for my own happiness? I can't even be responsible for my own breakfast

Sorry, that was my bad. I uploaded the wrong one. Use this.

Quote from Corbo
Quote from Voyager7456
I don't know what Corbo is doing that's causing that issue. Maybe he's not using a fresh GPTP install?

Pr0nogo, try this. Extraneous hooks are disabled and I tested both Consume and Marines attacking. I just threw it together and was too lazy to test the unused upgrades, but there shouldn't be an issue.

After the first two times I tried I actually redownloaded and used a fresh install. Share your consume+hooks code?

It's KYSXD's posted code, and I commented out all of the hook inject functions aside from GameHooks, DrawHooks, CastOrder, WpnSpellHit, TechTarget and UpdateUnitState.

Post has been edited 1 time(s), last time on May 13 2017, 3:07 pm by Voyager7456.



all i am is a contrary canary
but i'm crazy for you
i watched you cradling a tissue box
sneezing and sniffling, you were still a fox


Modding Resources: The Necromodicon [WIP] | Mod Night
My Projects: SCFC | ARAI | Excision [WIP] | SCFC2 [BETA] | Robots vs. Humans | Leviathan Wakes [BETA]


May 12 2017, 12:19 pm Pr0nogo Post #37



Health works as intended, as far as I can tell. I haven't checked with upgrades. What weapon is it reading the data from? 117?

If at full energy, the caster has their energy set to ~45. If at anything but full energy, the caster has their energy set to full.




May 12 2017, 12:40 pm Voyager7456 Post #38

Responsible for my own happiness? I can't even be responsible for my own breakfast

Yes, it reads from 117.

Interesting. This energy anomaly looks like it may be a bug in GPTP - it also occurs without any of KYSXD's code changes. I'll have to investigate later, I don't have time right now.



all i am is a contrary canary
but i'm crazy for you
i watched you cradling a tissue box
sneezing and sniffling, you were still a fox


Modding Resources: The Necromodicon [WIP] | Mod Night
My Projects: SCFC | ARAI | Excision [WIP] | SCFC2 [BETA] | Robots vs. Humans | Leviathan Wakes [BETA]


May 12 2017, 12:53 pm Pr0nogo Post #39



Alright, thanks for your help.




May 13 2017, 3:07 pm Voyager7456 Post #40

Responsible for my own happiness? I can't even be responsible for my own breakfast

Wow, that was super simple once I actually had the time to sit down and investigate. The comparison checking if the unit is at max energy is wrong (on the GPTP repository as well). Corrected version posted below.

I never actually noticed this before, the last couple projects I've been working on have overrode Consume for other things.

Post has been edited 1 time(s), last time on May 14 2017, 8:21 pm by Voyager7456.



all i am is a contrary canary
but i'm crazy for you
i watched you cradling a tissue box
sneezing and sniffling, you were still a fox


Modding Resources: The Necromodicon [WIP] | Mod Night
My Projects: SCFC | ARAI | Excision [WIP] | SCFC2 [BETA] | Robots vs. Humans | Leviathan Wakes [BETA]


Options
Pages: < 1 2 3 4 >
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[08:38 am]
Zycorax -- :wob:
[03:14 am]
O)FaRTy1billion[MM] -- :wob:
[2024-6-15. : 11:09 pm]
Ultraviolet -- :wob:
[2024-6-12. : 6:23 am]
Ultraviolet -- got some light recalls behind too
[2024-6-12. : 12:07 am]
O)FaRTy1billion[MM] -- 🦗
[2024-6-11. : 9:53 pm]
Wing Zero -- I wonder how he knew I was in the market for a good cricket bat
[2024-6-11. : 2:27 pm]
lil-Inferno -- ya
[2024-6-11. : 10:49 am]
Oh_Man -- or scarab maybeh
[2024-6-11. : 10:49 am]
Oh_Man -- shielt battery + photon cannon blast?
[2024-6-11. : 10:49 am]
Oh_Man -- check out the animation at 7:56
Please log in to shout.


Members Online: Roy, DiearAnother, myocytebd, jun3hong, lil-Inferno