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

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

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

Post Reply
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

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

Post 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.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

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

Post 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 :/
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

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

Post 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?
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

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

Post 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.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

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

Post 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
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

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

Post by hoijui »

has at least one bug in the above version, will fix...
Post Reply

Return to “AI”