View topic - [Legacy C++ API] How can i set share m/e level?



All times are UTC + 1 hour


Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: 08 Sep 2010, 11:53 
AI Coder

Joined: 17 Mar 2008, 19:03
Location: RF
How can i set share m/e level? I see no functions. I would use SendResources() if i could read m/e values of allied players.


Top
 Offline Profile  
 
PostPosted: 08 Sep 2010, 18:49 
Spring Developer
User avatar

Joined: 22 Sep 2007, 08:51
had a look, and it would need a new network message (eg NETMSG_AISETSHARE), for the same reason we already have a NETMSGAISHARE. the normal SETSHARE uses myPlayerNum, and so only works for players, not AIs. of course this is some ugly internal sturcture.. we should have AI and player share a common parent class in lots of places...
in short: not very easy :/


Top
 Offline Profile  
 
PostPosted: 08 Sep 2010, 20:14 
AI Coder

Joined: 17 Mar 2008, 19:03
Location: RF
Ok, if its hard can you implement reading m/e storage and actual values of allied players/AIs? Or is it hard too?


Top
 Offline Profile  
 
PostPosted: 08 Sep 2010, 21:50 
Spring Developer
User avatar

Joined: 22 Sep 2007, 08:51
done, please test it with this build:
http://springrts.com/dl/buildbot/defaul ... -g1f664b6/

commit:
http://github.com/spring/spring/commit/ ... 852a#L2R63


Top
 Offline Profile  
 
PostPosted: 09 Sep 2010, 11:26 
AI Coder

Joined: 17 Mar 2008, 19:03
Location: RF
Thanks. Is there no mistake: spring_0.82.3-252-g1f664b6.exe ? It's 0.82.3 in the name, not 0.82.5.

PS. Also i do not see a function which can enumerate all teams in the game. Am i right that it is normal that i should get all units at game start then use GetUnitTeam() for each one? It is suitable for beginning of the game, not mid-game join.


Top
 Offline Profile  
 
PostPosted: 09 Sep 2010, 14:33 
Spring Developer
User avatar

Joined: 22 Sep 2007, 08:51
the name should be spring_0.82.0 still (in master), but due to some mergeing, it is now 0.82.3. that is all there is wrong, the number.

fetching teams:
http://springrts.com/mantis/view.php?id=2101


Top
 Offline Profile  
 
PostPosted: 10 Sep 2010, 10:32 
Spring Developer
User avatar

Joined: 22 Sep 2007, 08:51
has at least one bug in the above version, will fix...


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.