Page 5 of 8

Re: New DLL callbacks - any requests?

Posted: Fri Apr 18, 2014 7:16 pm
by AI_Unit
How about using some DLL Callbacks in AIP format? Like Patrolling and Defending Units? Would save a lot of time, plus might improve AI performance ;)

This might be a good Example:

[Plan 1]
planType = "Patrol"
planPriority = 999
planCondition = "Exists"
planConditionClass = "PATROL_UNIT"
planConditionCount = 2
planConditionClassProvided = true
planCompare = "<="
patrolType1 = "PATROL_UNIT"
patrolPath1 = "PATH_NAME"
buildIfNoIdle = 1

Re: New DLL callbacks - any requests?

Posted: Fri Apr 18, 2014 11:30 pm
by Red Spot
I'm afraid that would just cause problems as good coding dictates you check what you do before you do it. How are you going to check the existance of a path from the AIPs? You'll still need the dll, afaik.

Re: New DLL callbacks - any requests?

Posted: Sat Apr 19, 2014 12:57 pm
by AI_Unit
Red Spot wrote:I'm afraid that would just cause problems as good coding dictates you check what you do before you do it. How are you going to check the existance of a path from the AIPs? You'll still need the dll, afaik.
The same way that the Hold does and the Basebuildminimus in 1.3 AIP code. That allows the path to be missing or if it's there, it uses it. E.G.

planCondition3 = "PathExists"
pathpointsCanBeMissing = true

Re: New DLL callbacks - any requests?

Posted: Mon Apr 21, 2014 4:24 am
by Red Devil
that doesn't work very well, so use the Lua functions for checking pathpoints.

Re: New DLL callbacks - any requests?

Posted: Mon Apr 21, 2014 11:44 am
by AI_Unit
I'm just looking for a simpler way lol. It took me about 6 hours to figure it out, with TONS of help too xD

Re: New DLL callbacks - any requests?

Posted: Mon May 05, 2014 10:48 pm
by Zero Angel
I'm trying to locate/troubleshoot a bug where damage will sometimes fluctuate when it's not supposed to (a so-called 'random damage' bug).

Could a DLL callback be implemented that can get the damage value of any given weapon/explosion, and possibly output it to a DLL/logfile if the DLL supports that? It might help with bug testing and I can test custom DLLs with others through the vsr-alpha program.

Re: New DLL callbacks - any requests?

Posted: Wed May 07, 2014 7:31 am
by Nielk1
Zero Angel wrote:I'm trying to locate/troubleshoot a bug where damage will sometimes fluctuate when it's not supposed to (a so-called 'random damage' bug).

Could a DLL callback be implemented that can get the damage value of any given weapon/explosion, and possibly output it to a DLL/logfile if the DLL supports that? It might help with bug testing and I can test custom DLLs with others through the vsr-alpha program.
Get the damage from the ODF of the weapon probably, though you will need a little bit of logic to dive through the files right, as well as calculations on explosion damage. Track all handles you care about in a big array and all their healths in a 2nd big array. Basically...

Re: New DLL callbacks - any requests?

Posted: Sat Jun 07, 2014 5:10 pm
by General BlackDragon
A Get parallel to DLLEXPORT void DLLAPI SetWeaponMask(Handle me, long mask); would be nice.

DLLEXPORT long DLLAPI GetWeaponMask(Handle h);

Re: New DLL callbacks - any requests?

Posted: Fri Jun 13, 2014 11:10 pm
by General BlackDragon
Thought of another useful get. A parellel to:

DLLEXPORT void DLLAPI SetGroup(Handle h, int group);


DLLEXPORT int DLLAPI GetCurGroup(Handle h); // Returns which int Group the unit is currently in. (0-9)

Re: New DLL callbacks - any requests?

Posted: Tue Jul 01, 2014 5:57 pm
by General BlackDragon
Found that classlabel = "assaulthover" returns GetObjInfo Get_GOClass of CLASS_UNKNOWN. I don't see a CLASS_ASSAULTHOVER in the class list in script utils.

Re: New DLL callbacks - any requests?

Posted: Wed Aug 20, 2014 12:42 pm
by AI_Unit
General BlackDragon wrote:Thought of another useful get. A parellel to:

DLLEXPORT void DLLAPI SetGroup(Handle h, int group);


DLLEXPORT int DLLAPI GetCurGroup(Handle h); // Returns which int Group the unit is currently in. (0-9)
Might actually come in useful when the DLL tells a unit to do something first priority, or when a new unit is added to the game.

Re: New DLL callbacks - any requests?

Posted: Sun Jan 18, 2015 6:46 am
by General BlackDragon
ATM there is an IsPerson call. It'd be nice to have other similar functions, like IsBuilding and IsVehicle (Craft?), IsWeapon, etc...

Re: New DLL callbacks - any requests?

Posted: Sun Jan 18, 2015 10:15 am
by mase
char objclass[64];
GetObjInfo(h,Get_GOClass,objclass);

Already does that ;-)

Re: New DLL callbacks - any requests?

Posted: Sun Jan 18, 2015 10:54 am
by General BlackDragon
That returns each individual classlabel. There is Get_EntityType though, but it I see that certain types are seperate, like Craft and Vehicle are separate.

I suppose I could write a helper function that does similarly.

Re: New DLL callbacks - any requests?

Posted: Tue Jul 21, 2015 3:14 pm
by General BlackDragon
Thought of a really good and probably easy one:

DLLEXPORT const char*DLLAPI GetAIP(int Team); // Returns the current AIP in use by the specified Team. Returns NULL if Team is invalid, or no AIP is running on that team.