SC Revolution mod on 1.16.1

Help - Resources - AI Scripting - Grafting - Plugins - Modding Projects
User avatar
Hercanic
Posts: 39
Joined: Sat Sep 27, 2008 6:42 am

Postby Hercanic » Sun Nov 06, 2011 4:25 pm

Thank you very much! Your information has definitely helped me.

Hm, I wonder what happens if you were to swap the Marine to a Goliath if he'd gain a turret or not. Or if you swap a unit that already has a turret into another turret unit (Goliath to Siege Tank) whether the turret changes at all.
RavenWolf
Posts: 45
Joined: Sat Jun 25, 2011 1:03 am

Postby RavenWolf » Thu Nov 10, 2011 6:44 pm

I think that a Marine goliath switch may cause a crash. The other case may work, and i think you can also change only the turret for a unit. but never tested it. so im not sure.
Need to star working again with gptp some day.
ranmakun
Posts: 18
Joined: Mon Oct 24, 2011 6:01 pm

Postby ranmakun » Mon Dec 12, 2011 9:53 pm

Hi RavenWolf, i like your mod, is very fun!, but the civil terran and the infested terran have been sacrificed...in your new update add them please..:(
ranmakun
Posts: 18
Joined: Mon Oct 24, 2011 6:01 pm

Postby ranmakun » Sat Dec 24, 2011 10:42 pm

Hi RavenWolf, a little help please, how as you did the overload of the dragoon ?? please can you explain?, the gptp is update to sc 1.16, and the firegraft too, but i dont how to do the plugin.., i have vc++ 2008 express edition, only need how to change the unit id of the dragoon and replace to the other id, i think,..that file i have to change?? units.h ... structures.h .. ?? help me pleasee :(
TassadarZeratul
Posts: 19
Joined: Fri Jun 05, 2009 7:21 pm

Postby TassadarZeratul » Mon Dec 26, 2011 4:28 pm

The way a GPTP plugin works is by calling the function nextFrame() every frame; it can be found in game.h. (There are also other functions there that are called at the beginning and end of a game.)

One thing that's really important is the ability to loop through units. If you have a UNIT*, you can make it go through every unit in the game and do stuff; here's an example (that could have some mistakes in it; I'm going from memory here):

Code: Select all

bool nextFrame()
{
   UNIT* example;
   for(int i = 0; i < 1700; i++)
   {
      example = &unitTable[i];
      //do stuff here
   }
   return true;
}


Another important thing is accessing a unit's variables, which are listed in unit.h. If you've got a UNIT*, you can access them as with any pointer. If it was named "example", then you could say, for example, example->energy = 0; to set its energy to 0.

(You will, ofc, have to know C++ to use this. ;b )
RavenWolf
Posts: 45
Joined: Sat Jun 25, 2011 1:03 am

Postby RavenWolf » Tue Dec 27, 2011 7:22 pm

Like TZ said, most of the code is writen in the nextFrame() function in the game.h file.
Check here http://www.modcrafters.com/forum/viewforum.php?f=17 for the plugins guides and the examples to star working with the tool.
ranmakun
Posts: 18
Joined: Mon Oct 24, 2011 6:01 pm

Postby ranmakun » Thu Dec 29, 2011 4:44 pm

oh thanks for the answers.. but its hard to me...help me with a example similarity that overload pleasee, i like this power..!! help me RavenWolf :)
RavenWolf
Posts: 45
Joined: Sat Jun 25, 2011 1:03 am

Postby RavenWolf » Tue Jan 31, 2012 4:34 am

you can make it by different ways.
one simple example: use the stimpack counter, that automatically increase the attack speed and movement until reach 0.
to make them unable to move, you have to disable the flag to receive orders, but first set them in hold position state.

Code: Select all

if (unit->unitId == dragoon && unit->healthPoints > 0){
  if (unit->mainOrderId == CarrierStop) {//add to the dragoons buttonset with firegraft a "stop carrier" action button and add the dragoon to the stop carrier order in the orders dat requirements.
    unit->stimTimer=30;
    unit->mainOrderId=HoldPosition2;
    unit->status= unit->status | 0x1000;//canot recibe orders
    if (unit->stimTimer==0)
      unit->status= unit->status & ~0x1000;//unset the flag
  }
}

if you want to disable the unit for a time use the disabled flag:
unit->status= unit->status | 0x8;//disabled
unit->status= unit->status & ~0x8;//enabled
ranmakun
Posts: 18
Joined: Mon Oct 24, 2011 6:01 pm

Postby ranmakun » Thu Feb 16, 2012 5:57 pm

Thanks a lot RavenWolf!! ..but i'm not sure this well done, please see it. The rest i leave it like this?.. thanks in advance for the answers :D

PD: how add the disable flag, after which lines?
[attachment=3004:001.JPG]
RavenWolf
Posts: 45
Joined: Sat Jun 25, 2011 1:03 am

Postby RavenWolf » Fri Feb 24, 2012 12:09 am

ho sorry, the previous code have some mistakes. ^^
here:

Code: Select all

if (unit->unitId == dragoon && unit->healthPoints > 0){
  if (unit->mainOrderId == CarrierStop) {
    unit->stimTimer=60;
    unit->mainOrderId=HoldPosition2;
    unit->status= unit->status | 0x1000;//canot receive orders
  }
  if (unit->stimTimer>0){
    if (unit->stimTimer==30){
      unit->status= unit->status | 0x8;//disabled
      unit->sprite->teamColor=160; //black color
    }
    if (unit->stimTimer==1){
      unit->status= unit->status & ~0x8;//enabled
      unit->status= unit->status & ~0x1000;//can receive orders again
      unit->sprite->teamColor=unit->playerId; //original color
    }
  }
}

I think this should work

Return to “StarCraft Modding”

Who is online

Users browsing this forum: No registered users and 2 guests