Page 5 of 19

Re: Vatrix's Campaign Fixes

PostPosted: 19 Dec 2014, 09:30
by The Dark Lord
-The builders and servants come out of the storehouse after the enemy forces in town are defeated.
I wonder how this works? Are they just being spawned around the storehouse, or is there actually a script these days to make them walk out of a building?

Re: Vatrix's Campaign Fixes

PostPosted: 19 Dec 2014, 10:21
by sado1
-The builders and servants come out of the storehouse after the enemy forces in town are defeated.
I wonder how this works? Are they just being spawned around the storehouse, or is there actually a script these days to make them walk out of a building?
Seeing how the latter is probably impossible, I bet it was the first option.

Re: Vatrix's Campaign Fixes

PostPosted: 19 Dec 2014, 11:29
by The Dark Lord
That would be a pity, I think it looks really bad when units or buildings just appear out of nowhere...

Re: Vatrix's Campaign Fixes

PostPosted: 19 Dec 2014, 11:51
by Vatrix
That would be a pity, I think it looks really bad when units or buildings just appear out of nowhere...
First option is right, they're spawned when player 4 and 5 is defeated, because if player have them from start, they're almost all killed by enemy. I know it looks a bit odd, but this is now the only option how to save them all.

Re: Vatrix's Campaign Fixes

PostPosted: 19 Dec 2014, 12:16
by The Dark Lord
I think it was okay in the original version. Why is it any different in the Remake?

Re: Vatrix's Campaign Fixes

PostPosted: 19 Dec 2014, 13:00
by Vatrix
I think it was okay in the original version. Why is it any different in the Remake?
In the Remake serfs are easier to kill, so player end up with about 5 serfs instead of 10, so that's why I changed it.

Mission 3 and 4 update:

--old version--

Extract in your The Shattered Kingdom folder (C:\KaM Remake\Campaigns\The Shattered Kingdom)

Also here's the lookup on colors:

Image

Re: Vatrix's Campaign Fixes

PostPosted: 19 Dec 2014, 21:47
by Esthlos
Seeing how the latter is probably impossible
Which is sad... :(
That would be a pity, I think it looks really bad when units or buildings just appear out of nowhere...
First option is right, they're spawned when player 4 and 5 is defeated, because if player have them from start, they're almost all killed by enemy. I know it looks a bit odd, but this is now the only option how to save them all.
This makes serfs and laborers immortal until players 4 and 5 are defeated:
  Code:
var aCivQueue: array of Record aType, aOwner, aX, aY, aHunger, aDir: Integer; end; procedure OnUnitWounded(aUnitID: Integer; AttackerID: Integer); begin if ( (States.PlayerDefeated(3) = False) OR (States.PlayerDefeated(4) = False) ) AND (States.UnitOwner(aUnitID) = 0) AND ( (States.UnitType(aUnitID) = 0) OR (States.UnitType(aUnitID) = 9) ) then begin SetLength(aCivQueue, Length(aCivQueue)+1); aCivQueue[Length(aCivQueue)-1].aType := States.UnitType(aUnitID); aCivQueue[Length(aCivQueue)-1].aOwner := States.UnitOwner(aUnitID); aCivQueue[Length(aCivQueue)-1].aX := States.UnitPositionX(aUnitID); aCivQueue[Length(aCivQueue)-1].aY := States.UnitPositionY(aUnitID); aCivQueue[Length(aCivQueue)-1].aHunger := States.UnitHunger(aUnitID); aCivQueue[Length(aCivQueue)-1].aDir := States.UnitDirection(aUnitID); Actions.UnitKill(aUnitID, True); end; end; procedure OnUnitAfterDied(aType: Integer; aOwner: Integer; aX: Integer; aY: Integer); var i: Integer; var i2: Integer; var iCount: Integer; begin if Length(aCivQueue) > 0 then begin iCount := 0; for i := 0 to Length(aCivQueue)-1 do if (aType = aCivQueue[i-iCount].aType) AND (aOwner = aCivQueue[i-iCount].aOwner) AND (aX = aCivQueue[i-iCount].aX) AND (aY = aCivQueue[i-iCount].aY) then begin Actions.UnitHungerSet(Actions.GiveUnit(aCivQueue[i-iCount].aOwner, aCivQueue[i-iCount].aType, aCivQueue[i-iCount].aX, aCivQueue[i-iCount].aY, aCivQueue[i-iCount].aDir), aCivQueue[i-iCount].aHunger); for i2 := i-iCount to Length(aCivQueue)-2 do aCivQueue[i2] := aCivQueue[i2+1]; iCount := iCount+1; end; if iCount > 0 then SetLength(aCivQueue, Length(aCivQueue)-iCount); end; end;
:P

Re: Vatrix's Campaign Fixes

PostPosted: 19 Dec 2014, 21:56
by Vatrix
Ouuuuuuu, thank you, I didn't really thought of making them immortal, nice idea!!!

Re: Vatrix's Campaign Fixes

PostPosted: 20 Dec 2014, 17:47
by Esthlos
Ouuuuuuu, thank you, I didn't really thought of making them immortal, nice idea!!!
:)

P.S. By the way, it should be possible to use a similar code to change each Barbarian's max Life Points value to a lower number, if you need to nerf the initial attack in mission 8 in a not too obvious way. :P

Re: Vatrix's Campaign Fixes

PostPosted: 22 Dec 2014, 00:44
by Lewin
Ouuuuuuu, thank you, I didn't really thought of making them immortal, nice idea!!!
:)

P.S. By the way, it should be possible to use a similar code to change each Barbarian's max Life Points value to a lower number, if you need to nerf the initial attack in mission 8 in a not too obvious way. :P
I don't like the idea of these magic scripts which change the gameplay/balance in the original campaigns. IMO the original campaigns shouldn't have things like invincible units, magically spawning units, or barbarians with lower life points. Unit statistics should be consistent between missions, you shouldn't make certain units weaker or immortal in some missions just because it suits the balance better. If you want weaker barbarians, just remove some of them or something like that which doesn't change the game rules.

Heavily using scripts also makes it prone to bugs, and probably means the campaigns will need to be checked/updated for every release to make sure all the scripts are still working the way you intended.

Re: Vatrix's Campaign Fixes

PostPosted: 22 Dec 2014, 10:23
by Esthlos
IMO the original campaigns shouldn't have things like invincible units, magically spawning units
The give us Actions.GiveUnitFromHouse(). :(

Pweeeease :(
  Code:
function TKMScriptActions.GiveUnitFromHouse(aPlayer, aType, aHouseID, aDir: Word): Integer; var U: TKMUnit; H: TKMHouse; aX, aY: Word; begin try Result := UID_NONE; //Verify all input parameters if InRange(aPlayer, 0, gHands.Count - 1) and (gHands[aPlayer].Enabled) and (aType in [UnitTypeToIndex[CITIZEN_MIN] .. UnitTypeToIndex[CITIZEN_MAX]]) and (aHouseID > 0) and (TKMDirection(aDir + 1) in [dir_N .. dir_NW]) then begin H := fIDCache.GetHouse(aHouseID); if H = nil then Exit; aX := H.GetEntrance.X; aY := H.GetEntrance.Y; U := gHands[aPlayer].AddUnit(UnitIndexToType[aType], KMPoint(aX,aY)); if U = nil then Exit; Result := U.UID; U.Direction := TKMDirection(aDir + 1); //Make sure the unit is not locked so the script can use commands like UnitOrderWalk. //By default newly created units are given SetActionLockedStay U.SetActionGoIn(ua_Walk,gd_GoOutside,H); end else LogParamWarning('Actions.GiveUnitFromHouse', [aPlayer, aType, aHouseID, aDir]); except gScriptEvents.ExceptionOutsideScript := True; //Don't blame script for this exception raise; end; end;
(Warning: this code is the result of a mash-up between the unit training code for the SchoolHouse and the GiveUnit function, and has not been tested in any way (!) )

Re: Vatrix's Campaign Fixes

PostPosted: 22 Dec 2014, 13:27
by Swiss Nisi
Ouuuuuuu, thank you, I didn't really thought of making them immortal, nice idea!!!
:)

P.S. By the way, it should be possible to use a similar code to change each Barbarian's max Life Points value to a lower number, if you need to nerf the initial attack in mission 8 in a not too obvious way. :P
I don't like the idea of these magic scripts which change the gameplay/balance in the original campaigns. IMO the original campaigns shouldn't have things like invincible units, magically spawning units, or barbarians with lower life points. Unit statistics should be consistent between missions, you shouldn't make certain units weaker or immortal in some missions just because it suits the balance better. If you want weaker barbarians, just remove some of them or something like that which doesn't change the game rules.

Heavily using scripts also makes it prone to bugs, and probably means the campaigns will need to be checked/updated for every release to make sure all the scripts are still working the way you intended.

Why not fill the school with gold chests from the beginning?
So it wouldn't matter if some Serfs/Builder die...
I think that's way easier than scripting a whole new thing and more realistic/ closer to the original

About Mission 8 and the Barbarians:
I'm still playing with Vatrix variant and there are currently 50 barbarians and 30 militia who attack you in the beginning. Your army consists of 1x12 axefighter/ 1x15 axefighter and 1x15 bowmen and it's pretty easy to survive the first wave.
I dunno if it's the same amount as in the Original (I hated this mission so much that i always skipped it) but it's possible to win/survive the first wave with given army and 4-6 towers.

Re: Vatrix's Campaign Fixes

PostPosted: 22 Dec 2014, 14:02
by Ben
Mission 8 should be challenging. (In the original) Without a clever tower setup, you will be hard pressed to win. That's how it should be in the Remake; though I haven't played TSK campaign since the Remake came out so I don't know what it is like now.

I agree that scripts shouldn't be added to the original campaigns. I think some people are trying to change things simply because they can. If serfs are dying like flies in mission 1 and it is seriously possible to be stuck without serfs, then just fill the school with gold or add a few serfs. Making invincible serfs is a terrible idea in my opinion.

Re: Vatrix's Campaign Fixes

PostPosted: 22 Dec 2014, 14:50
by Esthlos
ok

Image

Re: Vatrix's Campaign Fixes

PostPosted: 22 Dec 2014, 15:27
by Vatrix
I don't like the idea of these magic scripts which change the gameplay/balance in the original campaigns. IMO the original campaigns shouldn't have things like invincible units, magically spawning units, or barbarians with lower life points. Unit statistics should be consistent between missions, you shouldn't make certain units weaker or immortal in some missions just because it suits the balance better. If you want weaker barbarians, just remove some of them or something like that which doesn't change the game rules.

Heavily using scripts also makes it prone to bugs, and probably means the campaigns will need to be checked/updated for every release to make sure all the scripts are still working the way you intended.
I agree that scripts shouldn't be added to the original campaigns. I think some people are trying to change things simply because they can. If serfs are dying like flies in mission 1 and it is seriously possible to be stuck without serfs, then just fill the school with gold or add a few serfs. Making invincible serfs is a terrible idea in my opinion.
Ok, I changed it back, so player now have all units at the beginning.
IMO the original campaigns shouldn't have things like invincible units, magically spawning units
Then give us Actions.GiveUnitFromHouse(). :(

Pweeeease :(
Yea, that would be useful.