RE: problems calling train

23 views
Skip to first unread message

Andre Doumad

unread,
Dec 10, 2012, 11:20:48 PM12/10/12
to bw...@googlegroups.com
does unit-train() take arguments? unit-train(8) I haven't played with that code in years but I would figure you would pass an argument to the method. 


Sent from my Galaxy S®III



-------- Original message --------
From: thiagoh <thi...@gmail.com>
Date:
To: bw...@googlegroups.com
Subject: problems calling train


I have a problem.. 
I am trying to create many Terra Marines for example.. so I call (for example) unit->train() 8 times and all off the callings return true.. but just one of them is created.. why??

Krasimir Krystev

unread,
Dec 11, 2012, 2:24:05 AM12/11/12
to bw...@googlegroups.com
thiagoh, 
you should call train() on the barracks for example (I guess unit is a barracks unit ?).  the argument is not the number of marines to train but what unit type. in this case you should pass UnitTypes::Terran_Marine
If you want to queue the creation of more than one marine, you either use a buildordermanager (look at BWSAL for example) or call the train method sequentially on different frames through some intervals.
--
BR
--
BR

Thiago Andrade

unread,
Dec 11, 2012, 9:07:50 AM12/11/12
to bw...@googlegroups.com
@Krasimir!! you're right!! thank you a lot!!
--
Thiago Andrade

MSc Candidate in Computer Science, Federal University of Pernambuco (UFPE) – Brazil
BSc in Computer Engineering, University of Pernambuco (UFPE) – Brazil
Software Architect


Reply all
Reply to author
Forward
0 new messages