Jump to content


Photo

Xml And Game Transactions


  • Please log in to reply
7 replies to this topic

#1 bpuk

bpuk

    Sergeant

  • Forum Members
  • PipPipPip
  • 50 posts

Posted 16 August 2005 - 03:58 AM

OK, time to look at the schema for buying/selling :)

At the moment we have price/upkeep defined invididually in combatants.xml, crafts.xml and facilities.xml

no prices defined for items.

Should all the prices and upkeeps go in a transactions.xml file, or should I add (optional)price to the schema for items?

Also - which file should I be putting costs for scientists/engineers in?

Ta
Ben
.... . .- -.. ..-. --- .-. - .... . .... .. .-.. .-.. ...
- .... . -.-- .-. . -.-. --- -- .. -. --. ..-. .-. --- -- - .... . .... .. .-.. .-.. ...
.... . .- -.. .- .-- .- -.-- ..-. .-. --- -- - .... . .... .. .-.. .-.. ...

#2 bpuk

bpuk

    Sergeant

  • Forum Members
  • PipPipPip
  • 50 posts

Posted 17 August 2005 - 03:06 AM

OK - I'm going with a transactions.xml - at least for items and personell, crafts/facilities may be added later (if needed)
<transactions>
    <action name="ActionName" keys="Ctrl-T"/>
    <transaction name="PERSONELL_ENGINEER" category="PERSONELL">
        <price purchase="75000" sell="0"/>
        <upkeep cost="2000"/>
    </transaction>
    <transaction name="PERSONELL_SCIENTIST" category="PERSONELL">
        <price purchase="75000" sell="0"/>
        <upkeep cost="2000"/>
    </transaction>    
    <transaction name="ITEM_PISTOL" category="SMALLARMS">
        <price purchase="5000" sell="2000"/>
        <upkeep cost="0"/>
    </transaction>    
      .... etc.
</transactions>

Figures, per usual, off the top of my head.

Comments?

Ta
Ben

Edited by bpuk, 17 August 2005 - 03:08 AM.

.... . .- -.. ..-. --- .-. - .... . .... .. .-.. .-.. ...
- .... . -.-- .-. . -.-. --- -- .. -. --. ..-. .-. --- -- - .... . .... .. .-.. .-.. ...
.... . .- -.. .- .-- .- -.-- ..-. .-. --- -- - .... . .... .. .-.. .-.. ...

#3 UnFleshed One

UnFleshed One

    Programming Department

  • Xenocide Inactive
  • 304 posts

Posted 17 August 2005 - 03:40 AM

<action name="ActionName" keys="Ctrl-T"/>


What's that? :D

BTW, I think upkeep cost can be included into price
<price purchase="75000" sell="0" upkeep="2000"/>
Unless there is a reason for separating.
Darkness is under the candle.

#4 bpuk

bpuk

    Sergeant

  • Forum Members
  • PipPipPip
  • 50 posts

Posted 17 August 2005 - 04:03 AM

<action name="ActionName" keys="Ctrl-T"/>


What's that? :D

BTW, I think upkeep cost can be included into price
<price purchase="75000" sell="0" upkeep="2000"/>
Unless there is a reason for separating.

<{POST_SNAPBACK}>


*cough* copy-paste error... :Coffee:

OK, integrated into schema - upkeep optional. Slight changes (on further consideration)

<transactionTable>
	<transaction name="PERSONELL_ENGINEER" purchasable="yes" buildable="no">
  <price purchase="75000" sell="0" upkeep="2000"/>
	</transaction>
	<transaction name="PERSONELL_SCIENTIST" purchasable="yes" buildable="no">
  <price purchase="75000" sell="0" upkeep="2000"/>
	</transaction>    
	<transaction name="ITEM_PISTOL" purchasable="yes" buildable="no">
  <price purchase="5000" sell="2000"/>
	</transaction>  
</transactionTable>
<transactionCategories>
	<category name="SMALLARMS">
  <item name="ITEM_PISTOL"/>
	</category>
	<category name="PERSONELL">
  <item name="PERSONELL_SCIENTIST"/>
  <item name="PERSONELL_ENGINEER"/>
	</category>
</transactionCategories>

Splitting the categories is much easier to parse when it comes to building the buy/sell lists :)

Ta
Ben
.... . .- -.. ..-. --- .-. - .... . .... .. .-.. .-.. ...
- .... . -.-- .-. . -.-. --- -- .. -. --. ..-. .-. --- -- - .... . .... .. .-.. .-.. ...
.... . .- -.. .- .-- .- -.-- ..-. .-. --- -- - .... . .... .. .-.. .-.. ...

#5 bpuk

bpuk

    Sergeant

  • Forum Members
  • PipPipPip
  • 50 posts

Posted 17 August 2005 - 05:31 AM

Sorry for (repeated) double post...
I've stripped the categories out of the [temp] schema for the moment, need to think on the best way of handling them. Possibly in a second file

Added transactions.{xml,xsd}

added core/transactions/transactions.{cpp,h} (Yes, I do have a reason for putting it here. There'll probably be another class pair, and possibly a third. Could be wrong though - if so, feel free to move it to staticdata and tell me off :))

class Transaction is the xenocide interface to the transaction.xml file

Basic testing done only, some old (commented) code still in there - will be modified and corrected in next patch.

Patch attached :D

Ta
Ben

EDIT 1: Found (stupid) mistake in attachment - removed
EDIT 2: Corrected stupid mistake - attached

Attached Files


Edited by bpuk, 17 August 2005 - 05:43 AM.

.... . .- -.. ..-. --- .-. - .... . .... .. .-.. .-.. ...
- .... . -.-- .-. . -.-. --- -- .. -. --. ..-. .-. --- -- - .... . .... .. .-.. .-.. ...
.... . .- -.. .- .-- .- -.-- ..-. .-. --- -- - .... . .... .. .-.. .-.. ...

#6 red knight

red knight

    Xenocide Project Leader

  • Xenocide Inactive
  • 3,310 posts

Posted 20 August 2005 - 12:18 PM

Has this patch been integrated already?

Greetings
Red Knight
Sourceforge Nick: flois - Federico Andres Lois
Visit my blog at: flois.blogspot.com

Posted Image

Pookie cover me, I am going in.

#7 bpuk

bpuk

    Sergeant

  • Forum Members
  • PipPipPip
  • 50 posts

Posted 20 August 2005 - 12:48 PM

Has this patch been integrated already?

Greetings
Red Knight

<{POST_SNAPBACK}>


Doesn't look like it has.

Ta
Ben

P.S. This should be the last 'core' patch before getting visible changes in buy/sell

Edited by bpuk, 20 August 2005 - 12:49 PM.

.... . .- -.. ..-. --- .-. - .... . .... .. .-.. .-.. ...
- .... . -.-- .-. . -.-. --- -- .. -. --. ..-. .-. --- -- - .... . .... .. .-.. .-.. ...
.... . .- -.. .- .-- .- -.-- ..-. .-. --- -- - .... . .... .. .-.. .-.. ...

#8 red knight

red knight

    Xenocide Project Leader

  • Xenocide Inactive
  • 3,310 posts

Posted 21 August 2005 - 12:50 PM

Could not merge, missing line. Can you update and repost?

Greetings
Red Knight
Sourceforge Nick: flois - Federico Andres Lois
Visit my blog at: flois.blogspot.com

Posted Image

Pookie cover me, I am going in.