Author Topic: upgrades required to morph  (Read 1122 times)

Mr War

  • Guest
upgrades required to morph
« on: 14 July 2011, 19:54:19 »
hi, can't figure out the correct syntax for requiring an upgrade before allowing a unit to morph into another. Here's what I have, which is incorrect ..

Quote
<command>                                    
         <type value="morph"/>                                 
         <name value="transform_to_autoblaster"/>                                 
         <image path="../autoblaster/images/unit_archer.bmp"/>                                 
         <unit-requirements/>                                 
         <upgrade-requirements>
            <upgrade name="transformational_mechanics"/>
            <upgrade discount="0"/>
         <upgrade-requirements/>
                                 
         <morph-skill value="convert_to_aaa"/>                                 
         <morph-unit name= "autoblaster"/>                                 
         <discount value="0"/>                                 
      </command>

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: upgrades required to morph
« Reply #1 on: 14 July 2011, 19:59:16 »
Change <upgrade-requirements/> to </upgrade-requirements>.  The / at the end means that the tag is both starting and ending at the same spot (i.e. a tag that doesn't need additional details), while the / at the beginning means "You know that tag we opened earlier?  Here is where it ends."  I also have no idea what the <upgrade discount> thing is.  That doesn't look familiar to me, but maybe it's a MegaGlest thing. :look:
« Last Edit: 14 July 2011, 20:12:11 by John.d.h »

will

  • Golem
  • ******
  • Posts: 783
    • View Profile
Re: upgrades required to morph
« Reply #2 on: 14 July 2011, 20:16:34 »
I think this demonstrates a bug in the XML parsing in MG: that if an error is encountered parsing the XML - its badly formed - no error is raised, and instead the rest of the file is ignored.

Mr War

  • Guest
Re: upgrades required to morph
« Reply #3 on: 14 July 2011, 20:23:47 »
doh! thanks man, that solved it

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: upgrades required to morph
« Reply #4 on: 14 July 2011, 20:24:34 »
upgrade discount is an original glest feature. Look at magics initiate. he needs 2 energy to morph and gets one back after morphing.
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: upgrades required to morph
« Reply #5 on: 14 July 2011, 21:16:27 »
upgrade discount is an original glest feature. Look at magics initiate. he needs 2 energy to morph and gets one back after morphing.
Isn't that what the <discount value=""/> does?

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: upgrades required to morph
« Reply #6 on: 14 July 2011, 22:13:32 »
Will, I am pretty sure badly formatted XML is shown when loading (at least from the times we've had bad xml it throws errors).

will

  • Golem
  • ******
  • Posts: 783
    • View Profile
Re: upgrades required to morph
« Reply #7 on: 14 July 2011, 23:44:45 »
I know for a fact that, in MG, on my ubuntu box, badly formed XML is a silent truncation.

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: upgrades required to morph
« Reply #8 on: 15 July 2011, 00:15:42 »
Silent...where? Were you running in a terminal window so you could follow what was written to standard (error) output?
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: upgrades required to morph
« Reply #9 on: 15 July 2011, 04:55:12 »
upgrade discount is an original glest feature. Look at magics initiate. he needs 2 energy to morph and gets one back after morphing.
Actually, there's no such thing as upgrade discount. There is <discount value=""/> as John mentioned, which returns resources AFTER the morphing is complete, as a percentage. In GAE, there's also <cost-modifier value=""/> which does the same thing, but takes the resource cost off BEFORE (so you don't need the full resources to begin the morph). However, it is not a child of <upgrade-requirements />.

As a future note, you can find the correct syntax of EVERY XML tag in Glest and the majority of GAE/MG tags on the wiki, with syntax highlighting and full explanations.

Command XMLs such as for morph are here: https://docs.megaglest.org/XML/Commands

And a full list here: https://docs.megaglest.org/XMLs
« Last Edit: 18 June 2016, 13:07:14 by filux »
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

 

anything