You must be logged in to post messages.
Please login or register

Scenario Design
Moderated by Yeebaagooon, nottud

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: Improved Modify Protounit Absolute
posted 06 January 2019 07:33 AM EDT (US)   
For anyone that has used my original modify protounit absolute http://aom.heavengames.com/cgi-bin/forums/display.cgi?action=ct&f=13,29917,0,all there was an issue where some fields that are integer based would not work. I have discovered a second exploit which abuses integer overflow that allows integer fields to be set now too. Below is a modified improved version which should now work with every field.

<Effect name="Modify Protounit Absolute player range">
<Param name="ProtoUnit" dispName="$$22449$$ProtoUnit" varType="protounit">Anubite</Param>
<Param name="p1" dispName="lowest player" VarType="string">1</Param>
<Param name="p2" dispName="highest player" VarType="string">4</Param>
<Param name="Field" dispName="$$23943$$Field" varType="pufield">0</Param>
<Param name="Amount" dispName="Amount" VarType="string">1.0</Param>
<Command>trQuestVarSet("PlayerID", %p1%);</Command>
<Command>while(%p2%>=trQuestVarGet("PlayerID")) {</Command>
<Command>if(%Field% == 6){</Command>
<Command>trModifyProtounit("%ProtoUnit%", 1*trQuestVarGet("playerID"), %Field%, -9999999999999999999.0);</Command>
<Command>trModifyProtounit("%ProtoUnit%", 1*trQuestVarGet("playerID"), %Field%, %Amount% - 1);</Command>
<Command>} else if(%Field% == 5 || %Field% == 7 || %Field% == 10 || %Field% == 13){</Command>
<Command>trModifyProtounit("%ProtoUnit%", 1*trQuestVarGet("playerID"), %Field%, 2147483648.0);</Command>
<Command>trModifyProtounit("%ProtoUnit%", 1*trQuestVarGet("playerID"), %Field%, 2147483648.0);</Command>
<Command>trModifyProtounit("%ProtoUnit%", 1*trQuestVarGet("playerID"), %Field%, %Amount%);</Command>
<Command>} else {</Command>
<Command>trModifyProtounit("%ProtoUnit%", 1*trQuestVarGet("playerID"), %Field%, 9999999999999999999.0);</Command>
<Command>trModifyProtounit("%ProtoUnit%", 1*trQuestVarGet("playerID"), %Field%, -9999999999999999999.0);</Command>
<Command>trModifyProtounit("%ProtoUnit%", 1*trQuestVarGet("playerID"), %Field%, %Amount%);</Command>
<Command>}</Command>
<Command>trQuestVarSet("PlayerID", trQuestVarGet("PlayerID")+1);}</Command>
</Effect>

As for how it works - I am not really sure but essentially if you overflow the integer field it seems to go to the same value regardless by how much, then I just need to normalise to 0 before setting the actual value.

NOTE: I don't know if this improvement will work in the non EE version as the handling of overflow may be different.

[This message has been edited by nottud (edited 01-06-2019 @ 07:39 AM).]

Replies:
posted 06 January 2019 08:27 PM EDT (US)     1 / 11  
Nice!

posted 07 January 2019 01:50 AM EDT (US)     2 / 11  
I remember with the old absolute modify I had some pufield cost overflow into other pufields. It regarded the unit cost which resulted in me getting gold for making units which should've costed 0 gold, probably transforming some vills into Ulfsarks. But dunno & couldn't replicate last time I tried, so might've been some issue on my end.

Azarath Metrion Zinthos

Steam: Order of Azarath
Twitch: twitch.tv/orderofazarath
Discord: Azarath @ https://discord.gg/3ENKJeb
posted 07 January 2019 07:32 AM EDT (US)     3 / 11  
If you get the issue again let me know and I can look into it.

[This message has been edited by nottud (edited 01-07-2019 @ 07:34 AM).]

posted 13 January 2019 10:20 AM EDT (US)     4 / 11  
posted 13 January 2019 11:25 AM EDT (US)     5 / 11  
With "Modify Protounit" you only can change unit stats relative to their starting stats.

If you want an Ulfsark to have 100 HP you'd have to do:
Modify Protounit 20
Modify Protounit Absolute 100

If you ant a Medusa to have 100 HP you'd have to do:
Modify Protounit -260
Modify Protounit Absolute 100

The relative thing is horrible to work with cause you gotta look up all the stats and they could be different on different balance patches or mods or games (old game vs. EE balance).

Azarath Metrion Zinthos

Steam: Order of Azarath
Twitch: twitch.tv/orderofazarath
Discord: Azarath @ https://discord.gg/3ENKJeb
posted 13 January 2019 03:01 PM EDT (US)     6 / 11  
Yea - a big useful I have is say you are playing tower defence and you want everyone's towers to cost 100 gold say:
* Set gold cost: 100
* Set wood cost: 0

This will work regardless of starting cost and as pointed out will not break with game patches.

@Izalith - having your think about your bug - one thing that might have caused your past problem is if you set the stats before the starting god techs activate and it makes the cost cheaper that might result in a bug that you described where it goes negative.

[This message has been edited by nottud (edited 01-13-2019 @ 03:32 PM).]

posted 14 March 2019 09:06 PM EDT (US)     7 / 11  
_

[This message has been edited by Someone_9999 (edited 04-02-2019 @ 04:01 PM).]

posted 15 March 2019 08:20 AM EDT (US)     8 / 11  
I need to do an update - trouble is I have changed the way my triggers are which would make it difficult to release a trigger pack without annoying everyone.
It only affects the base value and does not effect god bonuses or upgrades (like Oranos speed worship bonus) so you don't need to wonder if the result is different.
Not quite true. If you call in run immediately then yes god bonuses are not affected because they applied after the trigger fired. However if you call any other time including high priority it will wipe out the god bonus.

I have got some free time next week so I might look at doing such an update.

[This message has been edited by nottud (edited 03-15-2019 @ 08:22 AM).]

posted 15 March 2019 06:07 PM EDT (US)     9 / 11  
_

[This message has been edited by Someone_9999 (edited 04-02-2019 @ 04:01 PM).]

posted 01 April 2019 04:29 PM EDT (US)     10 / 11  
_

[This message has been edited by Someone_9999 (edited 04-02-2019 @ 04:02 PM).]

posted 02 April 2019 07:20 AM EDT (US)     11 / 11  
I unfortunately became a bit unwell and the remaining time I had chores so sadly the answer currently is no. :/
Age of Mythology Heaven » Forums » Scenario Design » Improved Modify Protounit Absolute
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Age of Mythology Heaven | HeavenGames