Page 1 of 1

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

Posted: 08 Sep 2010, 12:53
by slogic
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.

Re: [Legacy C++ API] How can i set share m/e level?

Posted: 08 Sep 2010, 19:49
by hoijui
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 :/

Re: [Legacy C++ API] How can i set share m/e level?

Posted: 08 Sep 2010, 21:14
by slogic
Ok, if its hard can you implement reading m/e storage and actual values of allied players/AIs? Or is it hard too?

Re: [Legacy C++ API] How can i set share m/e level?

Posted: 08 Sep 2010, 22:50
by hoijui

Re: [Legacy C++ API] How can i set share m/e level?

Posted: 09 Sep 2010, 12:26
by slogic
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.

Re: [Legacy C++ API] How can i set share m/e level?

Posted: 09 Sep 2010, 15:33
by hoijui
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

Re: [Legacy C++ API] How can i set share m/e level?

Posted: 10 Sep 2010, 11:32
by hoijui
has at least one bug in the above version, will fix...