Staredit Network > Forums > Modding Assistance > Topic: plugin how to start?
plugin how to start?
Nov 4 2018, 9:33 pm
By: Lagi  

Nov 4 2018, 9:33 pm Lagi Post #1



I can not make GPTP.qdp from source (i must dont know something basic)

please advice me

=============
i have visual studio 2010 Ultimate

from Framework http://www.staredit.net/topic/17547/
I open the GPTP source: project GPTP.vcxproj

any change i made in game hooks.cpp works (f.ex. in line 24 :
scbw::printText(PLUGIN_NAME ": Hello, world! asdasd");

but nothing else dont work: i try include also KYSXD code for
https://github.com/KYSXD/GPTP-For-VS2008/wiki/%5BPlugin%5D-Smart-rally
https://github.com/KYSXD/GPTP-For-VS2008/wiki/%5BPlugin%5D-Increase-initial-amount-of-workers

after change i save the .cpp
F5 > debug

go to framework folder
inside /debug/patch/ I find some .gdp file (that is affecting the start txt message only)

from some other tutorial, i know VS should create GPTP.dll file
the problem is in my case those 3.dll file are 1kb heavy and changing extension to .qdp and with error.

=======
precompiled .qdp for smart rally from Framework works.



None.

Nov 5 2018, 6:19 pm Lagi Post #2



SOLUTION (it work, but let somebody check me, if i'm missing something):
all hooks have to be "activate" in file game_hooks.cpp

f.ex. increasing starting workers:
in game_hooks.cpp below other #includes add:
#include "create_init_units.h"

in file create_init_units.cpp
there is function:
void CreateInitialMeleeUnits()
where have to be written code for more than 4 workers
(copy paste KYSXD:https://github.com/KYSXD/GPTP-For-VS2008/wiki/%5BPlugin%5D-Increase-initial-amount-of-workers)


in game_hooks.cpp, after "nextFrame()", add CreateInitialMeleeUnits();

Quote
//This block is executed once every game.
if (*elapsedTimeFrames == 0) {
//Write your code here

CreateInitialMeleeUnits();
}

//Loop through all visible units in the game.
for (CUnit *unit = *firstVisibleUnit; unit; unit = unit->link.next) {
//Write your code here




None.

Nov 5 2018, 7:13 pm Lagi Post #3



PROBLEM:

if I use the starting worker hook (even with 4 default starting workers),
the default AI is idle (doing nothing),

any suggestions?



None.

Nov 6 2018, 9:59 am Lagi Post #4



SOLUTION:

in file initialize.cpp there are injects that are commented, inactive- so they not modify SC code.

un-comment
Quote
hooks::injectHallucinationSpellHook();
hooks::injectFeedbackSpellHook();
hooks::injectBtnsCondHook();
hooks::injectRecvCmdHook();*/
hooks::injectCreateInitUnitsHooks();
/*hooks::injectGiveUnitHook();
hooks::injectTrainCmdRecvHooks();
hooks::injectCMDRECV_SiegeTankHooks();
hooks::injectCMDRECV_MergeArchonHooks();

there is no need to double this code-inject in game_hooks.cpp, plus the AI start working with extra workers.
so KYSXD was right in his tutorial, only required is to change "create_init_units.cpp"



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:58 pm]
NudeRaider -- NudeRaider
NudeRaider shouted: Oh_Man nothing too special tbh. the human player wasn't ready to combat the push that stretched almost the whole map. So this game means nothing. We'll have to see how it goes once the humans have adjusted for its unorthodox strategies.
they basically lost most of their army in one big battle and didn't have the time and production to leverage the economic advantage and come back from that blow.
[01:55 pm]
NudeRaider -- Oh_Man
Oh_Man shouted: https://youtu.be/1vsTqNwHquE omg guys it's happening. ITS HAPPENING. EVERONY STAY CALM. STAY F:wob::wob:CKING CALM!
not sure why you are so hyped, when basically the same happened 7 years ago with AlphaStar on SC2.
[01:53 pm]
NudeRaider -- Oh_Man
Oh_Man shouted: 6000 apm XD, i dont even understand how it culd came back wen it was 5 base vs 2
nothing too special tbh. the human player wasn't ready to combat the push that stretched almost the whole map. So this game means nothing. We'll have to see how it goes once the humans have adjusted for its unorthodox strategies.
[10:59 am]
NimoStar -- "Sick" is the appropriate word for the disease that AI is foisting upon our society. Repent, ye sinners!
[06:32 am]
Ultraviolet -- that was pretty sick lol
[02:55 am]
Oh_Man -- 6000 apm XD, i dont even understand how it culd came back wen it was 5 base vs 2
[02:42 am]
Symmetry -- 'twas only a matter of time
[02:40 am]
Oh_Man -- https://youtu.be/1vsTqNwHquE omg guys it's happening. ITS HAPPENING. EVERONY STAY CALM. STAY F:wob::wob:CKING CALM!
[02:20 am]
Symmetry -- :wob:
[2026-9-18. : 10:51 am]
Oh_Man -- :wob:
Please log in to shout.


Members Online: RIVE, Sie_Sayoka, Ultraviolet