Jump to content

Conversion system


Recommended Posts

Unitai.js It's definitely a monstrosity.

What a difficult thing, no wonder no one tries to introduce new commands and components lately.

https://gitea.wildfiregames.com/0ad/0ad/issues/2579

This is going to be a wall to break down in my project, that is: trying to implement conversion in unit AI.

 

downloadfile.png

Edited by Classic-Burger
Link to comment
Share on other sites

@Classic-Burger, why don't you use the existing capture system? Would be much easier.

Probably works right away with only few tweaks in templates: 

I) Add a capture attack to template_unit_support_healer.xml

Spoiler
    <Attack>
        <Capture>
            <AttackName>Capture</AttackName>
            <Capture>30</Capture>
            <MaxRange>30</MaxRange>
            <RepeatTime>1000</RepeatTime>
            <RestrictedClasses datatype="tokens">Structure</RestrictedClasses>
        </Capture>
    </Attack>

II) Add capture points to all units you want to be able to be converted (you can also then put different values in hero, champion templates...)

Spoiler
  <Capturable>
    <CapturePoints>50</CapturePoints>
    <RegenRate>5</RegenRate>
  </Capturable>

Just tested it and it seems seamless.

If you really want to add some randomization too into the capture then you could afterward add it to Capturable.js, but you could do it now in 2 lines of code too.

Link to comment
Share on other sites

37 minutes ago, Atrik said:

why don't you use the existing capture system? Would be much easier.

In theory I want it to work differently, I want it to have a cooldown and cost faith or power/mana. 

The other thing is to prevent what happened with the catapults, a few alphas ago. Then it looked like a tennis match.

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...