New DLL callbacks - any requests?

Moderators: GSH, VSMIT, Red Devil, Commando

User avatar
AI_Unit
Thunderbolt
Posts: 186
Joined: Fri Mar 30, 2012 11:53 pm
Location: Mire, negotiating with Scions.
Contact:

Re: New DLL callbacks - any requests?

Post 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
Current Mod: AI's Expansion Pack

AI_Unit was here.
User avatar
Red Spot
Attila
Posts: 1629
Joined: Mon Feb 21, 2011 6:14 pm
Location: The Netherlands

Re: New DLL callbacks - any requests?

Post 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.
User avatar
AI_Unit
Thunderbolt
Posts: 186
Joined: Fri Mar 30, 2012 11:53 pm
Location: Mire, negotiating with Scions.
Contact:

Re: New DLL callbacks - any requests?

Post 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
Current Mod: AI's Expansion Pack

AI_Unit was here.
User avatar
Red Devil
Recycler
Posts: 4398
Joined: Fri Feb 18, 2011 5:10 pm
Location: High in the Rocky Mountains

Re: New DLL callbacks - any requests?

Post by Red Devil »

that doesn't work very well, so use the Lua functions for checking pathpoints.
If given the truth, the people can be depended upon to meet any national crisis. The great point is to bring them the real facts - and beer.
Abraham Lincoln

Battlestrat, FE, G66, In The Shadows, Starfleet, Uler, & ZTV

Lifetime member of JBS and NRA
User avatar
AI_Unit
Thunderbolt
Posts: 186
Joined: Fri Mar 30, 2012 11:53 pm
Location: Mire, negotiating with Scions.
Contact:

Re: New DLL callbacks - any requests?

Post 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
Current Mod: AI's Expansion Pack

AI_Unit was here.
User avatar
Zero Angel
Attila
Posts: 1536
Joined: Mon Feb 21, 2011 12:54 am
Contact:

Re: New DLL callbacks - any requests?

Post 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.
Regulators
Regulate any stealin' of this biometal pool, we're damn good, too
But you can't be any geek off the street
Gotta be handy with the chains if you know what I mean
Earn your keep
User avatar
Nielk1
Flying Mauler
Posts: 2991
Joined: Fri Feb 18, 2011 10:35 pm
Contact:

Re: New DLL callbacks - any requests?

Post 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...
User avatar
General BlackDragon
Flying Mauler
Posts: 2408
Joined: Sat Feb 19, 2011 6:37 am
Contact:

Re: New DLL callbacks - any requests?

Post by General BlackDragon »

A Get parallel to DLLEXPORT void DLLAPI SetWeaponMask(Handle me, long mask); would be nice.

DLLEXPORT long DLLAPI GetWeaponMask(Handle h);
Battlezone Classic Public Forums
*****General BlackDragon*****
User avatar
General BlackDragon
Flying Mauler
Posts: 2408
Joined: Sat Feb 19, 2011 6:37 am
Contact:

Re: New DLL callbacks - any requests?

Post 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)
Battlezone Classic Public Forums
*****General BlackDragon*****
User avatar
General BlackDragon
Flying Mauler
Posts: 2408
Joined: Sat Feb 19, 2011 6:37 am
Contact:

Re: New DLL callbacks - any requests?

Post 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.
Battlezone Classic Public Forums
*****General BlackDragon*****
User avatar
AI_Unit
Thunderbolt
Posts: 186
Joined: Fri Mar 30, 2012 11:53 pm
Location: Mire, negotiating with Scions.
Contact:

Re: New DLL callbacks - any requests?

Post 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.
Current Mod: AI's Expansion Pack

AI_Unit was here.
User avatar
General BlackDragon
Flying Mauler
Posts: 2408
Joined: Sat Feb 19, 2011 6:37 am
Contact:

Re: New DLL callbacks - any requests?

Post 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...
Battlezone Classic Public Forums
*****General BlackDragon*****
mase
Thunderbolt
Posts: 160
Joined: Sat Mar 05, 2011 11:17 am

Re: New DLL callbacks - any requests?

Post by mase »

char objclass[64];
GetObjInfo(h,Get_GOClass,objclass);

Already does that ;-)
User avatar
General BlackDragon
Flying Mauler
Posts: 2408
Joined: Sat Feb 19, 2011 6:37 am
Contact:

Re: New DLL callbacks - any requests?

Post 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.
Battlezone Classic Public Forums
*****General BlackDragon*****
User avatar
General BlackDragon
Flying Mauler
Posts: 2408
Joined: Sat Feb 19, 2011 6:37 am
Contact:

Re: New DLL callbacks - any requests?

Post 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.
Battlezone Classic Public Forums
*****General BlackDragon*****
Post Reply