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

Mod Design and Discussion
Moderated by Sebastien, John the Late

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: Looting Function (Data Editing question)
posted 01-23-15 05:48 AM CT (US)   
Has anyone ever experimented with implementing looting effects in data editing?

What I mean is, for instance, receiving gold, for destroying market places, trade carts, trade cogs...

I want to implement this in my mod on the Varangians and Bolgars. The Varangians were known as river pirates and I wanted to give them boats/rafts that create gold when sacking other ships or buildings...
Replies:
posted 01-23-15 07:51 AM CT (US)     1 / 30  
It can be done.
There is looting ability 122 available and some looting options on buildings (looting table and pile unit). Download latest AGE to see recent finds. I hear looting only works for non-scouts if the unit has no attack abilities.

Advanced Genie Editor
Follow coding here and here.
posted 01-23-15 10:01 AM CT (US)     2 / 30  
There are 2 looting abilities. One steals resources from the enemy player by attacking a lootable building (trade workshop in aok), the other takes resources directly from the storage of the attacked unit, I used this one to make the work dog unit for dynasty.
posted 01-23-15 10:04 AM CT (US)     3 / 30  
The second is exactly what I am looking for, if I understand correctly you can actually rob caravans with that

So how did you do the latter?
posted 01-23-15 10:19 AM CT (US)     4 / 30  
Yes, that is possible.

I'll make a screenshot. Give me a few mins to get at the computer and start AGE.
posted 01-23-15 10:24 AM CT (US)     5 / 30  
Two looting abilities. Are they both variants of 122 or actually separate? I assume lootable building needs something in its looting table. What role do pile units have?

Advanced Genie Editor
Follow coding here and here.
posted 01-23-15 10:40 AM CT (US)     6 / 30  
They are both 122, with different settings.






Here you can see the loot ability and its settings to be able to steal gold from trade carts. As you can see, the unit must not have an attack ability (and thus can only attack by auto-attacking when being close to an enemy. (Ignore the trade abilities, you don't need these 2.)

To fix this, we'll me make a second unit with the exact same stats, but a different set of abilities:



This unit does not have the loot ability, but the attack ability instead.



And because we want the two units to act like one, we'll set the same number into their Villager Mode fields. This can be any unused number (3 or higher in Vanilla; 1 is male, 2 female villagers).

I recommend hiding one of the 2 units in the editor, it would lead to unnecessary confusion.
posted 01-25-15 03:41 AM CT (US)     7 / 30  
So the trade loot magic lies in action variables unknown 4, unknown 5, plunder source, selection mode, unknown 11. I wonder what exactly those do.

Is it true that you can pair any units with villager mode and different actions?

Advanced Genie Editor
Follow coding here and here.
posted 01-25-15 10:25 AM CT (US)     8 / 30  
Yes, you can.

Selection enabler seems required for selection mode.
posted 01-26-15 04:13 AM CT (US)     9 / 30  
So I've finished most of the 'Raiding Raft' unit for the Varangians (screenshot later today)... but I am not sure if I correctly understood all the steps, so I started by simply adding the loot ability to the unit with trade boat (class 2) as the class of choice. Will this suffice or do I need a version of your second step to make sure the thing will loot? Also editing the data with both AGE2 and AGE3... will that cause problems? Haven't experienced any, but since I started most of the editing with AGE2 and switched to AGE3, I wonder if I have to expect any working troubles?

Greets,

Ivo
posted 01-26-15 05:08 AM CT (US)     10 / 30  
Ivayl, what is the AGE 2 version you are using? I can tell you what has changed since then. I am about to release new AGE 3 soon, though it will be called something like Advanced Genie Editor 2015.1.26.

Advanced Genie Editor
Follow coding here and here.
posted 01-26-15 05:10 AM CT (US)     11 / 30  
John is it possible to make the slaver only kidnap male or female villagers?If you just give a garrison graphic to the slaver it changes when it has a unit kidnapped so what Im trying to do is make 2 units as you said and make each of them kidnap male or female units and combine them as one with different garrison graphics to look like the villager is following them when kidnapped does it makes sense or sounds really stupid
posted 01-26-15 05:14 AM CT (US)     12 / 30  
Use unit ids as targets for kidnapping. It is hardcoded partially so I am not sure how it works.

Advanced Genie Editor
Follow coding here and here.
posted 01-26-15 05:15 AM CT (US)     13 / 30  
I don't know what the exact version is, only that adding changes with AGE3 did not delete the changes I had already introduced using AGE2... if there's any trouble ahead of me for using both AGE on the datafile, then at least it's not going to erase the AGE2 changes.
posted 01-26-15 05:19 AM CT (US)     14 / 30  
Keisari Tapsa Thanks I will try that btw how do you rename a unit?I have the latest xmas edition and im trying to rename the hidden LC to slaver but when I change the internal name its still showing LC in game it worked before when I added more dead units.
posted 01-26-15 05:41 AM CT (US)     15 / 30  
Mahazona, does it have language dll entry? Have you set changes to automatically copy to all selected civilizations?

AGE version can be seen when you click on Help -> About. Every release has a version number in there.

Sometimes bunches of data have been discovered that can have different size, but in those cases, old AGE versions that had it as fixed size, cease to be able to read the files edited with newer versions that allow you to edit that previously unknown data.

Advanced Genie Editor
Follow coding here and here.
posted 01-26-15 05:56 AM CT (US)     16 / 30  
But the game itself can read out changes made with either version of AGE, right? Or am I making a logical mistake?
posted 01-26-15 06:09 AM CT (US)     17 / 30  
Mahazona, does it have language dll entry? Have you set changes to automatically copy to all selected civilizations?
Yep but its not changing only working for dead units does this only work for C patch?

And I tried the unit ID it dosent work,Im not sure if something got screwed while I was editing but the slaver is able to kidnap anyone not just villagers even when I have only villagers set in the attributes.
posted 01-26-15 06:39 AM CT (US)     18 / 30  
Yes, game should read any dat written with AGEs.

Language dll entry should be set to 5000, if you want to use internal name instead.
For kidnapping ability, if using unit ids, set class to -1. It can still just not work.

Advanced Genie Editor
Follow coding here and here.
posted 01-26-15 07:18 AM CT (US)     19 / 30  
Yep that worked,I got 2 units to kidnap each of the male and female villagers and combined them to make one creating a great looking slaver.I got the rename thing working also It had a wrong file for the language.dll
This slaver trick works for scout and light cavalry both only bad side is you cant see the garrisoned units icon to drop off on the way.The hidden LC has this enabled though.
posted 02-22-15 04:00 AM CT (US)     20 / 30  
Hey John, how does the other looting ability work ? The one that steals resource from the other player, I would be interested in using it. Thanks !
posted 03-09-15 06:12 AM CT (US)     21 / 30  
John... I finally (with some help from Mahazona) was able to understand the whole trick with villager mode and merging units... and while I had two Raiding Raft units merged and had them specialize in raiding buildings... they did not steal gold or at least not visibly so... is there something additonal to mind there?
posted 03-09-15 11:41 AM CT (US)     22 / 30  
Hey both, I was a bit busy recently (exams and a family member in hospital).

TriRem, take a look at the scout cavalry unit (448), I think it has the ability to do so if you remove its attack ability. Otherwise, I can look up the exact effect later.


Ivayl, what exactly did you do? If you give the same ability to both ships, then they won't switch. A thing I always do while testing is giving the 2 units different names, btw.
posted 03-09-15 12:48 PM CT (US)     23 / 30  
Thanks John I had figured out how it works (by the way I checked the scout and in the HD version they have removed the ability to loot and to kidnap civilians).

Another thing : It is not possible to pair units that have different classes right ? I tried to make a boarding ship and have it paired with a war ship that could loot docks but it doesn't work.
posted 03-09-15 12:55 PM CT (US)     24 / 30  
I didn't try different classes so far.

About looting buildings: The specific buildings require certain values to be set to 1, in older AGE versions you'll find an unknown with the values 1 1 0 1 1 0 for the trade workshop and the TC and 0 0 0 0 0 0 for all others. In the recent AGE version, these have been correctly named (thanks to further research by Justtesting1234) to "Looting Table" with the respective resources and can be found below the costs.
posted 03-09-15 01:01 PM CT (US)     25 / 30  
Another thing : It is not possible to pair units that have different classes right ?
Yup, unfortunately this is not possible :/

The Portuguese Civ Mod III - Download at the Blacksmith
A mod that adds new civilizations, a new age, a new resource and introduces new gameplay features!
2nd place as Best Mod Pack in AoKH GOTY 2013 (PCM I) | 1st place as Best Mod Pack in AoKH GOTY 2015 (PCM II) | 2nd place as Best Mod Pack in AoKH GOTY 2017 (PCM III)


"And he that sat upon the throne said, Behold, I make all things new. And he said unto me, Write: for these words are true and faithful." - Revelation 21:5 (KJV)
posted 03-10-15 07:44 AM CT (US)     26 / 30  
So, the merging really works, one unit has attack abilities, the other has none, but therefore the ability 122 with class Buildings 3. When I approach a Dock, the Raft loses it's attack scores, but nothing happens to the Dock's Gold display or to my own resources.
posted 03-10-15 11:43 AM CT (US)     27 / 30  
Could you make it so Spearmen could "pillage" / loot food or gold off attacking any unit? or are there limitations like they have to be attacking a building or a unit carrying said supplies?
posted 03-10-15 02:19 PM CT (US)     28 / 30  
Khan Ivayl :
I think I know why : because the drop point of your unit is a TC and since your boat can't reach it nothing happens. As far as I know the TC as drop point for looting is hardcoded. Not sure but John could confirm it.

And the dock gold display won't change whatever happens, it only depends of how far is your dock.

[This message has been edited by TriRem (edited 03-10-2015 @ 02:21 PM).]

posted 03-10-15 06:01 PM CT (US)     29 / 30  
Yeah, the TC is the drop point. But I don't think that this is the primary issue here: You are trying to steal gold from the dock, but it does not actually have gold. It just displays how much a trade cog would receive. If you want to take gold from the dock, from the players' inventories, then make sure that the dock is lootable (see looting table below annex units) and that the raiding unit has the ability to loot from enemy player stockpiles (the scout cavalry does so, but it's "overwritten" by the attack ability). However... the TC dropsite issue still persists.
posted 03-10-15 08:40 PM CT (US)     30 / 30  
Well the TC drop point is not a big problem : instead of using the looting ability just use the gather ability to gather gold that you have put in the dock's resources. Then you could have the unit has it's own drop point and it works fine I just tested it.
Age of Kings Heaven » Forums » Mod Design and Discussion » Looting Function (Data Editing question)
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Age of Kings Heaven | HeavenGames