As a French person I feel like it's my duty to explain strikes to you. - AdrienIer

Create an account  

 
Caster of Magic II Bug Reports!

I agree that it's a rare event that should be way down on the list of priorities. If it really bothers enough people, you could set up the format for 'check this list for combinations to reroll' and let enthusiasts do the work of compiling a list of specific combinations. Maybe there are other aspects of the game, such as building doomstacks, where the same system would work. Someone might want to make the effort to improve AI war strategy with a list of 'IF THEN' . Someone with enough enthusiasm could write some complex decision trees to make an AI declare war based on its strengths and weaknesses (units, magic, race relations) and the potential targets' strengths and weaknesses. I assume that it's relatively simple to set up a 'call script' function, and then players can download--and mod--whichever updated scripts they desire.
Reply

(June 7th, 2022, 12:06)GMBarak Wrote:
(June 7th, 2022, 11:16)Seravy Wrote: Actually, these pairs are so unless it might make sense to put them into the same "item power group" which makes them mutually exclusive in general, not just for treasure but also item crafting.

Except...it's not that simple.

Doom is useless with + To Hit so they could be in the same group.
Doom and Phantasmal are useless together so they too could be in the same group.
But To Hit and Phantasmal are very good together and so they can't be in the same group, creating a paradox that's not solvable with the existing grouping system.

But wait, some enemies are immune to Illusions so while it's suboptimal, Doom+Illusion on the same item makes sense.
Lightning is pretty much the same (Lightning Resistance).

To be honest these are pretty expensive item powers so the probability of getting two or more on the same item is not that high.

The only clear case I see is not pairing Doom with a To Hit bonus.

The other half of the coin is that this is not something that happens often so it's barely worth the attention. Most items don't have enough budget to add two of these powers and even if they have the chance of actually rolling them is even less especially considering items have a finite "high cost" slots. I'm not entirely sure something that affects probably around 0-3% of the items ever made is really worth a complex solution and additional restrictions.

I actually did get doom+phtantasmal and doom+20%tohit as a main treasure after I put a lot of effort into clearing a two high value zones. I understand if it's not worth the effort fixing it, I guess to avoid disappointment, turning off "More random items" is the best choice for me considering there are 250 well defined ones...

While that works, my personal recommendation would be to simply reload and replay that battle for a new item. While reloading is not recommended in general, reloading for something like that is fair play I think.

I could probably hardcode the rules to which pairs of powers to avoid in like 5 minutes (AI already has them), the problem is, that's not modding friendly, while using the existing "grouping" feature - which already prevents things like having +3 attack and +6 attack on the same item- is. But that might be irrelevant when changing the effects of existing item powers is not supported anyway and new ones can use the grouping feature regardless.
Alternately we can have a new INI file that lists pairs of forbidden item powers but that's...actually at most 10 minutes of extra work I guess. Probably worth it...
Reply

(June 7th, 2022, 14:08)Seravy Wrote:
(June 7th, 2022, 12:06)GMBarak Wrote:
(June 7th, 2022, 11:16)Seravy Wrote: Actually, these pairs are so unless it might make sense to put them into the same "item power group" which makes them mutually exclusive in general, not just for treasure but also item crafting.

Except...it's not that simple.

Doom is useless with + To Hit so they could be in the same group.
Doom and Phantasmal are useless together so they too could be in the same group.
But To Hit and Phantasmal are very good together and so they can't be in the same group, creating a paradox that's not solvable with the existing grouping system.

But wait, some enemies are immune to Illusions so while it's suboptimal, Doom+Illusion on the same item makes sense.
Lightning is pretty much the same (Lightning Resistance).

To be honest these are pretty expensive item powers so the probability of getting two or more on the same item is not that high.

The only clear case I see is not pairing Doom with a To Hit bonus.

The other half of the coin is that this is not something that happens often so it's barely worth the attention. Most items don't have enough budget to add two of these powers and even if they have the chance of actually rolling them is even less especially considering items have a finite "high cost" slots. I'm not entirely sure something that affects probably around 0-3% of the items ever made is really worth a complex solution and additional restrictions.

I actually did get doom+phtantasmal and doom+20%tohit as a main treasure after I put a lot of effort into clearing a two high value zones. I understand if it's not worth the effort fixing it, I guess to avoid disappointment, turning off "More random items" is the best choice for me considering there are 250 well defined ones...

While that works, my personal recommendation would be to simply reload and replay that battle for a new item. While reloading is not recommended in general, reloading for something like that is fair play I think.

I could probably hardcode the rules to which pairs of powers to avoid in like 5 minutes (AI already has them), the problem is, that's not modding friendly, while using the existing "grouping" feature - which already prevents things like having +3 attack and +6 attack on the same item- is. But that might be irrelevant when changing the effects of existing item powers is not supported anyway and new ones can use the grouping feature regardless.
Alternately we can have a new INI file that lists pairs of forbidden item powers but that's...actually at most 10 minutes of extra work I guess. Probably worth it...

Makes sense, thank you! in any case, you have already done an excellent work on this game.
Reply

In unitcalc.cas, "HASCOMBATGLOBAL(W,SP,I)" when I=1, instead of caster's side as state in script.txt, it end up effect both side instead. When I=2, no effect happened at all.
Reply

How did you test this?
I wanted to test it but I can't find a function to get the unit's owner which would be required to have the correct value for W.

We do have Cityowner() but I can't find the equivalent for units. I can't find it as an option in Getstat either.
Without knowing who owns the unit, you can't fill the value for W.
Reply

I using code like this in unitcalc.cas.

Code:
FOR W=0 TO NofWizards();

: New combat enchantment "Beat of Swiftness", all friendly units gain +2 movement and first strike, but -1 defense :
IF HASCOMBATGLOBAL(W,CGBeatOfSwiftness,1) THEN {
SETSTAT U,AFirstStrike,0,1;
SETSTAT U,SDefense,0,(GetStat(U,SDefense,0)-1);
SETSTAT U,SDefensePenalty,0,(GetStat(U,SDefensePenalty,0)+1);
SETSTAT U,SCombatMaxMoves,0,(GetStat(U,SCombatMaxMoves,0)+4);
SETSTAT U,SCombatMovesLeft,0,(GetStat(U,SCombatMovesLeft,0)+4);
}

NEXT;

End result is instead of just caster get effect from this combat enchantment, enemy get its effect too.

When I change to "HASCOMBATGLOBAL(W,CGBeatOfSwiftness,2) " it end up with no one get any effect.

When I change to "HASCOMBATGLOBAL(W,CGBeatOfSwiftness,0) " enemy gain +14 movement without casting anything.
Reply

So in that case, this isn't a bug, it's a missing feature. I'll add the owner to GetStat/SetStat and then you can use GetStat(U,SOwner,1) for the value of W.

Basically, it's this one :
Quote:Seravy, please allow unit owner's player ID to be detected so that we could make unit calc compatible with "HASGLOBAL" and global enchantment owner would able have enchantment limit to their own units.

That also applies to the combat globals, you need the owner.
Reply

Quote:It looks like this is another bug: In the settings there are separate ticks for Sound effects and Music. But if you only disable the music, the sound effects will also be disabled.

Don't remember when or even on which site this was posted but I tested and it works.
The confusing part is that several things you'd think are sound effects are actually music.
Anything that silences the background music to play counts as music, even if it's just 5 seconds in length, like for example most city enchantments.
Anything that plays while the background music is playing counts as a sound effect, for example most unit buffs.
This is consistent with the original game. Files in the "sound" folder count as sound while the "Music" folder counts as music.
Reply

I currently suffer some problem with newly created global enchantment, when player casting it, effect occur on both side (something I intend it to be but it seem currently engine could not recognized I=2 at this moment as it crash) but when ai casting it, it has no effect.

Code:
: global and combat enchantment part start here :
FOR W=0 TO NofWizards();

: New combat enchantment "Hurricane", removing flying from all units, -25% range/thrown/breath to-hit :
IF HASCOMBATGLOBAL(W,CGHurricane,1) THEN {
SETSTAT U,AFlying,0,0;
SETSTAT U,SToRanged,0,(GetStat(U,SToRanged,0)-25);
SETSTAT U,SToThrown,0,(GetStat(U,SToThrown,0)-25);
SETSTAT U,SToBreath,0,(GetStat(U,SToThrown,0)-25);
}

When add this, it crash when ai casting it (but effect occur on my units as intended). error report said that it only recognize 0 or 1 there
Code:
IF HASCOMBATGLOBAL(W,CGHurricane,2) THEN {
SETSTAT U,AFlying,0,0;
SETSTAT U,SToRanged,0,(GetStat(U,SToRanged,0)-25);
SETSTAT U,SToThrown,0,(GetStat(U,SToThrown,0)-25);
SETSTAT U,SToBreath,0,(GetStat(U,SToThrown,0)-25);
}

When add this, effect is implemented without need of casting
Code:
IF HASCOMBATGLOBAL(W,CGHurricane,0) THEN {
SETSTAT U,AFlying,0,0;
SETSTAT U,SToRanged,0,(GetStat(U,SToRanged,0)-25);
SETSTAT U,SToThrown,0,(GetStat(U,SToThrown,0)-25);
SETSTAT U,SToBreath,0,(GetStat(U,SToThrown,0)-25);
}

Edited: I could find method that solve this issue now but using this to turn intrepretation of result to yes or no
Code:
IF (HASCOMBATGLOBAL(W,CGHurricane,2))>0 THEN {
SETSTAT U,AFlying,0,0;
SETSTAT U,SToRanged,0,(GetStat(U,SToRanged,0)-25);
SETSTAT U,SToThrown,0,(GetStat(U,SToThrown,0)-25);
SETSTAT U,SToBreath,0,(GetStat(U,SToThrown,0)-25);
}


Attached Files Thumbnail(s)
   
Reply

Possibly a typo/bug in MODDING.INI: 

line 496: MagicVortexBuildingDesrtuctionrate=5

I did not test ingame yet. Maybe it must to be like this?
Reply



Forum Jump: