New DLL callbacks - any requests?

Moderators: GSH, VSMIT, Red Devil, Commando

Post Reply
User avatar
GSH
Patch Creator
Posts: 2486
Joined: Fri Feb 18, 2011 4:55 pm
Location: USA
Contact:

New DLL callbacks - any requests?

Post by GSH »

I've explored adding some new exe -> DLL callbacks, where the DLL can be notified of things. Right now, I've added messages to the DLL on snipes and also ordnance hitting a gameobject. Any other requests? Be reasonable, or the request might be ignored.

-- GSH
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 »

being able to see explosions maybe?

More specific entries for GetNearest* objects. Maybe a GetNearestClasslabel("CLASS_BLAH", teamfilter, distance);

I had noticed a while back that getNearestPowerup did not include classlabel camerapod.

Currently AudioMessage("blah.wav"); plays sounds in order. Is there a way to make a sound happen instantly? like giving it a higher priority? When several audioMessages are called, sometimes they may delay a more important audio message. I've tried the purge as true and false, it has no effect on this behavior, though i'm not entirely sure what it's supposed to do.

For the animations, there is only Set, Start, and getframe. Can there be a StopAnimation(Handle h, Name n); where it pauses the animation, or stops it once it ends/reaches beginning of loop?
Battlezone Classic Public Forums
*****General BlackDragon*****
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 »

When an order is given with priority 0, leaving the user in control, the unit acts as if the player gave the order, resulting in the voice over being played. There is a squelch on/off, but it is only designed to force the voice overs to play when priorities over 0 are used. Some method to squelch this on priority zero without breaking the existing missions using the stock command (so I guess a new command) would be appreciated. It was the one think preventing me from having a working hunt.

The ability to check the current orders of a factory or constructor down to what it is building. I have not tested the existing functions with constructors, but I know that trying to check the current orders on a factory or recycler building gives no useful values. Knowing what is being built and when can be quite helpful, at least knowing when building is starting and stopping (by checking a state value per execute or a callback) would allow for triggering of custom animations in the factory while it builds (for example, BZ1's animations).

On the note of the above, if it was a callback, the ability to intercept and deny a build request would be neat. It would allow for custom resources to be done without a complex system of provides or using only scrap and power, but it might be against the way the system is designed.

Some form of filtered (or even unfiltered) finding does sound useful, though I can't give any suggestions on how to implement it. The ability to "find in sphere" or some such and getting an array of handles would be nifty, as currently we have to track every object that can be effected and globally check the entire list we have stored for its distance. Other find shapes like cones and boxes would be cool but any sort of find would allow us to create our own result culling after it has run.
Last edited by Nielk1 on Mon Jun 24, 2013 2:29 am, edited 1 time in total.
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 »

OH yeah, that reminds me. All of the GetNearest commands only find things in 2d space within the maxDist, not 3d space. Would be useful to have a way to check within 3d, vs 2d.
Battlezone Classic Public Forums
*****General BlackDragon*****
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 »

maybe DLL callbacks converted to Lua functions?
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
Nielk1
Flying Mauler
Posts: 2991
Joined: Fri Feb 18, 2011 10:35 pm
Contact:

Re: New DLL callbacks - any requests?

Post by Nielk1 »

Red Devil wrote:maybe DLL callbacks converted to Lua functions?
GSH already said that someone needs to make the ScriptUtils Lua bindings. I tried but I got lost in the stack since the LUA functions require manual popping and pushing onto the stack to make it work. I was never sure if I was leaving crap on the stack or not since it was unclear what was done automatically by returning from a bound function and what was not. Since, GSH has changed to a different LUA IIRC (unless he is still using stock lua5.1 bindings) what I did wouldn't be that useful anyway. Unless he hasn't, in which case, ick. I've got to talk to Ken again some time about how he did his LUA for BZ1, maybe you could talk to him RD and then do the bindings how he describes? Once the process of binding is known, it is just lots and lots of busy work.

If GSH wanted to bind a few functions as an example and pass it off I am sure we could get it done.
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 »

Ooo, I know two that would be VERY useful.

Goto(Handle me, Vector Pos, int priority = 1);

GiveWeapon(Handle me, Name weapon, int weaponIndex);
Battlezone Classic Public Forums
*****General BlackDragon*****
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 »

Some method to know for sure that a unit has dropped an item from a dispenser would be nice. It was noted when the getOwner function was added that it may not do what is expected as it is not absolute.
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 »

i, too, tried and quickly got lost trying to do the lua bindings. show us the way and i will do the grunt work.
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
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 good one,

FireAt(Handle me, Handle him = 0, bool doAim = false, int WeaponIndex);
Battlezone Classic Public Forums
*****General BlackDragon*****
User avatar
GSH
Patch Creator
Posts: 2486
Joined: Fri Feb 18, 2011 4:55 pm
Location: USA
Contact:

Re: New DLL callbacks - any requests?

Post by GSH »

Lua bindings could theoretically be done in a DLL, mapping calls to ScriptUtils.h calls.

Things like goto/fire at are much harder to do than expected. All AI is managed thru the *Process interfaces, and overriding them at the drop of a hat is a lot of work.

-- GSH
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 »

Darn, I was hoping a Goto that takes a vector position would be easy to do :(
Battlezone Classic Public Forums
*****General BlackDragon*****
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 »

Yea for Lua my hope is to have a bindings for script utils that the AIP can use and have a mission DLL that has all the core callbacks implemented and ones for my custom data-channel too. I haven't touched the DLLs in a long time though, probably since I tried to do the Lua the first time. I wonder if Ken knows of an auto-bindings that I could try.
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 »

Currently, there is no way to tell which pilot odf is inside of a ship.

DLLEXPORT void DLLAPI SetPilotClass(Handle obj, char* odf);

This sets the pilot class, Would it be easy to add the following that returns the pilot config odf for the pilot inside a ship?:

DLLEXPORT char DLLAPI GetPilotClass(Handle obj);
Battlezone Classic Public Forums
*****General BlackDragon*****
User avatar
GSH
Patch Creator
Posts: 2486
Joined: Fri Feb 18, 2011 4:55 pm
Location: USA
Contact:

Re: New DLL callbacks - any requests?

Post by GSH »

GiveWeapon(Handle me, Name weapon, int weaponIndex);
There's already GiveWeapon(Handle me, Name weapon) -- like above, but no index. That existing function just subcontracts out to the same code as the powerup pickup logic -- checking whether the ship has hardpoints that match weapon types, etc.

-- GSH
Post Reply