[Modding] Creating my first scenario
Re: [Modding] Creating my first scenario
Since you mentioned that historically they sold cowhides to the Romans, could you do what Pavel said, but get gold ONLY if the tribe is at peace with the Romans?
Also could have a much cheaper type of boat, costing less citizens to build, but also cowhides and a few wood. It would only carry the smaller fighting units, but if cheap enough a tribe might build lots of them and swarm the enemy at sea.
Also could have a much cheaper type of boat, costing less citizens to build, but also cowhides and a few wood. It would only carry the smaller fighting units, but if cheap enough a tribe might build lots of them and swarm the enemy at sea.
-
Cablenexus
- Sr. Colonel - Battleship

- Posts: 1691
- Joined: Mon Jan 04, 2016 7:09 pm
Re: [Modding] Creating my first scenario
I'm thinking of letting the cows as is. They move and they are free to move, but within 3 tiles from a city they produce cowhide.
- There can be a cowhide factory that increase it, there can be a unit ability that can attract cows, instead of them running away.
- There can be a mechanism that cows produce cowhide, but cost food.
- Cowhide can be traded
- Cowhide is needed for at least one unit and one special ability.
- A cowhide factory can slowly turn cowhide into gold.
- There can be a cowhide factory that increase it, there can be a unit ability that can attract cows, instead of them running away.
- There can be a mechanism that cows produce cowhide, but cost food.
- Cowhide can be traded
- Cowhide is needed for at least one unit and one special ability.
- A cowhide factory can slowly turn cowhide into gold.
-
Cablenexus
- Sr. Colonel - Battleship

- Posts: 1691
- Joined: Mon Jan 04, 2016 7:09 pm
Re: [Modding] Creating my first scenario
It was a night work, but watching the modding video here:
https://www.youtube.com/watch?v=OaGg_8YGGpM
and just experimenting, and failing a lot of times (with a value can't be 0 error) I made good progress on the Cowhide Farms mechanism. It's a complete new resource now with a resource farm that produce cowhide, but cost an amount of food.
It also is taken by the birthrate. I has a library entry, a description, an 11th resource added to the topbar and can be added from the editor as a mine with a unique ID and the mechanism work (mostly) I have to assign some more parameters.
The library text is placeholder.
https://www.youtube.com/watch?v=OaGg_8YGGpM
and just experimenting, and failing a lot of times (with a value can't be 0 error) I made good progress on the Cowhide Farms mechanism. It's a complete new resource now with a resource farm that produce cowhide, but cost an amount of food.
It also is taken by the birthrate. I has a library entry, a description, an 11th resource added to the topbar and can be added from the editor as a mine with a unique ID and the mechanism work (mostly) I have to assign some more parameters.
The library text is placeholder.
Last edited by Cablenexus on Mon Jul 16, 2018 5:02 am, edited 1 time in total.
Re: [Modding] Creating my first scenario
Tried starting up the mod but the whole game crashed. Pavel is fixing it for the next version. 
-
Cablenexus
- Sr. Colonel - Battleship

- Posts: 1691
- Joined: Mon Jan 04, 2016 7:09 pm
Re: [Modding] Creating my first scenario
Yes, I added it to the description, you have to restart Aggressors. Just loading the mod isn't enough.
The mod itself works fine. Pavel will fix so you can load it without restart.
Please try again to restart Aggressors, it will pick up the mod automatically and you can load a new game and choose hollandv0.090
-
Cablenexus
- Sr. Colonel - Battleship

- Posts: 1691
- Joined: Mon Jan 04, 2016 7:09 pm
Re: [Modding] Creating my first scenario
With an extra resource added, in the statescreen the scrollbar covers the resource icons partly:
Re: [Modding] Creating my first scenario
Good work! It seems like you dont need me anymore at all!:)Cablenexus wrote: ↑Mon Jul 16, 2018 4:44 amI made good progress on the Cowhide Farms mechanism. It's a complete new resource now with a resource farm that produce cowhide, but cost an amount of food.
Btw. all the things you initially thought about can be done externally (a.k.a. in the mod definition file or scripts) but some of them are basic and some are a bit advanced stuff (but not that much).
The biggest change I see in most of the suggestions is to turn the the ambient animals to the actual game mechanism. Although it is still pretty easy:
Cows behavior:
To forbid cows to runaway you need to set moveDuringTurnProbability to 0 and set conflictingObstacles to 372.
You also need to change the script by overriding their functionality to run away.
Create new class in your AmbientModels.cs file and paste there this
Code: Select all
public class CowAmbientModel : DeerAmbientModel
{
public override AmbientModel Create()
{
return new CowAmbientModel();
}
public override AmbientUnitChange UnitIsAboutToPerformMove(AmbientUnit ambientUnit, Unit unit, Position position, Player viewer, bool isFinalPosition)
{
return null;
}
}This will ensure that the cows will stay on the same tile no matter what. The only issue is that their 3D models might "conflict" with the models of the unit on that tile. Right now the animals always run away when there are conflicting obstacles (like units) but this changes it so they dont run away and this could cause the 3D conflicts.
The second thing is to actually start counting the animals as a resource source. This totally depends on the way you want to use it. For example if you want to count just those cows which are in range of 3 tiles from the city, you should:
- copy the city class to your own Units.cs mod file;
- add to the endturn method this code (I would tell you the exact line on chat);
- change the numbers (ID of your new resource, distance from the city and yield of each cow group). I already added comments to the code itself.
Code: Select all
if (hasOwner)
{
PositionCollection positionsWithCows = State.AmbientUnits.GetAmbientUnitByModelId(5).GetAmbientUnitsPositions().GetPositionsNotFurtherThan(unit.Position, 3, false);//3 here is the max distance from the city
if (positionsWithCows.Count > 0)
{
int numberOfMyCowsAround = State.Chart.GetSquares(positionsWithCows).GetSquaresWithOwner(unit.OwnedBy).Count;
if (numberOfMyCowsAround > 0)
{
GameResource cowHideResource = State.Resources.GetGameResourceById(6);//replace 6 by ID of your new resource
if (cowHideResource != null)
{
PlayerResource cowHidesToAdd = cowHideResource.CreatePlayerResource(2 * numberOfMyCowsAround);//2 is the actual "yield" out of every cow group
unit.OwnedBy.AddResources(new PlayerResourcesCollection(cowHidesToAdd), stateChanged);
}
}
}
}
But this way we turned the eye candy animals to the actual source of your new resource.
Now you can do any of those things you mentioned:
Similarly like the city, you can create a brand new building which will work with the nearby cows. It might be even better to have a different building than adding this functionality for the city.
Can also be done, but this is a bit more complicated. You would need to calculate the movement of cows (scripted in the ambientModels.cs file).Cablenexus wrote: ↑Mon Jul 16, 2018 12:43 amthere can be a unit ability that can attract cows, instead of them running away.
This would be added to the script I just created (very similarly to production a consumption can be implemented - just add "-").Cablenexus wrote: ↑Mon Jul 16, 2018 12:43 amThere can be a mechanism that cows produce cowhide, but cost food.
This is automatic. Just leave therer the attributes for GameResourceMemento set to 15 (it is almost for all resources already).
Simply configurable in mod file (in costs).Cablenexus wrote: ↑Mon Jul 16, 2018 12:43 amCowhide is needed for at least one unit and one special ability.
This can be done even without scripting. Create new UnitModelMemento and specify <production and <consumption (look for example in city). Once player doesnt have enough consumption resources it doesnt produce the production resources.
Good luck!
Re: [Modding] Creating my first scenario
Well I am aware of that but I will not have time for fixing it now. Hopefully till the release is out it will be fixed. Anyway I logged it to the system;)Cablenexus wrote: ↑Mon Jul 16, 2018 5:22 am With an extra resource added, in the statescreen the scrollbar covers the resource icons partly:
Re: [Modding] Creating my first scenario
It crashed everytime for me untill I deleted the mod again.Cablenexus wrote: ↑Mon Jul 16, 2018 5:03 amYes, I added it to the description, you have to restart Aggressors. Just loading the mod isn't enough.
The mod itself works fine. Pavel will fix so you can load it without restart.
Please try again to restart Aggressors, it will pick up the mod automatically and you can load a new game and choose hollandv0.090
But i'll try next patch.
Re: [Modding] Creating my first scenario
This reminds me of Lords of the Realm.Cablenexus wrote: ↑Mon Jul 16, 2018 4:44 am It was a night work, but watching the modding video here:
https://www.youtube.com/watch?v=OaGg_8YGGpM
and just experimenting, and failing a lot of times (with a value can't be 0 error) I made good progress on the Cowhide Farms mechanism. It's a complete new resource now with a resource farm that produce cowhide, but cost an amount of food.
It also is taken by the birthrate. I has a library entry, a description, an 11th resource added to the topbar and can be added from the editor as a mine with a unique ID and the mechanism work (mostly) I have to assign some more parameters.
The library text is placeholder.
cowhides.jpg
If you remake this game into Lords of the Realm 1 you will be my hero.
-
Cablenexus
- Sr. Colonel - Battleship

- Posts: 1691
- Joined: Mon Jan 04, 2016 7:09 pm
Re: [Modding] Creating my first scenario
It should not crash, also not in v5g.n0kn0k wrote: It crashed everytime for me untill I deleted the mod again.
But i'll try next patch.![]()
In the .zip file there are two folders. Did you copy/pasted the complete folders to the game and user directories?
The holland mod folder to the bin directory (the name of the folder is ancient_rome-holland) and the hollandv0.90 folder to the scenario directory in the user folder (not the game scenario folder)?
Did you get an error log?
-
Cablenexus
- Sr. Colonel - Battleship

- Posts: 1691
- Joined: Mon Jan 04, 2016 7:09 pm
Re: [Modding] Creating my first scenario
Yes, after I start a modern Warlords III Darklords Rising remake and a Defenders of the Crown remaken0kn0k wrote: ↑Mon Jul 16, 2018 9:56 amThis reminds me of Lords of the Realm.Cablenexus wrote: ↑Mon Jul 16, 2018 4:44 am It was a night work, but watching the modding video here:
https://www.youtube.com/watch?v=OaGg_8YGGpM
and just experimenting, and failing a lot of times (with a value can't be 0 error) I made good progress on the Cowhide Farms mechanism. It's a complete new resource now with a resource farm that produce cowhide, but cost an amount of food.
It also is taken by the birthrate. I has a library entry, a description, an 11th resource added to the topbar and can be added from the editor as a mine with a unique ID and the mechanism work (mostly) I have to assign some more parameters.
The library text is placeholder.
cowhides.jpg
If you remake this game into Lords of the Realm 1 you will be my hero.![]()
Re: [Modding] Creating my first scenario
Got it. That's where I messed up. I'll give it a spin as Rome.Cablenexus wrote: ↑Mon Jul 16, 2018 11:33 amIt should not crash, also not in v5g.n0kn0k wrote: It crashed everytime for me untill I deleted the mod again.
But i'll try next patch.![]()
In the .zip file there are two folders. Did you copy/pasted the complete folders to the game and user directories?
The holland mod folder to the bin directory (the name of the folder is ancient_rome-holland) and the hollandv0.90 folder to the scenario directory in the user folder (not the game scenario folder)?
Did you get an error log?
-
Cablenexus
- Sr. Colonel - Battleship

- Posts: 1691
- Joined: Mon Jan 04, 2016 7:09 pm
Re: [Modding] Creating my first scenario
@n0kn0k,
Thanks! Really interested in your feedback.
I think it should be even easier to install the mod as harryvdk already mentioned. Just a one click install (Steam workshop does this automatically) should be really nice.
Thanks! Really interested in your feedback.
I think it should be even easier to install the mod as harryvdk already mentioned. Just a one click install (Steam workshop does this automatically) should be really nice.
Re: [Modding] Creating my first scenario
Just played 25 or so turns. Fun gameplay on the southern wall. Imho move the units onto the walls at the start. Now they are too late.Cablenexus wrote: ↑Mon Jul 16, 2018 12:50 pm @n0kn0k,
Thanks! Really interested in your feedback.
I think it should be even easier to install the mod as harryvdk already mentioned. Just a one click install (Steam workshop does this automatically) should be really nice.
Building up a road network fast now because the map is sooooooooooooooooooo big.
Most of the tribes offered peace now.
-
Cablenexus
- Sr. Colonel - Battleship

- Posts: 1691
- Joined: Mon Jan 04, 2016 7:09 pm
Re: [Modding] Creating my first scenario
The units from the Roman Empire or the Tencteri and/or Usipetes units?n0kn0k wrote: ↑Mon Jul 16, 2018 1:09 pmJust played 25 or so turns. Fun gameplay on the southern wall. Imho move the units onto the walls at the start. Now they are too late.Cablenexus wrote: ↑Mon Jul 16, 2018 12:50 pm @n0kn0k,
Thanks! Really interested in your feedback.
I think it should be even easier to install the mod as harryvdk already mentioned. Just a one click install (Steam workshop does this automatically) should be really nice.
Building up a road network fast now because the map is sooooooooooooooooooo big.
Most of the tribes offered peace now.
-
Cablenexus
- Sr. Colonel - Battleship

- Posts: 1691
- Joined: Mon Jan 04, 2016 7:09 pm
Re: [Modding] Creating my first scenario
The Holland mod is not yet compatible with version v6.
I hope tomorrow morning to have the mod updated. Thank you.
I hope tomorrow morning to have the mod updated. Thank you.
-
Cablenexus
- Sr. Colonel - Battleship

- Posts: 1691
- Joined: Mon Jan 04, 2016 7:09 pm
Re: [Modding] Creating my first scenario
The same scrollbar problem with >10 resources happens in the goverment compare screen:Cablenexus wrote: ↑Mon Jul 16, 2018 5:22 am With an extra resource added, in the statescreen the scrollbar covers the resource icons partly:
resstate.jpg
-
Cablenexus
- Sr. Colonel - Battleship

- Posts: 1691
- Joined: Mon Jan 04, 2016 7:09 pm
Re: [Modding] Creating my first scenario
The mod is working again in v6
It's always a little complex to keep the mod up to date in a beta since there are a lot of major changes constantly. So I had to change lines in the script and copy/pasted parts of the new version to my own mod.
It's sometimes very frustrating when you think all your "advanced" files are good to go and still you get a crash.
This time it was because I forget to change the line Lasymachus in Macedonia.
The program returns the following error to me:
inner exception Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
So it's always a puzzle where it is related to
No critism here and I'm fully aware that it's my own repsonsibility, but I just wanted to share this
Like before, since I'm not allowed to share a download link yet, send me a private message (PM) here in the forums or let me know in the comments that you want to play the mod.
I still have to repack and upload the mod so it will me tomorrow before I can send it.
(I also want to test myself a bit if no errors occur in v6).
It's always a little complex to keep the mod up to date in a beta since there are a lot of major changes constantly. So I had to change lines in the script and copy/pasted parts of the new version to my own mod.
It's sometimes very frustrating when you think all your "advanced" files are good to go and still you get a crash.
This time it was because I forget to change the line Lasymachus in Macedonia.
The program returns the following error to me:
inner exception Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
So it's always a puzzle where it is related to
No critism here and I'm fully aware that it's my own repsonsibility, but I just wanted to share this
Like before, since I'm not allowed to share a download link yet, send me a private message (PM) here in the forums or let me know in the comments that you want to play the mod.
I still have to repack and upload the mod so it will me tomorrow before I can send it.
(I also want to test myself a bit if no errors occur in v6).
Re: [Modding] Creating my first scenario
I'm guessing that even after release of the game to the public, you will have to update the mod everytime, or sometimes, when the game is revised.

