Jump to content

Some modding questions


Phoenix4646
 Share

Recommended Posts

Hi again,

making further progress in my mod I came along other questions about the game, which I'm going to ask in here.

Trying out the SVN version I found out that you added the possibility of creating upgrades that make units rank up, which is quite awesome. Now, this can be used for making upgrades that change a unit entirely (specific name, generic name, icon, description, etc.) similar to upgrading the short swordsman to the broad swordsman in AoE for example.

Now my question is, can you do this without allowing the unit to gather experience? I could of course just set the RequiredXP to 10000 or even 100000 since it's quite unlikely that any unit would reach that value, but I simply want the units to not gain any experience since they are supposed to be upgraded with researches. Now, is that possible or do I have to implement another way of upgrading units similar to promotions?

Another question I have is about the armor system in 0 A.D. If a unit has 3 attack and the attacker has 1 armor (reducing the damage by 10%), then the attack would deal 2,7 damage to the other unit. Now, how does that work? How does the game take 2,7 damage from a unit with 100 health?

EDIT:: for some reason, my post was sent to early when it was unfinished. Sorry about that.

Edited by Phoenix4646
Link to comment
Share on other sites

Hi again,

making further progress in my mod I came along other questions about the game, which I'm going to ask in here.

Trying out the SVN version I found out that you added the possibility of creating upgrades that make units rank up, which is quite awesome. Now, this can be used for making upgrades that change a unit entirely (specific name, generic name, icon, description, etc.) similar to upgrading the short swordsman to the broad swordsman in AoE for example.

Now my question is, can you do this without allowing the unit to gather experience? I could of course just set the RequiredXP to 10000 or even 100000 since it's quite unlikely that any unit would reach that value, but I simply want the units to not gain any experience since they are supposed to be upgraded with researches. Now, is that possible or do I have to implement another way of upgrading units similar to promotions?

Promotions aren't meant for this. You can edit most stats via technologies, and a tech to modify the look of the unit is in the pipeline too: http://trac.wildfiregames.com/ticket/2243

You still won't be able to change the name, icon and similar stuff, but this is something we'll never support, as it can cause confusion for the users.

Of course, the promotion system and the gui is moddable, so you can change those things if you want, but it's not intended that way, so it will be hacky.

Another question I have is about the armor system in 0 A.D. If a unit has 3 attack and the attacker has 1 armor (reducing the damage by 10%), then the attack would deal 2,7 damage to the other unit. Now, how does that work? How does the game take 2,7 damage from a unit with 100 health?

Health is decimal, so you'll end up with 97.3 hp, only in the GUI, it's rounded to 97 or 98 hp. I don't remember if it's mathematically rounded, or always up or always down, but that shouldn't matter too much I think.

Link to comment
Share on other sites

Promotions aren't meant for this. You can edit most stats via technologies, and a tech to modify the look of the unit is in the pipeline too: http://trac.wildfiregames.com/ticket/2243

You still won't be able to change the name, icon and similar stuff, but this is something we'll never support, as it can cause confusion for the users.

Of course, the promotion system and the gui is moddable, so you can change those things if you want, but it's not intended that way, so it will be hacky.

That's a shame, those things could have been useful for modders. Well, then I'll think about how I'm going to do it.

Link to comment
Share on other sites

Now I ran into a little problem with siege catapults.

It seems like when my catapults get close to a building (or unit?), they start unpacking by themselves and I can't stop them from doing that. If I click the cancel button, they just stop unpacking and then immediately start again which makes them completely immobile until they are unpacked. Only then I can tell them to pack by moving them somewhere.

https://dl.dropboxusercontent.com/u/93679544/siegeuncancellable-01.jpg

https://dl.dropboxusercontent.com/u/93679544/siegeuncancellable-02.jpg

https://dl.dropboxusercontent.com/u/93679544/siegeuncancellable-03.jpg

https://dl.dropboxusercontent.com/u/93679544/siegeuncancellable-04.jpg

https://dl.dropboxusercontent.com/u/93679544/siegeuncancellable-05.jpg

https://dl.dropboxusercontent.com/u/93679544/siegeuncancellable-06.jpg

The only difference between this one and 0 A.D.'s lithobolos is that these have more health, attack and range. Any idea what might be causing this?

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...

I didn't want to create a separate topic for it but I have a question.

When you have a script in your mod that is a modified version from an existing one in public. Now what happens in the game when when the file in public in changed? As in will those additional lines added/ removed in public have influence in your custom script?

Link to comment
Share on other sites

Files in mods overwrite files in the public mod. So it won't change if the public file changes.

But JS is very modular. The OO paradigm it uses is based on prototypes, which means you can extend the prototypes in other files too.

F.e. if you want to have a separate attack function, you can just have a file with

Attack.prototype.newFunction = function(a) { /* body */};

You can use the above thing also to just redefine an existing function when needed. In this case, you don't have to copy the entire file from the public mod, and you'll automatically inherit changes from there, as it won't overwrite existing files, but only extend existing prototypes. When a change happens to a function you've redefined, you will have to update that manually. But there's nothing we can do against that.

The only thing you have to watch out for is that your file is loaded after the file in public (else it would try to extend a prototype that doesn't exist yet, and crash badly). The files are loaded alphabetically. So you could either append something to it, like call the file "AttackMyMod.js" (the 'M' is sorted after the '.'), or use lowercase letters (lowercase is sorted after uppercase IIRC).

  • Like 3
Link to comment
Share on other sites

Hi again,

making further progress in my mod I came along other questions about the game, which I'm going to ask in here.

Trying out the SVN version I found out that you added the possibility of creating upgrades that make units rank up, which is quite awesome. Now, this can be used for making upgrades that change a unit entirely (specific name, generic name, icon, description, etc.) similar to upgrading the short swordsman to the broad swordsman in AoE for example.

Why yes, that sounds great.

I wonder, how did Age of Empires and Empire Earth do all of this stuff? It would be interesting to take a look at the code.

you can change and look at age of empires with programs like advanced genie editor 2

this is part of the roman legionnaire code
<Promotion>
<Entity>units/rome_centurio_imperial</Entity>
<RequiredXp>300</RequiredXp>
</Promotion>
you could simply do it by making a tech that makes the required xp become 0 so then whenever you train the unit he immediately becomes his upgrade this would also effect already built units.
i'm not sure if it can be easily done right now?
Edited by Veridagorin
Link to comment
Share on other sites

you can change and look at age of empires with programs like advanced genie editor 2

this is part of the roman legionnaire code
<Promotion>
<Entity>units/rome_centurio_imperial</Entity>
<RequiredXp>300</RequiredXp>
</Promotion>
you could simply do it by making a tech that makes the required xp become 0 so then whenever you train the unit he immediately becomes his upgrade this would also effect already built units.
i'm not sure if it can be easily done right now?

That is exactly what is done right now.

There is a rank upgrade technology (in simulation/data/technologies)

upgrade_rank_****_infantry/cavalry.json:

{	"genericName": "Advanced Citizen-Infantry",	"specificName": {		"hele": "Metikoi",		"mace": "Metikoi",		"spart": "Metikoi",		"athen": "Metikoi"	},	"description": "Upgrade all of your citizen-soldier infantrymen to Advanced rank.",	"cost": {"food": 200, "wood": 300, "stone": 0, "metal": 0},	"requirements": {"tech": "phase_town"},	"requirementsTooltip": "Unlocked in Town Phase.",	"icon": "upgrade_advanced.png",	"researchTime": 40,	"tooltip": "Upgrade all of your citizen-soldier infantrymen to Advanced rank. This increases their military prowess, but decreases their resource gathering rates -25%. Unlocks Elite Citizen-Infantry technology.",	"modifications": [{"value": "Promotion/RequiredXp", "replace": 0}],	"affects": ["Infantry Basic"],	"soundComplete": "interface/alarm/alarm_upgradearmory.xml"}
Edited by niektb
Link to comment
Share on other sites

  • 1 month later...

Yup, hi everyone, it's me again. Took a little break until this Alpha came out and now I'm back, facing the same problems as before :)
Yet again I am happy to see that this game gets better and better every release, with the units behaving much better than before and more possibilities with techs. Only a matter of time when the lag is finally fixed!

We could support a "replace unit from production queue" technology which would achieve just that… Isn't there one yet?

I wonder, has anything regarding that been done already? I don't see why you wouldn't implement something like this because it just opens more and more ways for mods, if you plan on having a nicely moddable game.
I'm using promotions right now so I can get the units to upgrade entirely, but as sanderd said it isn't meant for stuff like that (and promotions are something that I maybe would like to implement in my mod, too, rather than replacing them).

In the ''Modern warfare reaches 0 A.D.'' thread I also read about turrets being added because they would be used by some ships in 0 A.D. in the future. I hope you guys didn't abandon that...? Would again give a lot more options. :)

On another note in terms of issues, since this Alpha me and my friends are experiencing weird OOS and ''pyrogenesis.exe has stopped working'' errors in multiplayer games in both vanilla 0 A.D. and my mod, and on top of that we experienced some visual bugs when we found the new graphics setting menu and thought about enabling most of the stuff (we reverted it by unticking those things again / removing our configs, though one of us still gets a totally black landscape sometimes). We were 3 guys playing against 2 Petra AI's. In the first 3 minutes we got a random OOS error, but for some strange reason the game was still sync. This random OOS error occured in every game we played. We had to end the game after 8 minutes because one of us got disconnected, and oddly enough, he couldn't rejoin. The game said he joined and immediately disconnected, making us abandon the game. Then we started a new game, same settings, and played for some time. Sadly, that same guy who got disconnected had to leave withing the first 12 minutes, so there was only 2 of us left. After some more time, approx. another 20 minutes, my game crashed all of a sudden with the oh so descriptive windows error ''pyrogenesis.exe has stopped working'' and the game ended.

We got that crash everytime we played with Petra. This windows error message seems to appear everytime around the same time into the game for a random player (?). Sadly, we only have a crashlog.txt of the last time we had the crash and that time my friend had it happen to him.
https://dl.dropboxusercontent.com/u/93679544/0AD%20logs/B/crashlog.txt

Also, there's some weirdness about the Petra AI. After some time in a match it decides to send its attacks to the lower left corner of the map, spamming the console with a warning regarding a ''toBeContinued'' attack path / plan. You might want to check that, too :S

https://dl.dropboxusercontent.com/u/93679544/0AD%20logs/B/interestinglog.html

We just played another match (this time 2 guys vs. one Aegis AI) and it ran just fine, up until 59 minutes into the game (I pressed F12 to check for how long the game went on) when we got an OOS error when the AI attacked my friend. I made a screenshot of that and uploaded both OOS dumps from me and my friend.

https://dl.dropboxusercontent.com/u/93679544/0AD%20logs/A/oos_dump.txt

https://dl.dropboxusercontent.com/u/93679544/0AD%20logs/B/oos_dump_03_06_2014_B-7pm49.txt

The game went on fine again though. Then when we had won the game I wanted to take another screenshot, and suddenly the game crashed with two different error messages, showing the last one twice after I pressed ''break''.

https://dl.dropboxusercontent.com/u/93679544/0AD%20logs/A/crashlog.txt

https://dl.dropboxusercontent.com/u/93679544/0AD%20logs/A/crashlog.dmp

I hope you guys don't mind if I put all that stuff here, just tell me if this stuff is worthy of a ticket and I'll do it.

Regards

Link to comment
Share on other sites

[...]

In the ''Modern warfare reaches 0 A.D.'' thread I also read about turrets being added because they would be used by some ships in 0 A.D. in the future. I hope you guys didn't abandon that...? Would again give a lot more options. :)

[...]

This has been implemented, but not in Alpha 16. It will come in A17.

Link to comment
Share on other sites

When you are modding, I recommend you to mod with the SVN version. So your mod is about ready against the next version comes out. And you have something stable you can distribute to your friends.

That OOS problem is known, we've found the cause meanwhile. It's related with firing on someone who's just garrisoning. Difference is very small though, happens only for a split second, and normally (AFAIK), the states come back in sync again.

The turrets are in the game (well, the positional part of the turrets, there are still some scripts missing, but it's hard to write code that doesn't get used).

We probably won't add a technology that replaces units in the production queue, because it's a bit complicated and error prone. There has to be found a different way to do that.

Link to comment
Share on other sites

Oh great, didn't know about that :] Good to hear.

We probably won't add a technology that replaces units in the production queue, because it's a bit complicated and error prone. There has to be found a different way to do that.

So by saying you won't add a technology for that you mean you might do it another way? But how? That's a shame really, I was hoping to make some AoE-like upgrades.

I don't know if it's any different if a technology triggers a script or smth. that changes units? Just pure speculation from a newb.

Link to comment
Share on other sites

  • 1 month later...

Yeah it's me again, I've tried myself at Blender this time. I don't get what this error means:

ERROR: art/meshes/structural/myjeep.dae: Assertion not satisfied (line 574): failed requirement "mesh has vertex tex coords"

What did I do wrong?

Edited by Phoenix4646
Link to comment
Share on other sites

Well, common for newbs maybe. But I guess that's a no :]

So I got some new questions again.

Did you change something regarding the SkirmishReplacer in the SVN version? I tried this in default_infantry_melee_b:

  <SkirmishReplacer>    <general>units/{civ}_infantry_spearman_b</general>    <athen>units/athen_infantry_warrior</athen>  </SkirmishReplacer>

It tells me that it didn't expect <athen> and failes to load. Did that feature get removed?

Also I need to make a modified version of the Petra AI for my mod.

There is only one building unit, the rest are all fighters. The AI doesn't make any workers and does nothing with the ones you get on gamestart except for placing some buildings but the workers don't go there to actually build them. Now I couldn't get around to where all that stuff happens as the AI is kind of complex for me, is there any guide on the wiki that explains how to modify the AI?

Edited by Phoenix4646
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...