Are you, in fact, a pregnant lady who lives in the apartment next door to Superdeath's parents? - Commodore

Create an account  

 
Modding Discussion Thread

(September 6th, 2023, 23:33)mewcatus Wrote: Appreciate some help here.

From the Scripts.txt
----------------------------------------
SETWIZARDDATA C,V,N

Sets a custom wizard variable on wizard W, in the Vth slot, to the value N.
Valid variable slots are 1-100 and the variables can only contain integer values.
----------------------------------------

How does this work? I assume C is supposed to be W, but how do I know what is in the Vth slot? Is there a standard convention to which I must name variables? Should the initial declared variable be setup in Master.CAS ? Once setup how do I refer to it ? Is there a GETWIZARDDATA ? Because if I try to reference to a custom variable declared in Master.CAS, referring to a custom variable directly it just gives the value I set initially within it.

I can't quite believe it works yet, but I just produced normal "Noble" units using "SETCITYDATA C,V,N" and "GETCITYDATA C,V". 
"V" appears to be the number of the variable slot, of which there are 100.

Maybe this will be in the next More Stuff MOD upload...
Reply

I have some question about neutral player ID. Is neutral player ID less than 0 or more than number of wizards opponent?
Reply

I only found this on the topic:

"NOFWIZARDS()
Number of wizards in the current active game, not including the human player. This always equals the last valid wizard ID in the game. The human player is always wizard 0."

To me it looks like Neutrals don't have a player ID?
Have you tried -1? Maybe they can be determined by excluding “《》”?
Reply

(December 2nd, 2023, 08:30)Slingers Wrote: I only found this on the topic:

"NOFWIZARDS()
Number of wizards in the current active game, not including the human player. This always equals the last valid wizard ID in the game. The human player is always wizard 0."

To me it looks like Neutrals don't have a player ID?
Have you tried -1? Maybe they can be determined by excluding “《》”?

Last time I test (a hour ago), it seem that neutral player ID is more than NOFWIZARDS() as result of script that work still the same after I remove part W<0 so I suspect that it likely more than NOFWIZARDS unless there are many neutral ID on both side.
Reply

I don't think it'd be -1. In the DOS versions it's a hard-coded 5 (equal to the max number of total players). Depending on whether it's static or dynamic, it'll likely be either 14 or NOFWIZARDS() + 1 here, respectively.
Reply

(December 2nd, 2023, 22:28)drake178 Wrote: I don't think it'd be -1. In the DOS versions it's a hard-coded 5 (equal to the max number of total players). Depending on whether it's static or dynamic, it'll likely be either 14 or NOFWIZARDS() + 1 here, respectively.

Thank you.
Reply

I think I found a minor bug. Refer to the screen shot below.
https://drive.google.com/file/d/1OwYDlc8Z0wDF2bku93GuSe2pxCXuXWX_/view?usp=sharing


This is the relevant code in EcoFood.CAS

: Lizardman Subaquatic Bonus :
CRace = CITYRACE(CityID);

IF (CRace=10) THEN
{
OTiles = 1.5*TERRAININRANGE(CityID,LTOCean);
STiles = 1.5*TERRAININRANGE(CityID,LTSwamp);
NSResource = OREINRANGE(CITYID,OreNightshade);
GTest = OREINRANGE(CITYID,OreGold);

TBonus = %R(OTiles+STiles+NSResource);

ADDRESLINE "Ocean Tile", %R(OTiles);
ADDRESLINE "Swamp Tile", %R(STiles);
ADDRESLINE "Nightshade", %R(NSResource);
ADDRESLINE "Gold", %R(GTest);
}

As you can see from the Screenshot, it is effectively giving out twice the number of Ores in range. 3 Nightshades yield 6 food, while 1 gold yields 2 food. I am playing on Easy difficulty, but I checked all the Difficulty variables. I don't think food production is being affected. Am I missing something here? 
If not, I will just halve the numbers to get an accurate number. Though I think this would affect the original coding for how wild game works.

ADDRESLINE "Wild Game", 2*OREINRANGE(CITYID,OreWildGame);

EDIT: I think the same error is also occurring with TERRAININRANGE(), giving out twice the number of said tiles in range.

EDIT: found a possible major bug.

This is with regards to AI Combats. They will always call EnterCombat.CAS at the start of a Combat between themselves and neutrals. But they will more often than not skip EndOfCombat.CAS. This is problematic, as I always assumed that whenever EnterCombat.CAS is called, EndOfCombat.CAS is always called. This was always the case whenever I initiated combat or was in a combat where I was involved (Both EnterCombat.CAS and EndOfCombat.CAS would always be called). Is there certain requirements for why EndOfCombat.CAS is not being called selectively at times when it comes to AI Battles?

I am only asking this as I used Enter and Exit Combat scripts to set and clear specific values for the duration of the combat. Much like a memory manager. If there is a reason why, I would have to rework quite a bit of the issues to overland.CAS which is always called, and have to tweak some of the abilities and how they work.

Attached is the log file.
https://drive.google.com/file/d/1aX4oU9w...sp=sharing

If you search for "enter combat" and "end combat", you will notice that "enter combat" is repeatedly called, yet "end combat" is rarely called there after. There are instances where this occurs, which confuses me. Why is this so ?

Take 2 examples.
Enter Combat, Wiz1: 1, Wiz2: 15 called 10+ times.
End Combat, Winner: 1, Winner: 15 was never called.

Enter Combat, Wiz1: 2, Wiz2: 15 also called 10+ times.
End Combat, Winner: 2, Loser: 15 was called only ONCE before the AI Wizards turns ends.

Are there specials rules of engagements when it comes to the AI combats ?

EDIT 3: Okie, after parsing more information, I am getting even more confused. Refer to below.
1st EC: AU[1] = 3
1st EC: AU[2] = 4
1st EC: AU[3] = 53
1st EC: NAU[1] = 75
1st EC: NAU[2] = 76
1st EC: NAU[3] = 77
1st EC: NAU[4] = 78
1st EC: NAU[5] = 79
1st EC: NAU[6] = 80
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 6
1st EC: AU[1] = 3
1st EC: AU[2] = 4
1st EC: AU[3] = 53
1st EC: NAU[1] = 75
1st EC: NAU[2] = 76
1st EC: NAU[3] = 77
1st EC: NAU[4] = 78
1st EC: NAU[5] = 79
1st EC: NAU[6] = 80
1st EC: NAU[7] = 81
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 7
1st EC: AU[1] = 3
1st EC: AU[2] = 4
1st EC: AU[3] = 53
1st EC: NAU[1] = 75
1st EC: NAU[2] = 76
1st EC: NAU[3] = 77
1st EC: NAU[4] = 78
1st EC: NAU[5] = 79
1st EC: NAU[6] = 80
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 6
1st EC: AU[1] = 3
1st EC: AU[2] = 4
1st EC: AU[3] = 53
1st EC: NAU[1] = 75
1st EC: NAU[2] = 76
1st EC: NAU[3] = 77
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 3
1st EC: AU[1] = 3
1st EC: AU[2] = 4
1st EC: AU[3] = 53
1st EC: NAU[1] = 75
1st EC: NAU[2] = 76
1st EC: NAU[3] = 77
1st EC: NAU[4] = 78
1st EC: NAU[5] = 79
1st EC: NAU[6] = 80
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 6
1st EC: AU[1] = 3
1st EC: AU[2] = 4
1st EC: AU[3] = 53
1st EC: NAU[1] = 75
1st EC: NAU[2] = 76
1st EC: NAU[3] = 77
1st EC: NAU[4] = 78
1st EC: NAU[5] = 79
1st EC: NAU[6] = 80
1st EC: NAU[7] = 81
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 7
1st EC: AU[1] = 3
1st EC: AU[2] = 4
1st EC: AU[3] = 53
1st EC: NAU[1] = 75
1st EC: NAU[2] = 76
1st EC: NAU[3] = 77
1st EC: NAU[4] = 78
1st EC: NAU[5] = 79
1st EC: NAU[6] = 80
1st EC: NAU[7] = 81
1st EC: NAU[8] = 82
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 8
1st EC: AU[1] = 3
1st EC: AU[2] = 4
1st EC: AU[3] = 53
1st EC: NAU[1] = 75
1st EC: NAU[2] = 76
1st EC: NAU[3] = 77
1st EC: NAU[4] = 78
1st EC: NAU[5] = 79
1st EC: NAU[6] = 80
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 6
1st EC: AU[1] = 3
1st EC: AU[2] = 4
1st EC: AU[3] = 53
1st EC: NAU[1] = 75
1st EC: NAU[2] = 76
1st EC: NAU[3] = 77
1st EC: NAU[4] = 78
1st EC: NAU[5] = 79
1st EC: NAU[6] = 80
1st EC: NAU[7] = 81
1st EC: NAU[8] = 82
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 8
1st EC: AU[1] = 3
1st EC: AU[2] = 4
1st EC: AU[3] = 53
1st EC: NAU[1] = 75
1st EC: NAU[2] = 76
1st EC: NAU[3] = 77
1st EC: NAU[4] = 78
1st EC: NAU[5] = 79
1st EC: NAU[6] = 80
1st EC: NAU[7] = 81
1st EC: NAU[8] = 82
1st EC: NAU[9] = 83
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 9
1st EC: AU[1] = 3
1st EC: AU[2] = 4
1st EC: AU[3] = 53
1st EC: NAU[1] = 75
1st EC: NAU[2] = 76
1st EC: NAU[3] = 77
1st EC: NAU[4] = 78
1st EC: NAU[5] = 79
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 5
1st EC: AU[1] = 3
1st EC: AU[2] = 4
1st EC: NAU[1] = 10
1st EC: NAU[2] = 11
1st EC: NAU[3] = 12
1st EC: NAU[4] = 13
1st EC: AU[3] = 53
1st EC: NAU[5] = 58
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 5

Notice that this is not many separate instances of combat, as there is no way the AI can move and attack so many times in 1 turn using the same stack of units.

The unit IDs in this instance is 3,4,53. Which refers to the 3 units on Wiz1's side. If feels like the neutral units stacks available are being cycled through to find a suitable strength level foe stack to fight? That would mean that they are figuratively jumping all over the map. Is that what is happening ? But even then, EndOfCombat is not called when combat ends?

EDIT 4:
1st EC: AU[1] = 3, OLX : 23, OLY: 22
1st EC: AU[2] = 4, OLX : 23, OLY: 22
1st EC: AU[3] = 53, OLX : 23, OLY: 22
1st EC: NAU[1] = 75, OLX : 23, OLY: 22
1st EC: NAU[2] = 76, OLX : 23, OLY: 22
1st EC: NAU[3] = 77, OLX : 23, OLY: 22
1st EC: NAU[4] = 78, OLX : 23, OLY: 22
1st EC: NAU[5] = 79, OLX : 23, OLY: 22
1st EC: NAU[6] = 80, OLX : 23, OLY: 22
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 6
1st EC: AU[1] = 3, OLX : 26, OLY: 14
1st EC: AU[2] = 4, OLX : 26, OLY: 14
1st EC: AU[3] = 53, OLX : 26, OLY: 14
1st EC: NAU[1] = 75, OLX : 26, OLY: 14
1st EC: NAU[2] = 76, OLX : 26, OLY: 14
1st EC: NAU[3] = 77, OLX : 26, OLY: 14
1st EC: NAU[4] = 78, OLX : 26, OLY: 14
1st EC: NAU[5] = 79, OLX : 26, OLY: 14
1st EC: NAU[6] = 80, OLX : 26, OLY: 14
1st EC: NAU[7] = 81, OLX : 26, OLY: 14
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 7
1st EC: AU[1] = 3, OLX : 30, OLY: 7
1st EC: AU[2] = 4, OLX : 30, OLY: 7
1st EC: AU[3] = 53, OLX : 30, OLY: 7
1st EC: NAU[1] = 75, OLX : 30, OLY: 7
1st EC: NAU[2] = 76, OLX : 30, OLY: 7
1st EC: NAU[3] = 77, OLX : 30, OLY: 7
1st EC: NAU[4] = 78, OLX : 30, OLY: 7
1st EC: NAU[5] = 79, OLX : 30, OLY: 7
1st EC: NAU[6] = 80, OLX : 30, OLY: 7
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 6
1st EC: AU[1] = 3, OLX : 34, OLY: 5
1st EC: AU[2] = 4, OLX : 34, OLY: 5
1st EC: AU[3] = 53, OLX : 34, OLY: 5
1st EC: NAU[1] = 75, OLX : 34, OLY: 5
1st EC: NAU[2] = 76, OLX : 34, OLY: 5
1st EC: NAU[3] = 77, OLX : 34, OLY: 5
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 3
1st EC: AU[1] = 3, OLX : 34, OLY: 20
1st EC: AU[2] = 4, OLX : 34, OLY: 20
1st EC: AU[3] = 53, OLX : 34, OLY: 20
1st EC: NAU[1] = 75, OLX : 34, OLY: 20
1st EC: NAU[2] = 76, OLX : 34, OLY: 20
1st EC: NAU[3] = 77, OLX : 34, OLY: 20
1st EC: NAU[4] = 78, OLX : 34, OLY: 20
1st EC: NAU[5] = 79, OLX : 34, OLY: 20
1st EC: NAU[6] = 80, OLX : 34, OLY: 20
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 6
1st EC: AU[1] = 3, OLX : 37, OLY: 14
1st EC: AU[2] = 4, OLX : 37, OLY: 14
1st EC: AU[3] = 53, OLX : 37, OLY: 14
1st EC: NAU[1] = 75, OLX : 37, OLY: 14
1st EC: NAU[2] = 76, OLX : 37, OLY: 14
1st EC: NAU[3] = 77, OLX : 37, OLY: 14
1st EC: NAU[4] = 78, OLX : 37, OLY: 14
1st EC: NAU[5] = 79, OLX : 37, OLY: 14
1st EC: NAU[6] = 80, OLX : 37, OLY: 14
1st EC: NAU[7] = 81, OLX : 37, OLY: 14
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 7
1st EC: AU[1] = 3, OLX : 37, OLY: 15
1st EC: AU[2] = 4, OLX : 37, OLY: 15
1st EC: AU[3] = 53, OLX : 37, OLY: 15
1st EC: NAU[1] = 75, OLX : 37, OLY: 15
1st EC: NAU[2] = 76, OLX : 37, OLY: 15
1st EC: NAU[3] = 77, OLX : 37, OLY: 15
1st EC: NAU[4] = 78, OLX : 37, OLY: 15
1st EC: NAU[5] = 79, OLX : 37, OLY: 15
1st EC: NAU[6] = 80, OLX : 37, OLY: 15
1st EC: NAU[7] = 81, OLX : 37, OLY: 15
1st EC: NAU[8] = 82, OLX : 37, OLY: 15
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 8
1st EC: AU[1] = 3, OLX : 38, OLY: 5
1st EC: AU[2] = 4, OLX : 38, OLY: 5
1st EC: AU[3] = 53, OLX : 38, OLY: 5
1st EC: NAU[1] = 75, OLX : 38, OLY: 5
1st EC: NAU[2] = 76, OLX : 38, OLY: 5
1st EC: NAU[3] = 77, OLX : 38, OLY: 5
1st EC: NAU[4] = 78, OLX : 38, OLY: 5
1st EC: NAU[5] = 79, OLX : 38, OLY: 5
1st EC: NAU[6] = 80, OLX : 38, OLY: 5
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 6
1st EC: AU[1] = 3, OLX : 38, OLY: 6
1st EC: AU[2] = 4, OLX : 38, OLY: 6
1st EC: AU[3] = 53, OLX : 38, OLY: 6
1st EC: NAU[1] = 75, OLX : 38, OLY: 6
1st EC: NAU[2] = 76, OLX : 38, OLY: 6
1st EC: NAU[3] = 77, OLX : 38, OLY: 6
1st EC: NAU[4] = 78, OLX : 38, OLY: 6
1st EC: NAU[5] = 79, OLX : 38, OLY: 6
1st EC: NAU[6] = 80, OLX : 38, OLY: 6
1st EC: NAU[7] = 81, OLX : 38, OLY: 6
1st EC: NAU[8] = 82, OLX : 38, OLY: 6
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 8
1st EC: AU[1] = 3, OLX : 38, OLY: 8
1st EC: AU[2] = 4, OLX : 38, OLY: 8
1st EC: AU[3] = 53, OLX : 38, OLY: 8
1st EC: NAU[1] = 75, OLX : 38, OLY: 8
1st EC: NAU[2] = 76, OLX : 38, OLY: 8
1st EC: NAU[3] = 77, OLX : 38, OLY: 8
1st EC: NAU[4] = 78, OLX : 38, OLY: 8
1st EC: NAU[5] = 79, OLX : 38, OLY: 8
1st EC: NAU[6] = 80, OLX : 38, OLY: 8
1st EC: NAU[7] = 81, OLX : 38, OLY: 8
1st EC: NAU[8] = 82, OLX : 38, OLY: 8
1st EC: NAU[9] = 83, OLX : 38, OLY: 8
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 9
1st EC: AU[1] = 3, OLX : 40, OLY: 9
1st EC: AU[2] = 4, OLX : 40, OLY: 9
1st EC: AU[3] = 53, OLX : 40, OLY: 9
1st EC: NAU[1] = 75, OLX : 40, OLY: 9
1st EC: NAU[2] = 76, OLX : 40, OLY: 9
1st EC: NAU[3] = 77, OLX : 40, OLY: 9
1st EC: NAU[4] = 78, OLX : 40, OLY: 9
1st EC: NAU[5] = 79, OLX : 40, OLY: 9
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 5
1st EC: AU[1] = 3, OLX : 42, OLY: 6
1st EC: AU[2] = 4, OLX : 42, OLY: 6
1st EC: NAU[1] = 10, OLX : 42, OLY: 6
1st EC: NAU[2] = 11, OLX : 42, OLY: 6
1st EC: NAU[3] = 12, OLX : 42, OLY: 6
1st EC: NAU[4] = 13, OLX : 42, OLY: 6
1st EC: AU[3] = 53, OLX : 42, OLY: 6
1st EC: NAU[5] = 58, OLX : 42, OLY: 6
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 5

My suspicions were correctly, the same 3 units are effectively jumping all over the map to search for a stack of their same power level to fight. Until it does, it keeps calling the Enter Combat Script over and over again! Perks of being AI. I assume this is standard AI operating procedure. 
Well, I have to put in a bunch of safety reset checks at the start of combat to ensure the values are correctly set. I was hoping to put off any AI related combat Behaviour until I was done with the basics, looks like I just have to start factoring in that now.
Reply

EDIT5:
Rjak AI turn, phase 6 Attack starts
1st EC: AU[1] = 3, OLX : 23, OLY: 22
1st EC: AU[2] = 4, OLX : 23, OLY: 22
1st EC: AU[3] = 53, OLX : 23, OLY: 22
1st EC: NAU[1] = 75, OLX : 23, OLY: 22
1st EC: NAU[2] = 76, OLX : 23, OLY: 22
1st EC: NAU[3] = 77, OLX : 23, OLY: 22
1st EC: NAU[4] = 78, OLX : 23, OLY: 22
1st EC: NAU[5] = 79, OLX : 23, OLY: 22
1st EC: NAU[6] = 80, OLX : 23, OLY: 22
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 6
1st EC: AU[1] = 3, OLX : 26, OLY: 14
1st EC: AU[2] = 4, OLX : 26, OLY: 14
1st EC: AU[3] = 53, OLX : 26, OLY: 14
1st EC: NAU[1] = 75, OLX : 26, OLY: 14
1st EC: NAU[2] = 76, OLX : 26, OLY: 14
1st EC: NAU[3] = 77, OLX : 26, OLY: 14
1st EC: NAU[4] = 78, OLX : 26, OLY: 14
1st EC: NAU[5] = 79, OLX : 26, OLY: 14
1st EC: NAU[6] = 80, OLX : 26, OLY: 14
1st EC: NAU[7] = 81, OLX : 26, OLY: 14
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 7
1st EC: AU[1] = 3, OLX : 30, OLY: 7
1st EC: AU[2] = 4, OLX : 30, OLY: 7
1st EC: AU[3] = 53, OLX : 30, OLY: 7
1st EC: NAU[1] = 75, OLX : 30, OLY: 7
1st EC: NAU[2] = 76, OLX : 30, OLY: 7
1st EC: NAU[3] = 77, OLX : 30, OLY: 7
1st EC: NAU[4] = 78, OLX : 30, OLY: 7
1st EC: NAU[5] = 79, OLX : 30, OLY: 7
1st EC: NAU[6] = 80, OLX : 30, OLY: 7
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 6
1st EC: AU[1] = 3, OLX : 34, OLY: 5
1st EC: AU[2] = 4, OLX : 34, OLY: 5
1st EC: AU[3] = 53, OLX : 34, OLY: 5
1st EC: NAU[1] = 75, OLX : 34, OLY: 5
1st EC: NAU[2] = 76, OLX : 34, OLY: 5
1st EC: NAU[3] = 77, OLX : 34, OLY: 5
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 3
1st EC: AU[1] = 3, OLX : 34, OLY: 20
1st EC: AU[2] = 4, OLX : 34, OLY: 20
1st EC: AU[3] = 53, OLX : 34, OLY: 20
1st EC: NAU[1] = 75, OLX : 34, OLY: 20
1st EC: NAU[2] = 76, OLX : 34, OLY: 20
1st EC: NAU[3] = 77, OLX : 34, OLY: 20
1st EC: NAU[4] = 78, OLX : 34, OLY: 20
1st EC: NAU[5] = 79, OLX : 34, OLY: 20
1st EC: NAU[6] = 80, OLX : 34, OLY: 20
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 6
1st EC: AU[1] = 3, OLX : 37, OLY: 14
1st EC: AU[2] = 4, OLX : 37, OLY: 14
1st EC: AU[3] = 53, OLX : 37, OLY: 14
1st EC: NAU[1] = 75, OLX : 37, OLY: 14
1st EC: NAU[2] = 76, OLX : 37, OLY: 14
1st EC: NAU[3] = 77, OLX : 37, OLY: 14
1st EC: NAU[4] = 78, OLX : 37, OLY: 14
1st EC: NAU[5] = 79, OLX : 37, OLY: 14
1st EC: NAU[6] = 80, OLX : 37, OLY: 14
1st EC: NAU[7] = 81, OLX : 37, OLY: 14
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 7
1st EC: AU[1] = 3, OLX : 37, OLY: 15
1st EC: AU[2] = 4, OLX : 37, OLY: 15
1st EC: AU[3] = 53, OLX : 37, OLY: 15
1st EC: NAU[1] = 75, OLX : 37, OLY: 15
1st EC: NAU[2] = 76, OLX : 37, OLY: 15
1st EC: NAU[3] = 77, OLX : 37, OLY: 15
1st EC: NAU[4] = 78, OLX : 37, OLY: 15
1st EC: NAU[5] = 79, OLX : 37, OLY: 15
1st EC: NAU[6] = 80, OLX : 37, OLY: 15
1st EC: NAU[7] = 81, OLX : 37, OLY: 15
1st EC: NAU[8] = 82, OLX : 37, OLY: 15
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 8
1st EC: AU[1] = 3, OLX : 38, OLY: 5
1st EC: AU[2] = 4, OLX : 38, OLY: 5
1st EC: AU[3] = 53, OLX : 38, OLY: 5
1st EC: NAU[1] = 75, OLX : 38, OLY: 5
1st EC: NAU[2] = 76, OLX : 38, OLY: 5
1st EC: NAU[3] = 77, OLX : 38, OLY: 5
1st EC: NAU[4] = 78, OLX : 38, OLY: 5
1st EC: NAU[5] = 79, OLX : 38, OLY: 5
1st EC: NAU[6] = 80, OLX : 38, OLY: 5
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 6
1st EC: AU[1] = 3, OLX : 38, OLY: 6
1st EC: AU[2] = 4, OLX : 38, OLY: 6
1st EC: AU[3] = 53, OLX : 38, OLY: 6
1st EC: NAU[1] = 75, OLX : 38, OLY: 6
1st EC: NAU[2] = 76, OLX : 38, OLY: 6
1st EC: NAU[3] = 77, OLX : 38, OLY: 6
1st EC: NAU[4] = 78, OLX : 38, OLY: 6
1st EC: NAU[5] = 79, OLX : 38, OLY: 6
1st EC: NAU[6] = 80, OLX : 38, OLY: 6
1st EC: NAU[7] = 81, OLX : 38, OLY: 6
1st EC: NAU[8] = 82, OLX : 38, OLY: 6
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 8
1st EC: AU[1] = 3, OLX : 38, OLY: 8
1st EC: AU[2] = 4, OLX : 38, OLY: 8
1st EC: AU[3] = 53, OLX : 38, OLY: 8
1st EC: NAU[1] = 75, OLX : 38, OLY: 8
1st EC: NAU[2] = 76, OLX : 38, OLY: 8
1st EC: NAU[3] = 77, OLX : 38, OLY: 8
1st EC: NAU[4] = 78, OLX : 38, OLY: 8
1st EC: NAU[5] = 79, OLX : 38, OLY: 8
1st EC: NAU[6] = 80, OLX : 38, OLY: 8
1st EC: NAU[7] = 81, OLX : 38, OLY: 8
1st EC: NAU[8] = 82, OLX : 38, OLY: 8
1st EC: NAU[9] = 83, OLX : 38, OLY: 8
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 9
1st EC: AU[1] = 3, OLX : 40, OLY: 9
1st EC: AU[2] = 4, OLX : 40, OLY: 9
1st EC: AU[3] = 53, OLX : 40, OLY: 9
1st EC: NAU[1] = 75, OLX : 40, OLY: 9
1st EC: NAU[2] = 76, OLX : 40, OLY: 9
1st EC: NAU[3] = 77, OLX : 40, OLY: 9
1st EC: NAU[4] = 78, OLX : 40, OLY: 9
1st EC: NAU[5] = 79, OLX : 40, OLY: 9
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 5
1st EC: AU[1] = 3, OLX : 42, OLY: 6
1st EC: AU[2] = 4, OLX : 42, OLY: 6
1st EC: NAU[1] = 10, OLX : 42, OLY: 6
1st EC: NAU[2] = 11, OLX : 42, OLY: 6
1st EC: NAU[3] = 12, OLX : 42, OLY: 6
1st EC: NAU[4] = 13, OLX : 42, OLY: 6
1st EC: AU[3] = 53, OLX : 42, OLY: 6
1st EC: NAU[5] = 58, OLX : 42, OLY: 6
Enter Combat, Wiz1: 1, AUNum: 3, Wiz2: 15, NAUNum: 5
Rjak AI turn, phase 6 execute
Stack of 3 units moves from 1,33,9 to 42,6
Post Processing movement
Move is not shown/visible to the human player
Stack arrives to 34,10 plane :1
Automove called after move animation
Exit post processing function
Rjak AI turn, phase 7 Purify starts


Horus AI turn, phase 6 Attack starts
1st EC: AU[1] = 6, OLX : 24, OLY: 30
1st EC: AU[2] = 38, OLX : 24, OLY: 30
1st EC: AU[3] = 46, OLX : 24, OLY: 30
1st EC: NAU[1] = 75, OLX : 24, OLY: 30
1st EC: NAU[2] = 76, OLX : 24, OLY: 30
Enter Combat, Wiz1: 2, AUNum: 3, Wiz2: 15, NAUNum: 2
1st EC: AU[1] = 6, OLX : 27, OLY: 38
1st EC: AU[2] = 38, OLX : 27, OLY: 38
1st EC: AU[3] = 46, OLX : 27, OLY: 38
1st EC: NAU[1] = 75, OLX : 27, OLY: 38
1st EC: NAU[2] = 76, OLX : 27, OLY: 38
1st EC: NAU[3] = 77, OLX : 27, OLY: 38
1st EC: NAU[4] = 78, OLX : 27, OLY: 38
1st EC: NAU[5] = 79, OLX : 27, OLY: 38
Enter Combat, Wiz1: 2, AUNum: 3, Wiz2: 15, NAUNum: 5
1st EC: AU[1] = 6, OLX : 28, OLY: 42
1st EC: AU[2] = 38, OLX : 28, OLY: 42
1st EC: AU[3] = 46, OLX : 28, OLY: 42
1st EC: NAU[1] = 75, OLX : 28, OLY: 42
1st EC: NAU[2] = 76, OLX : 28, OLY: 42
Enter Combat, Wiz1: 2, AUNum: 3, Wiz2: 15, NAUNum: 2
1st EC: AU[1] = 6, OLX : 29, OLY: 31
1st EC: AU[2] = 38, OLX : 29, OLY: 31
1st EC: AU[3] = 46, OLX : 29, OLY: 31
1st EC: NAU[1] = 75, OLX : 29, OLY: 31
1st EC: NAU[2] = 76, OLX : 29, OLY: 31
1st EC: NAU[3] = 77, OLX : 29, OLY: 31
1st EC: NAU[4] = 78, OLX : 29, OLY: 31
1st EC: NAU[5] = 79, OLX : 29, OLY: 31
1st EC: NAU[6] = 80, OLX : 29, OLY: 31
1st EC: NAU[7] = 81, OLX : 29, OLY: 31
1st EC: NAU[8] = 82, OLX : 29, OLY: 31
1st EC: NAU[9] = 83, OLX : 29, OLY: 31
Enter Combat, Wiz1: 2, AUNum: 3, Wiz2: 15, NAUNum: 9
1st EC: AU[1] = 6, OLX : 29, OLY: 42
1st EC: AU[2] = 38, OLX : 29, OLY: 42
1st EC: AU[3] = 46, OLX : 29, OLY: 42
1st EC: NAU[1] = 75, OLX : 29, OLY: 42
1st EC: NAU[2] = 76, OLX : 29, OLY: 42
1st EC: NAU[3] = 77, OLX : 29, OLY: 42
1st EC: NAU[4] = 78, OLX : 29, OLY: 42
1st EC: NAU[5] = 79, OLX : 29, OLY: 42
1st EC: NAU[6] = 80, OLX : 29, OLY: 42
1st EC: NAU[7] = 81, OLX : 29, OLY: 42
Enter Combat, Wiz1: 2, AUNum: 3, Wiz2: 15, NAUNum: 7
1st EC: AU[1] = 6, OLX : 30, OLY: 26
1st EC: AU[2] = 38, OLX : 30, OLY: 26
1st EC: AU[3] = 46, OLX : 30, OLY: 26
1st EC: NAU[1] = 75, OLX : 30, OLY: 26
1st EC: NAU[2] = 76, OLX : 30, OLY: 26
1st EC: NAU[3] = 77, OLX : 30, OLY: 26
1st EC: NAU[4] = 78, OLX : 30, OLY: 26
1st EC: NAU[5] = 79, OLX : 30, OLY: 26
1st EC: NAU[6] = 80, OLX : 30, OLY: 26
1st EC: NAU[7] = 81, OLX : 30, OLY: 26
1st EC: NAU[8] = 82, OLX : 30, OLY: 26
Enter Combat, Wiz1: 2, AUNum: 3, Wiz2: 15, NAUNum: 8
1st EC: AU[1] = 6, OLX : 30, OLY: 34
1st EC: AU[2] = 38, OLX : 30, OLY: 34
1st EC: AU[3] = 46, OLX : 30, OLY: 34
1st EC: NAU[1] = 75, OLX : 30, OLY: 34
Enter Combat, Wiz1: 2, AUNum: 3, Wiz2: 15, NAUNum: 1
1st EC: AU[1] = 6, OLX : 30, OLY: 42
1st EC: AU[2] = 38, OLX : 30, OLY: 42
1st EC: AU[3] = 46, OLX : 30, OLY: 42
1st EC: NAU[1] = 75, OLX : 30, OLY: 42
1st EC: NAU[2] = 76, OLX : 30, OLY: 42
1st EC: NAU[3] = 77, OLX : 30, OLY: 42
1st EC: NAU[4] = 78, OLX : 30, OLY: 42
1st EC: NAU[5] = 79, OLX : 30, OLY: 42
1st EC: NAU[6] = 80, OLX : 30, OLY: 42
1st EC: NAU[7] = 81, OLX : 30, OLY: 42
Enter Combat, Wiz1: 2, AUNum: 3, Wiz2: 15, NAUNum: 7
1st EC: AU[1] = 6, OLX : 32, OLY: 24
1st EC: AU[2] = 38, OLX : 32, OLY: 24
1st EC: AU[3] = 46, OLX : 32, OLY: 24
1st EC: NAU[1] = 75, OLX : 32, OLY: 24
1st EC: NAU[2] = 76, OLX : 32, OLY: 24
1st EC: NAU[3] = 77, OLX : 32, OLY: 24
1st EC: NAU[4] = 78, OLX : 32, OLY: 24
1st EC: NAU[5] = 79, OLX : 32, OLY: 24
1st EC: NAU[6] = 80, OLX : 32, OLY: 24
Enter Combat, Wiz1: 2, AUNum: 3, Wiz2: 15, NAUNum: 6
1st EC: AU[1] = 6, OLX : 32, OLY: 25
1st EC: AU[2] = 38, OLX : 32, OLY: 25
1st EC: AU[3] = 46, OLX : 32, OLY: 25
1st EC: NAU[1] = 75, OLX : 32, OLY: 25
1st EC: NAU[2] = 76, OLX : 32, OLY: 25
1st EC: NAU[3] = 77, OLX : 32, OLY: 25
1st EC: NAU[4] = 78, OLX : 32, OLY: 25
1st EC: NAU[5] = 79, OLX : 32, OLY: 25
1st EC: NAU[6] = 80, OLX : 32, OLY: 25
1st EC: NAU[7] = 81, OLX : 32, OLY: 25
1st EC: NAU[8] = 82, OLX : 32, OLY: 25
1st EC: NAU[9] = 83, OLX : 32, OLY: 25
Enter Combat, Wiz1: 2, AUNum: 3, Wiz2: 15, NAUNum: 9
1st EC: AU[1] = 6, OLX : 32, OLY: 38
1st EC: AU[2] = 38, OLX : 32, OLY: 38
1st EC: AU[3] = 46, OLX : 32, OLY: 38
1st EC: NAU[1] = 75, OLX : 32, OLY: 38
1st EC: NAU[2] = 76, OLX : 32, OLY: 38
1st EC: NAU[3] = 77, OLX : 32, OLY: 38
1st EC: NAU[4] = 78, OLX : 32, OLY: 38
Enter Combat, Wiz1: 2, AUNum: 3, Wiz2: 15, NAUNum: 4
1st EC: AU[1] = 6, OLX : 34, OLY: 34
1st EC: AU[2] = 38, OLX : 34, OLY: 34
1st EC: AU[3] = 46, OLX : 34, OLY: 34
1st EC: NAU[1] = 75, OLX : 34, OLY: 34
1st EC: NAU[2] = 76, OLX : 34, OLY: 34
1st EC: NAU[3] = 77, OLX : 34, OLY: 34
1st EC: NAU[4] = 78, OLX : 34, OLY: 34
1st EC: NAU[5] = 79, OLX : 34, OLY: 34
1st EC: NAU[6] = 80, OLX : 34, OLY: 34
1st EC: NAU[7] = 81, OLX : 34, OLY: 34
1st EC: NAU[8] = 82, OLX : 34, OLY: 34
Enter Combat, Wiz1: 2, AUNum: 3, Wiz2: 15, NAUNum: 8
1st EC: AU[1] = 6, OLX : 34, OLY: 39
1st EC: AU[2] = 38, OLX : 34, OLY: 39
1st EC: AU[3] = 46, OLX : 34, OLY: 39
1st EC: NAU[1] = 75, OLX : 34, OLY: 39
1st EC: NAU[2] = 76, OLX : 34, OLY: 39
Enter Combat, Wiz1: 2, AUNum: 3, Wiz2: 15, NAUNum: 2
1st EC: AU[1] = 6, OLX : 34, OLY: 41
1st EC: AU[2] = 38, OLX : 34, OLY: 41
1st EC: AU[3] = 46, OLX : 34, OLY: 41
1st EC: NAU[1] = 75, OLX : 34, OLY: 41
1st EC: NAU[2] = 76, OLX : 34, OLY: 41
1st EC: NAU[3] = 77, OLX : 34, OLY: 41
1st EC: NAU[4] = 78, OLX : 34, OLY: 41
1st EC: NAU[5] = 79, OLX : 34, OLY: 41
Enter Combat, Wiz1: 2, AUNum: 3, Wiz2: 15, NAUNum: 5
1st EC: AU[1] = 6, OLX : 35, OLY: 24
1st EC: AU[2] = 38, OLX : 35, OLY: 24
1st EC: AU[3] = 46, OLX : 35, OLY: 24
1st EC: NAU[1] = 75, OLX : 35, OLY: 24
1st EC: NAU[2] = 76, OLX : 35, OLY: 24
Enter Combat, Wiz1: 2, AUNum: 3, Wiz2: 15, NAUNum: 2
Horus AI turn, phase 6 execute
Stack of 3 units moves from 1,33,25 to 35,24
Post Processing movement
Move is not shown/visible to the human player
Stack arrives to 35,24 plane :1
Stack initiates combat!
Entered combat at X=35, Y=24P =1
1st EC: AU[1] = 6, OLX : 35, OLY: 24
1st EC: AU[2] = 38, OLX : 35, OLY: 24
1st EC: AU[3] = 46, OLX : 35, OLY: 24
1st EC: NAU[1] = 75, OLX : 35, OLY: 24
1st EC: NAU[2] = 76, OLX : 35, OLY: 24
Enter Combat, Wiz1: 2, AUNum: 3, Wiz2: 15, NAUNum: 2
Army #1
MELEE=640
ANTIFLYMELEE=0
MISSILERANGED=0
MAGICRANGED=0
OTHERRANGED=0
HP=14(Invis :0,Flying :0,Miss.Im. :14,Mag.Im :0)
SAVEORDIE=0
POISON=0
RANGEDSAVE=0
RANGEDPOISON=0
AMMO=0
Casting Buff = 0
Casting RBuff = 0
Casting DD = 0
Casting Curse = 0
Casting Summon = 0
Casting Global = 0
Casting Antifly = 0
Army #2
MELEE=0
ANTIFLYMELEE=368.823109287447
MISSILERANGED=272.579831865465
MAGICRANGED=0
OTHERRANGED=0
HP=18(Invis :0,Flying :0,Miss.Im. :0,Mag.Im :0)
SAVEORDIE=0
POISON=0
RANGEDSAVE=0
RANGEDPOISON=0
AMMO=8
Casting Buff = 10
Casting RBuff = 4
Casting DD = 6
Casting Curse = 4
Casting Summon = 2
Casting Global = 16
Casting Antifly = 0.1
Combat turn 1 player 1
Combat turn 1 player 2
Casting uses 40*Range MP
Buff = 10
Buff Ranged = 10
Damage = 0
Curse = 66
Summon = 12
Spellcasting Buff grants 9.504 HP
Spellcasting Buff grants 0.55008 HP
Spellcasting Ranged Buff grants 0.8 % ranged attack strength
Spellcasting Curse deals 10.56 damage
Spellcasting Summoning grants 2.4 HP and 57.6 attack rating
Army deals 1.83173647013593 Missile Ranged damage
Combat turn 2 player 1
Combat turn 2 player 2
Casting uses 20*Range MP
Buff = 10
Buff Ranged = 10
Damage = 0
Curse = 69
Summon = 10
Spellcasting Buff grants 0.3045408 HP
Spellcasting Ranged Buff grants 0.4 % ranged attack strength
Spellcasting Curse deals 5.52 damage
Spellcasting Summoning grants 1 HP and 24 attack rating
Army deals 1.83906341601647 Missile Ranged damage
Horus spent 60 mana!
Defenderlossrate Neutral=1
Attackerlossrate Horus=0
Defeated : Neutral's Skeletons died in battle!
Defeated : Neutral's Skeletons died in battle!
EOC: AU[1] = 6
EOC: AU[2] = 38
EOC: AU[3] = 46
EOC: NAU[1] = 75
EOC: NAU[2] = 76
End Combat, Winner: 2, AUNum: 3, Loser: 15, NAUNum: 2
Treasure found by Horus
You have found 120 gold pieces.
Left combat at X=35, Y=24P =1
Exit post processing function
Horus AI turn, phase 7 Purify starts

Interesting, after parsing more data, I finally get it now. 1st example, the AI uses EnterCombat even if it actually does not engage in a fight. It uses it as a way to gauge enemy strength, if it is too strong, it just ignores it and moves to a destination, bypassing the fight entirely. This is evident when you read from "Rjak AI turn, phase 6 Attack starts" to " Rjak AI turn, phase 7 Purify starts" Notice that neither CombatEndTurn nor EndCombat was ever called in this instance.

Referring to the 2nd example, the AI uses EnterCombat to search for an appropriate foe strength to fight. It found one, then initiates combat. When it wins, End Combat is called in this instance. Notice that CombatEndTurn is never called throughout the process. So I can safely make the following assumptions with regards to what scripts are called for AI to AI Combat.

1. EnterCombat is always called, but is used as a way to gauge enemy strength. This can occur multiple times. This matters if say, you have an ability dealing damage at the start of combat.
2. CombatEndTurn is never called, so CombatEndTurn script is not invoked inbetween EnterCombat and EndCombat. Anything done by this can only be between Player vs AI.
3. EndCombat is called if the AI actually chooses to initiate combat.

A very dry parsing, but interesting to know when implementing certain mechanics. Hope this is useful to modders out there.
Reply

Is it possible to script spawning of units overland and I combat? I have idea of roaming sea monsters and neutral demihero lead their raider stack. but not sure if it is possible to implement or not
Reply

(December 14th, 2023, 03:19)Suppanut Wrote: Is it possible to script spawning of units overland  and I combat? I have idea of roaming sea monsters and neutral demihero lead their raider stack. but not sure if it is possible to implement or not

This is also I like to see too. one item on my bucket list is to create specialized lairs with specfic units and specific rewards, along with spawning them based on time, creating chained events leading to more horrific lairs that eventually lead to better loot, defeating specific lairs unlocks chaining events. etc
Reply



Forum Jump: