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?

Postby AI_Unit » Fri Apr 18, 2014 7:16 pm

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: 1627
Joined: Mon Feb 21, 2011 6:14 pm
Location: The Netherlands

Re: New DLL callbacks - any requests?

Postby Red Spot » Fri Apr 18, 2014 11:30 pm

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?

Postby AI_Unit » Sat Apr 19, 2014 12:57 pm

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: 4394
Joined: Fri Feb 18, 2011 5:10 pm
Location: High in the Rocky Mountains
Contact:

Re: New DLL callbacks - any requests?

Postby Red Devil » Mon Apr 21, 2014 4:24 am

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?

Postby AI_Unit » Mon Apr 21, 2014 11:44 am

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?

Postby Zero Angel » Mon May 05, 2014 10:48 pm

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?

Postby Nielk1 » Wed May 07, 2014 7:31 am

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: 2401
Joined: Sat Feb 19, 2011 6:37 am
Contact:

Re: New DLL callbacks - any requests?

Postby General BlackDragon » Sat Jun 07, 2014 5:10 pm

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: 2401
Joined: Sat Feb 19, 2011 6:37 am
Contact:

Re: New DLL callbacks - any requests?

Postby General BlackDragon » Fri Jun 13, 2014 11:10 pm

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: 2401
Joined: Sat Feb 19, 2011 6:37 am
Contact:

Re: New DLL callbacks - any requests?

Postby General BlackDragon » Tue Jul 01, 2014 5:57 pm

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?

Postby AI_Unit » Wed Aug 20, 2014 12:42 pm

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: 2401
Joined: Sat Feb 19, 2011 6:37 am
Contact:

Re: New DLL callbacks - any requests?

Postby General BlackDragon » Sun Jan 18, 2015 6:46 am

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: 155
Joined: Sat Mar 05, 2011 11:17 am

Re: New DLL callbacks - any requests?

Postby mase » Sun Jan 18, 2015 10:15 am

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

Already does that ;-)

User avatar
General BlackDragon
Flying Mauler
Posts: 2401
Joined: Sat Feb 19, 2011 6:37 am
Contact:

Re: New DLL callbacks - any requests?

Postby General BlackDragon » Sun Jan 18, 2015 10:54 am

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: 2401
Joined: Sat Feb 19, 2011 6:37 am
Contact:

Re: New DLL callbacks - any requests?

Postby General BlackDragon » Tue Jul 21, 2015 3:14 pm

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*****


Return to “Battlezone 2 Mod Making”

Who is online

Users browsing this forum: No registered users and 1 guest