Developed by Blizzard following the sucessful WarCraft series, Starcraft is undoubtably one of the most innovative and popular RTS games to hit the market. Introducing for the first time three races all completly unique yet perfectly balanced, this made for some fantastic gameplay with zergling rushes, to siege tank massacres. With starcraft having such a cult following there are bountiful mods available from simplistic character changes to new scenarios, and challenges to face. The fact that Starcraft has been game of the year sums up just how good this game is, so crank it up if you are not already playing it!

Post tutorial Report RSS Unit morph for all units

There are problem in firegraft: Unit morphing aborts if you try to do it from any unit, different from larva, hydralisk, or mutalisk. This tutorial explains how to fix this bug.

Posted by on - Advanced Server Side Coding

For Example - in Gravity mod Ultralisk - next stage of zergling development. Zergling, actualy, can't morph, cause it has no specific coocoon unit. However it can be fixed trough firegraft/stardraft plugins. I've used GPTP 2.4 to allow zergling morph. You should download GPTP 2.4, and Firegraft 1.16.1 to mess with this:
1) Open project. Go to "unit_morph.cpp", and after lines:

  if (unit->id == UnitId::larva || unit->id == UnitId::mutalisk) {
    if (unit->canMakeUnit(morphUnitId, *ACTIVE_NATION_ID) == 1) {
      return true;
    }
  }

paste this:

  if ( unit->id == UnitId::ZergZergling )
  {
	  if (unit->canMakeUnit(morphUnitId, *ACTIVE_NATION_ID) == 1 )
		  return true;
  }

2) This were procedure checking abilitu to morph. But it is not enough to fix all - most morphing units has their specific cocoon unit. To select it for zergling - go lower to:

if (unitId == UnitId::hydralisk )
    return UnitId::lurker_egg;

Replace this by:

if (unitId == UnitId::hydralisk || unitId == UnitId::zergling )//Secondary Coocoon
    return UnitId::lurker_egg;

3) After this you may compile your plugin. Zerling will be able to morph in any other zerg unit. Actualy that was all coding part. If you know about dat requiments you needn't to explain the rest. But there is a small thing, usefull to know:

Firegraft

4) Zerg don't do abortions. Also, in real life (insects, or amphibous) metamorphose once started can't get interrupted. So, open Firegraft/button sets, and select button set 17 (Egg/Cocoon); in lower right side of window you can se list of units using it. By doubleclick on unit you can go to unit options page in firegraft. For each morph unit must be selected button set "None". This need to avoid 2 bugs in one time: 1st - connection between unit's native hatchery (after morphing unit will run to hatchery's rally point), and second - changing unit type on cancel (you tried to morph queen in matriarch, and when cancelled - got mutalisk).

E N D

Post comment Comments
RobertHouse
RobertHouse - - 1,281 comments

Very nice to know, thank you!

Reply Good karma Bad karma+2 votes
aslit
aslit - - 10 comments

i downloaded gptp, how do i compile a plugin?

Reply Good karma Bad karma+1 vote
Alalandex Author
Alalandex - - 44 comments

You need program to work with Visual C++.

Reply Good karma+1 vote
Guest
Guest - - 688,627 comments

This comment is currently awaiting admin approval, join now to view.

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: