This is the mail archive of the xconq7@sources.redhat.com mailing list for the Xconq project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

how simulate with xconq the units limit  model of games likewarcraft


I want to simulate with xconq the units limit  model of games like warcraft, starcraft, tzar, ... where before building a new unit a test is made to ensure that there are housing capacity for this unit.

Those games force the build of a type of unit building or facility where the only use is to add to treasury some material, this material is consumed from the treasury by the unit's creation process and stocked into the unit.

If the unit dies, is disbanded or change of side the materiel stocked inside is returned to the treasury

I want to begin contributing to the development of xconq little by little but it is not simple.

So I have decided to make litle changes that not requires many skils.xconq7 at sources dot redhat dot com.

I do not understand why the modification in the function init_supply   of file init.c do not work, I have not errors, nor warnings during compilation but the kernel ignores the else part???

These modification should give to the treasury (if defined for the material) the initial materials, for which the unit has not capacite of storage.

If anyone saw why that does not work... Thanks!

for example:

(game-module "habitat"
  (blurb "Testing habitat game")
  )
(terrain-type plains (char "+"))

(unit-type person (image-name "person") (char "@")
  (start-with 1)
  (acp-per-turn 4)
  )
(unit-type house (image-name "camp") (help "where persons lives"))
(material-type habitat (help "every unit in game must have a place to live"))

(add habitat treasury true)
(add habitat initial-treasury 10) ;;enables begining the game without buildings

(table gives-to-treasury
  (person habitat true)
  (house habitat true))

(table takes-from-treasury
  (house habitat true))

(table acp-to-build
  (house person 1));; where persons are born

(table unit-initial-supply
  (person habitat 1) ;; transfert du material habitat from treasury to person
  (house habitat 15));; enables the building of 15 units type person

(table consumption-on-creation
  (person habitat 1)) ;; one person born one habitat taken from treasury

(table unit-storage-x
(person habitat 1)) ; stock habitat material

(table recycleable-material
(person habitat 1)) ; if a unit type person is disbanded it gives habitat material to the treasury
;; I think that this table should be used by kernel anywhere when the side looses the control of the unit forever
--
Juan Francisco Oteros Garcia <garcia dot oteros at wanadoo dot fr>

Attachment: init_supply.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]