Time Limit Town Win

questions and answer about OFP/ArmA editing

Time Limit Town Win

Postby BL1P » Sat Dec 19, 2009 6:55 am

Im trying to make the game give a win based on town count after time limit is reached rather than offer the win as a draw ..

Code: Select all
#Draw
   

   _w = ("(_x select tdSide) == _si0" count towns)   
   _e = ("(_x select tdSide) == _si1" count towns)   


   ? _e > _w: _siLoser = si0; _siWinner = si1; _textResult = "East Win TL Town Win"
   ? _w > _e: _siLoser = si1; _siWinner = si0; _textResult = "West Win TL Town Win"   
   ? _e == _w: goto "Draw2"
   
   
   ? (_drawReason == 0): _textReason = format ["TL = (%1h) - E Towns = %2 - W Towns = %3", timeLimit/(60*60), _e, _w ]

   _mhqLoser = mhq select _siLoser
   _mhqWinner = mhq select _siWinner
   _textLoser= sideNames select _siLoser
   _textWinner= sideNames select _siWinner
   "1" ObjStatus "FAILED"
   "2" ObjStatus "FAILED"
   _gameEndType = 2
   goto "Start"

#Draw2
   _textResult = "TL TOWN DRAW"
   ? (_drawReason == 0): _textReason = format ["TL = (%1h) - E Towns = %2 - W Towns = %3", timeLimit/(60*60), _e, _w ]
   _siLoser = si0
   _siWinner = si1
   _mhqLoser = mhq select _siLoser
   _mhqWinner = mhq select _siWinner
   _textLoser= sideNames select _siLoser
   _textWinner= sideNames select _siWinner
   "1" ObjStatus "FAILED"
   "2" ObjStatus "FAILED"
   _gameEndType = 2
   goto "Start"



This section of the code :-

_w = ("(_x select tdSide) == _si0" count towns)
_e = ("(_x select tdSide) == _si1" count towns)

is returning a value of 0 for both sides even if 1 side holds a town
Im testing it with a 10min time limit and letting the ai side take a town and not taking a town myself ..

Any ideas ?
-==I AM THE BL1P==-
--===NER NER===--
BL1P
 
Posts: 44
Joined: Wed Jun 20, 2007 2:38 pm
Location: UK
 

Re: Time Limit Town Win

Postby Benny » Sat Dec 19, 2009 10:24 am

Correct me if i'm wrong but shouldn't it be ?

_w = {_x select tdSide == _si0} count towns;
_e = {_x select tdSide == _si1} count towns;

Had the feeling that you were working with string.
Benny
 
Posts: 1877
Joined: Wed Jun 04, 2008 12:31 pm
Location: France, Normandie
 

Re: Time Limit Town Win

Postby BL1P » Sun Dec 20, 2009 2:41 am

Thanks but Im afraid it still returns a value of 0 for that section of code :(
-==I AM THE BL1P==-
--===NER NER===--
BL1P
 
Posts: 44
Joined: Wed Jun 20, 2007 2:38 pm
Location: UK
 

Re: Time Limit Town Win

Postby Benny » Sun Dec 20, 2009 10:19 am

Just wondering, i see in your code.
Code: Select all
_siLoser = si0
_siWinner = si1


What if you try this:
Code: Select all
_w = {_x select tdSide == si0} count towns;
_e = {_x select tdSide == si1} count towns;
Benny
 
Posts: 1877
Joined: Wed Jun 04, 2008 12:31 pm
Location: France, Normandie
 

Re: Time Limit Town Win

Postby BL1P » Mon Dec 21, 2009 12:14 pm

Atm i have opted for a win based on scores rather than towns as the towns was proving difficult to achieve..

I made a Publicvariable that is created and alterd depending who is on-top in the leaderboard then i called that variable as the winner..

so far this seems to work fine ...

ill work on towns again after the hols :)

thanks for your help ! :)
-==I AM THE BL1P==-
--===NER NER===--
BL1P
 
Posts: 44
Joined: Wed Jun 20, 2007 2:38 pm
Location: UK
 

Return to Editing

Who is online

Users browsing this forum: No registered users and 1 guest

cron