Search

Search found 16 matches

by Shaitan
29 Jan 2014, 08:55
Forum: AI
Topic: [solved] i don't know my enemy
Replies: 4
Views: 1362

Re: i don't know my enemy

AF wrote:springai::Unit* unit = springai::WrappUnit::GetInstance(skirmishAIId, evt->unitId);
yes, that's what i needed. thank you, Tom!
by Shaitan
23 Jan 2014, 04:16
Forum: AI
Topic: [solved] i don't know my enemy
Replies: 4
Views: 1362

Re: i don't know my enemy

PicassoCT wrote:if you had acess to the synced lua, i would say to try to get this as a enemyid via a pushed lua_call down into the engine identified..
i'm sorry, i can't understand what you wrote. does that mean i can't get what i want in C++?
by Shaitan
22 Jan 2014, 11:08
Forum: AI
Topic: path cost is always zero
Replies: 8
Views: 2237

Re: path cost is always zero

looks like the returned zero is a path ID, which i'm supposed to pass to

Code: Select all

springai::AIFloat3 GetNextWaypoint(int pathId)
but that function always returns an invalid AIFloat3. so i'm still stuck.
by Shaitan
22 Jan 2014, 10:59
Forum: AI
Topic: [solved] i don't know my enemy
Replies: 4
Views: 1362

[solved] i don't know my enemy

Code: Select all

struct SEnemyEnterLOSEvent {int enemy;};
how to get Unit* or UnitDef* out of that?
by Shaitan
16 Jan 2014, 11:09
Forum: AI
Topic: what is spot average income?
Replies: 1
Views: 937

what is spot average income?

trying to get it with

Code: Select all

callback->GetMap()->GetResourceMapSpotsAverageIncome(callback->GetResourceByName("Metal"))
but it returns me 0.65 for the Delta Siege Dry map, whereas a metal extractor produces 2.04 actually.

what's the trick?
by Shaitan
12 Jan 2014, 16:06
Forum: AI
Topic: path cost is always zero
Replies: 8
Views: 2237

Re: path cost is always zero

shall i report the bug? can you inform those who need to know about it?
by Shaitan
12 Jan 2014, 07:18
Forum: AI
Topic: path cost is always zero
Replies: 8
Views: 2237

path cost is always zero

the following code ... for(std::vector<springai::AIFloat3>::iterator i = metalSpots.begin(); i != metalSpots.end(); ++i) { ... int length = callback->GetPathing()->GetApproximateLength(commanderUnit->GetPos(), *i, 0, 8.0f); ...} ... always returns zero path cost: armcom position: (2565.161133, 120.8...
by Shaitan
10 Jan 2014, 16:09
Forum: AI
Topic: [solved] first steps in developing a C++ AI
Replies: 10
Views: 4706

Re: first steps in developing a C++ AI

all right, that's how: ... springai::Unit* commanderUnit = callback->GetTeamUnits().front(); ... commanderUnit->Build(callback->GetUnitDefByName("armsolar"), commanderUnit->GetPos(), UNIT_COMMAND_BUILD_NO_FACING); ... thank you guys for your help. now i can proceed to the most exciting part.
by Shaitan
09 Jan 2014, 16:14
Forum: AI
Topic: [solved] first steps in developing a C++ AI
Replies: 10
Views: 4706

Re: first steps in developing a C++ AI

AF wrote:springai::UnitDef* ud = ....
i'm sorry, but since i don't have enough of "common sense and basic deducation combined with basic C++ knowledge", would you please explain to me how to get UnitDef for a solar collector from the C++ AI Interface Wrapper? it would be so tolerant of you.
by Shaitan
08 Jan 2014, 18:49
Forum: AI
Topic: [solved] first steps in developing a C++ AI
Replies: 10
Views: 4706

Re: first steps in developing a C++ AI

okay, let's say i want the commander to build a solar collector at the commander's current position. there's a build member function for a unit: Build(UnitDef* toBuildUnitDef, const springai::AIFloat3& buildPos, int facing, short options = 0, int timeOut = INT_MAX) correct me if i'm wrong, in my...
by Shaitan
08 Jan 2014, 17:52
Forum: AI
Topic: [solved] first steps in developing a C++ AI
Replies: 10
Views: 4706

Re: first steps in developing a C++ AI

http://springrts.com/wiki/AI:Development http://springrts.com/wiki/AIWrapper:Cpp minimalistic example ai: http://springrts.com/wiki/AI:CppTestAI source code: https://github.com/spring/spring/blob/develop/AI/Skirmish/CppTestAI/src/CppTestAI.cpp full-featured ai: https://github.com/Tarendai/Shard yes...
by Shaitan
08 Jan 2014, 15:43
Forum: AI
Topic: [solved] first steps in developing a C++ AI
Replies: 10
Views: 4706

[solved] first steps in developing a C++ AI

hello,

i'm stuck in the very beginning. how can i give orders?
by Shaitan
07 Jan 2014, 14:53
Forum: AI
Topic: [solved] how to build a C++ AI?
Replies: 7
Views: 1740

Re: how to build a C++ AI?

make AAI Shard Kaik
oh, that's really neat! :-) thank you, abma!
by Shaitan
07 Jan 2014, 13:56
Forum: AI
Topic: [solved] how to build a C++ AI?
Replies: 7
Views: 1740

Re: how to build a C++ AI?

yes, compiling inside spring is recommended as some ai interface / header files are automaticly generated. (afaik) you can extract all dependencies but imo its not worth the trouble/time. if you are using linux then compiling should be quiet easy ... yes, i'm on Kubuntu. i noticed the new release o...
by Shaitan
04 Jan 2014, 12:12
Forum: AI
Topic: [solved] how to build a C++ AI?
Replies: 7
Views: 1740

[solved] how to build a C++ AI?

hello and happy New Year!

do i have to incorporate the AI sources into the Spring sources and then build and install Spring from the sources? is there another way without building Spring?

Go to advanced search