How do we edit the new task features via xsScript?

Task 154: Loot

Triggered when Killing/Converting a target
unit ID and class ID control which object it can be. If neither are set, then it is any object. Has to be an object that can increase the kill/razing/conversions stats
Work Value 1: Amount of Resource received
Resource Out: Resource type to receive
Productivity Resource: if set, task only activate the task if:
    If positive value: requires the value of the associated resource to be ≠ 0
        the value of this resource is used as multiplier of the amount received
    If negative value: requires the tech of the associated ID to have been researched
Resource in: if set, the tech effect with that ID will fire
Unused 4th resource: if set, the tech effect with ID of this resource’s value will fire
Work range: if 0, all above effects apply to the player who owns the attacking object. If != 0, then to the target object’s player
**New: Proceeding Graphic: Graphic to be played over the unit when triggered**

** New: Resource Gathering Sound: Sound to be played when triggered**
** New: Work Flag: if set, maximum number of time this unit can trigger the task**
** New: Carry Check: if set, all Tasks 154 with the same Carry Check ID will count towards the same cap**
New: If Unused Flag is set to 1, unit veterancy effect:
Search Wait Time: Attribute ID to improve
Gather Type: Value of the improvement

Task 155: Aura

Requires Combat Ability 32
Search Wait Time – attribute number which is modified
Work value 1 – attribute increase at the maximum power up.
Work value 2 – units required for the maximum power up.
Work range – range of the effect.
Target diplomacy – players whose objects will be affected.
**New: Proceeding Graphic: Graphic displayed over the units receiving the aura**

** New: Resource Gathering Sound: Short Tooltip for UI indicator**
** New: Resource Deposit Sound: Long Tooltip for UI indicator**
** New: Gather Type: UI indicator Icon displayed (per icons.json)**
Unused flag – flags to enable additional settings, can be combined with each other
1: use the amount in work value 1 as multiplier
2: round area of power up (square otherwise)
4: display the range indicator
New 8: Temporary Aura, see Charge Type -3
New 16: Used combined with 8, applies buff only units around when the ability is triggered
New 32: Advanced range indicator

I am aware we can change the other settings via the following script for example.

xsEffectAmount(cSetAttribute, 726, cCombatAbility, 32, -1);
xsEffectAmount(cSetAttribute, 868, cCombatAbility, 48, -1);

xsTaskAmount(0, -.2); // anti cav debuff
xsTaskAmount(1, 1);
xsTaskAmount(2, 1);
xsTaskAmount(3, 39);
xsTaskAmount(5, 6);
xsTaskAmount(6, 2);

xsTaskAmount(4, 0.001 + 10);
xsTask(726, 155, 900);
xsTaskAmount(4, 0.002 + 10);
xsTask(726, 155, 904);
xsTaskAmount(4, 0.003 + 10);
xsTask(726, 155, 906);
xsTaskAmount(4, 0.004 + 10);
xsTask(726, 155, 912);
xsTaskAmount(4, 0.005 + 10);
xsTask(726, 155, 913);
xsTaskAmount(4, 0.006 + 10);
xsTask(726, 155, 922);
xsTaskAmount(4, 0.007 + 10);
xsTask(726, 155, 936);
xsTaskAmount(4, 0.008 + 10);
xsTask(726, 155, 944);
xsTaskAmount(4, 0.009 + 10);
xsTask(726, 155, 947);
xsTaskAmount(4, 0.010 + 10);
xsTask(726, 155, 954);
xsTaskAmount(4, 0.011 + 10);
xsTask(726, 155, 955);
xsTaskAmount(4, 0.012 + 10);
xsTask(726, 155, 919);
xsTaskAmount(4, 0.013 + 10);
xsTask(726, 155, 920);
xsTaskAmount(4, 0.014 + 10);
xsTask(726, 155, 921);
xsTaskAmount(4, 0.015 + 10);
xsTask(726, 155, 902);

xsTaskAmount(4, 0.001 + 10);
xsTask(868, 155, 900);
xsTaskAmount(4, 0.002 + 10);
xsTask(868, 155, 904);
xsTaskAmount(4, 0.003 + 10);
xsTask(868, 155, 906);
xsTaskAmount(4, 0.004 + 10);
xsTask(868, 155, 912);
xsTaskAmount(4, 0.005 + 10);
xsTask(868, 155, 913);
xsTaskAmount(4, 0.006 + 10);
xsTask(868, 155, 922);
xsTaskAmount(4, 0.007 + 10);
xsTask(868, 155, 936);
xsTaskAmount(4, 0.008 + 10);
xsTask(868, 155, 944);
xsTaskAmount(4, 0.009 + 10);
xsTask(868, 155, 947);
xsTaskAmount(4, 0.010 + 10);
xsTask(868, 155, 954);
xsTaskAmount(4, 0.011 + 10);
xsTask(868, 155, 955);
xsTaskAmount(4, 0.012 + 10);
xsTask(868, 155, 919);
xsTaskAmount(4, 0.013 + 10);
xsTask(868, 155, 920);
xsTaskAmount(4, 0.014 + 10);
xsTask(868, 155, 921);
xsTaskAmount(4, 0.015 + 10);
xsTask(868, 155, 902);

This adds a debuff task to the Elite Genoese Crossbowman that effect pretty much everything. If I wanted to add a graphic to this what would my script look like? Is it simply an attribute?

Charge-Attack system, with Charge-Target attribute to have it only activating with cavalry targets. Sadly Charge-Target is not avaialble to be edited during live gameplay for now.

And the graphic assignment slot for task is also not possible to be modified during live play, it’s only moddable with the dataset, as I know of.

The new added temporary transformation requieres a second version of the unit to switch to and return from, like Genoese > Genoese-Debuffer, so the unit, on ability activation, transform to the debuffer version of the unit, with bascially same graphics settings but stats variation, and after the transformation timer is over, returns back to the original one.

But there is where your problem will be, you can’t add armor / attack type to a unit, you can only modify existing datas present in the unit field. (That’s why some unit have 0 attack value in their card, so techs can add damage to them)

With the charge-attack we can use the special graphic, that triggers on every charged attack casting, for some types of charges of cources. But again, we cannot change what the charge-target is targeting. (Lou Chuan trebuchet is the regular shot, rockets/arrows are the charged shot targeting everything except building and something else I can’t remember)

Stingers are a type of charge, so technically you can filter against what the stinger (debuff, dot, etc) can be applyied to.

Study units in AGE, Fire Archer (target variation stat), Lou Chuan (selective charged projectile), Turtle Ship (charged projectile), Monoreme (speed charging), Serjeant (building animation) and the jian sowrdman (hp transformation to another unit once shield broke at % of hp)

1 Like

Thanks, i,m also experiencing a strange bug right now regarding the ability via task 155 and charge event -3 but ill make a post about it.

I was really hoping to be able to change the graphics settings via xsScript for specific taskes or tasks that i have created but i guess we’ll have to wait. Im pretty happy this game is still getting the attention it is. Considering I remeber playing it on my windows 98 in 2003.

Study unit Zhang Fei [2038], Yu Ji [2047] and Cao Cao (Campaign) [2052] in AGE.

Unit by unit addition for aura task,adding class in XS override all classes already there with the latest you’ve added only.

Aura task in XS is known for having issue with “class” selection, which is normally how you set things to avoid entering 3’000 objects ID, you just put their class ID, but that’s not working in XS for now.

Same here.

Building task can have building animation, check Serjeant. But, the field driving the sprite is not accessible to our xs function. Remember XS was added to the game for random map scripting purpose at first, not for live runtime modding. Plus, live modifcation can result in crashes so that’s normal too.

BUT

XS Scripting

  • Added float xsGetObjectAttribute(int32_t playerId, int32_t objectId, int32_t attribute) function which returns the unit attribute value of the specific player’s object ID.[/quote]

This xs function allows you to retreive info about units attributes. Combined with ingame triggers, variables, script call triggers and conditions. IT MAY be possible to do something, but at a VERY limited level and with A LOT of work.

So depending on your programming kownledge, and time avaialble, it is or isn’t at your reach.

Hint: this newly added xs function can, technically, be used to determine what a unit shoot at if you mixe it with ai scripting.

But in the end, yes, lots of things are locked behind hardmodding, sadly.

Yeah I was trying to debug some of my script and just used the blanket class to cover my bases vs just the unit. The issue im having is that the unit seems to flee when tasked to attack. More specifically they seem to flee to a previous tasking point and execute a “patrol” action. Im assuming this is why Zhang Fei is set to stop moving once an ability is activated. Im trying to figure out how to do what Zhang Fei does for my own units.

Where did you find that function from? Im getting all my scripting function references from:

Is there are wbsite that shows more modern functions?

Ohh you’re giving me some ideas! Which is bad considering how long i’ve been modding this map, HAHAA.

Official patchnote of the last update, under xs section.

The link you pointed is a fanmade, and outdated + lacking.
You should just study every patchnote since release of XS to see what changed, etc.

I’m thinking of making a page on the fandom, or multiple pages, about xs scripting but it’s difficult to … “Teach”, it requires programming knowledge, and I’m not that much confident in how I can explain my way of coding for others to understand.

But you can PM me if you have other questions, I’ll do my best to answer you.

Lesson of the day: setup player 8 as a dummy transformer player, change ownership of building your want to reskin / unit to reskin to player 8, do the trigger modification, switch owner to the wanted player. That way you can break nearly all the game limits about reskining. (Castle, Wonder, custom units, etc)

For the AI references: AI scripting - Strategic Numbers There are many interesting thing on this website too. But remember that the best infos are found on patchnotes. (I actually have 20 browser tab, each with a patchnote, to recheck changes on triggers, and xs, for my proejct)

YES! I’ve been looking for that webiste for so long. Thanks!

Got it!

Will switching to gaia work also? And what is the benefit of switching the player to reskin? We are still limited to the modifiable attributes in xsscript and triggers correct?

You Fool ! Never use Gaia ! Their behavior is hardcoded, and sometime do strange things. Plus not keeping house skin for some reasons.

Yes, and no, you can access more attributes in XS, as you can directly put numbers, so you can change things not listed. For example, attribute id 131, attack graphic 2, possible with XS using the ID 131, but not using the constant cause it’s not listed on the constant.xs file in your resources/_common/langage/xs folder, and you can access it with trigger attribute modification cause it’s listed there.

I managed to access some out of the list attributes but most of the time, they produce very, very, very, very bizare things so better to keep your work in the box. I’ll update the fandom attribute AGE ref page soon or later, especially for new additions, but you can still go check the current page: Fandom - AoE - AGE Genie Editor # Attributes