Jump to content

adding more damage and armor types


Veridagorin
 Share

Recommended Posts

Hi all i have a few more questions how easy is to add a new armor and attack type?

can i do it in Notepad++?

where are the files that define the armor and damage?

can a unit deal 2 types of damage at the same time?

ex. from roman ballista that appears to have 2 damage types

<Attack>

<Ranged>
<MaxRange>76</MaxRange>
<MinRange>16.0</MinRange>
<ProjectileSpeed>22.0</ProjectileSpeed>
<RepeatTime>6000</RepeatTime>
<Splash>
<Shape>Circular</Shape>
<Range>10</Range>
<FriendlyFire>true</FriendlyFire>
<Hack>40.0</Hack>
<Pierce>0.0</Pierce>
<Crush>40.0</Crush>
</Splash>
</Ranged>
</Attack>
Edit i have another question can i make units garrison in neutral buildings/trees?
so that they can shoot arrows from a safe place?
Edited by Veridagorin
Link to comment
Share on other sites

Just do a search for one of the damage names in your project (f.e. search on "Hack"), and you'll get a good list of files.

In short, the types are defined in Attack.js, Damage.js (in public/simulation/components/) and there will also be some gui parts (most likely the selection files in public/gui/session/) and the connection between the simulation and the gui: GuiInterface.js. The AI would also need to be modified I guess.

You should be able to do all that without recompiling though.

Link to comment
Share on other sites

The armor can be done in the same file. The reason that you don't see them is because the're already defined in a parent template.

In the parent file of the roman ballista you'll find this:

<Armour>    <Hack>2</Hack>    <Pierce>30</Pierce>    <Crush>10</Crush></Armour>

You can adjust these values in the child template, using the same tags (child values override parental values)

You might find this tutorial useful (although it doesn't directly deal with armor and other stats)

http://www.wildfiregames.com/forum/index.php?showtopic=18396

  • Like 1
Link to comment
Share on other sites

thanks for the help my question was more on the lines of adding a totally new type of damage

like keeping the

Hack, pierce and crush

and then adding a new attack and armor type like fire

function Armour() {}
Armour.prototype.Schema =
"<a:help>Controls the damage resistance of the unit.</a:help>" +
"<a:example>" +
"<Hack>10.0</Hack>" +
"<Pierce>0.0</Pierce>" +
"<Crush>5.0</Crush>" +
"<Burn>0.0</Burn>" +
would adding a burn like this to all the places that have hack/pierce or crush add a new armor and attack type burn?
i have another question how to test my mod out?
Link to comment
Share on other sites

would adding a burn like this to all the places that have hack/pierce or crush add a new armor and attack type burn?

You just took the example section of the XML. The actual schema is a few lines up or down. The schema defines that the attack has to be a decimal number f.e.

i have another question how to test my mod out?

When your mod is in a directory "MyMod", then you can execute it like "./pyrogenesis -mod=MyMod" (edit the pyrogenesis shortcut).

Link to comment
Share on other sites

You need a shortcut:

Target:

"C:\CODE\binaries\system\pyrogenesis.exe" -mod=testmod
or
C:\CODE\binaries\system\pyrogenesis.exe -mod=testmod

Start in:

C:\CODE\binaries\system

Replace C:\CODE\binaries\system with your own installation path:

"[installation path]\binaries\system\pyrogenesis.exe" -mod=testmod

And testmod is of course your modfolder. Edited by niektb
Link to comment
Share on other sites

Edit i have another question can i make units garrison in neutral buildings/trees?

so that they can shoot arrows from a safe place?

Neutral buildings is the easier. Though it will have to be scripted. Just look for where the conditions/restrictions are that prevent you acting on neutral and enemy buildings.

The trees are difficult. The Council of Modders tries to deal with it. Though there is no promise about when we will have bent our mind around it. (it's a quite huge project and the C++ API has to be adapted if JavaScript limits the possibilites).

As a trick you could prop the units to the tree. Best would be a script/generic way that exchanges the props. The council is researching this too.

Once triggers are in, we could trigger a unit that stands below a tree to be beamed up into the tree.

It's questionable if it should be safe though.

Being able to attack and destroy props is one of the important features we dream of . (it would allow partial damage and crumbling walls, too).

If the tree would play its attack animation, then the unit (that was propped into the tree) would shoot arrows too. The question remains if there would be damage.

Also a big problem is where to put things. It's probably impossible to answer without really knowing the engine better, i.e. by heart. Time is your friend here.

Edited by Hephaestion
Link to comment
Share on other sites

ok i did that it plays 0 A.D. but without the changes i made

i'm using a windows 8 computer if that is helpful at all

Are you sure it plays without the changes? Or did you just not change anything visual? Unless you altered the GUI pages, you won't see any difference.

Also, can you show us your paths? Where is pyrogenesis installed, where is the public folder, where is your mod, what's the exact command ...

Link to comment
Share on other sites

I have adjusted some visuals they don't show up

Target

"C:\Users\verid_000\AppData\Local\0 A.D. alpha\binaries\system\pyrogenesis.exe" --mod=Anorithia

My mod's locations

C:\Users\verid_000\AppData\Local\0 A.D. alpha\binaries\data\mods\Anorithia

Public mod's location

C:\Users\verid_000\AppData\Local\0 A.D. alpha\binaries\data\mods\public

Link to comment
Share on other sites

yes it worked

I added a faction and when i go to test my mod when I go into the single player lobby i can't select any civs

and there are these error messages

initCivNameList ( ) (gui\gamesetup/gamesetup.JS:481

initMain ( ) (gui\gamesetup/gamesetup.JS:126

initonTick ( ) (gui\gamesetup/gamesetup.JS:616

Syntax error:JSON parse parsing JSON data in civs Doonland.JSON

Edited by Veridagorin
Link to comment
Share on other sites

Can you post the content of the Doonland.JSON. Or best just turn your mod folder in a repository folder, which we can integrate into the Council of Modder repos. Then everyone can help.

It might attract new modders as it's better join efforts than loose control, and get lost alone - it would surprise me if there weren't some people help you in your giant mod, which has a lot of potential. I can't help with artwork atm as I'm busy with more general things from our wishlist.

@Error:

Syntax error. Can be anything. Forgot a , or one too much? Forgot a ' or "?

Also make sure your editor's encoding is UTF-8, (look for an option in the editor's settings).

Link to comment
Share on other sites

Ah, hm. You can keep the repository with your account of course. But how can we access it. Can you add us as administration? Or do you have a paid account and this is incompatible, it should not? Don't you like it as public account (then still only Administrators can change it but everyone can see)?

I think there are only two possibilities:

  • You could add us as collaborators.
  • Convert it to a CoM repository by transfering owndership of your Anorithia repository via Settings at the right in GitHub.
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...