New DLL callbacks - any requests?
Moderators: GSH, VSMIT, Red Devil, Commando
- General BlackDragon
- Flying Mauler
- Posts: 2408
- Joined: Sat Feb 19, 2011 6:37 am
- Contact:
Re: New DLL callbacks - any requests?
Yes. But with multiple hardpoints of same type, it fills from top down. Would be useful to be able to designate which slot to try to put the weapon in.
Battlezone Classic Public Forums
*****General BlackDragon*****
*****General BlackDragon*****
Re: New DLL callbacks - any requests?
I can see the use of setting the index direct, allowing for more complex weapon modification and distribution. I take it this would require making a new overload for that stock function in engine though rather than just binding up some existing functions to the DLL.General BlackDragon wrote:Yes. But with multiple hardpoints of same type, it fills from top down. Would be useful to be able to designate which slot to try to put the weapon in.
Re: New DLL callbacks - any requests?
Can't this behavior already be worked around. For example if you want to give a heavy sabre an at stabber and a sp stabber.
Just give the unit two sp stabbers so both top and bottom slots are filled with sp. Then give an at stabber to fill the top. You did say it fills from top to bottom.
Just give the unit two sp stabbers so both top and bottom slots are filled with sp. Then give an at stabber to fill the top. You did say it fills from top to bottom.
Re: New DLL callbacks - any requests?
Code: Select all
weaponHard1 = "HP_CANNON_1"
weaponName1 = " "
weaponAssault1 = 0
weaponHard2 = "HP_CANNON_2"
weaponName2 = " "
weaponAssault2 = 0
Code: Select all
weaponHard2 = "HP_CANNON_2"
weaponName2 = " "
weaponAssault2 = 0
weaponHard1 = "HP_CANNON_1"
weaponName1 = " "
weaponAssault1 = 0
Just to prevent any confusion.
Re: New DLL callbacks - any requests?
Lets say your 2nd gun is one you have to change into a different one the longer it is being fired (like an accelerating mini-gun). If you can't specify index, it can go quite off the rails. That is something I want to do, but I don't want to lock it to only a specific craft.Commando wrote:Can't this behavior already be worked around. For example if you want to give a heavy sabre an at stabber and a sp stabber.
Just give the unit two sp stabbers so both top and bottom slots are filled with sp. Then give an at stabber to fill the top. You did say it fills from top to bottom.
Re: New DLL callbacks - any requests?
GBD says the DLL can't order a factory (or recycler) to build something, only the constructor. That's gotta get fixed else we are forever tied to purely AIPs for building orders.
Re: New DLL callbacks - any requests?
Not sure what the issue there is, as it is you can easilly get the recy and fact to produce whatever you want, even if its scouts from a fact and Atanks from a recy.
Re: New DLL callbacks - any requests?
It would be great if one could track all ordnance with handles and who they belong to.
// Return the current controls for the vehicle including human players
VehicleControls GetControls(Player h)
// This does not always work. First of all a weapon mask is only accepted for some AI Processes and even if then
for example activating a special like phantom vir only works when the underling AI Process would do so too.
SetControls()
However even better would be an AI Process that does nothing but accepts a complete VehicleControls Object
including a complete weapon mask. Needed for DLL controled ships.
// Might be useful, especially with the above
SetAIProcess(Handle h)
// Return true if the ship has a special like phantom vir activated. The DLL cannot know that as it is now.
HasSpecialActivated(Handle h)
// Returns the charge level of a charge gun weapon. The DLL cannot know that as it is now.
int IsChargingWeapon(Handle h)
// I think it is not possible to know what map one is on in IA
GetMap()
// Might be useful to dynamically generate paths
CreatePath()
// Since 1.3 odf inheritance is supported, whoever all of the getter function do not track back
// the inheritance tree to find a value
GetODFFloat(), etc
// Get a height map. Useful for manual navigation
GetTerrain()
// It does not seem possible to reliably test if an odf is of a certain type (see next suggestion too)
char * isClassLabel(char * odf);
// check if an odf has a section (possibly empty)
HasODFSection(char * sectionname) returns true if the odf has this section
// Return true if the user is targeted and by whom
Handle IsTargeted(Handle h);
// Return the current controls for the vehicle including human players
VehicleControls GetControls(Player h)
// This does not always work. First of all a weapon mask is only accepted for some AI Processes and even if then
for example activating a special like phantom vir only works when the underling AI Process would do so too.
SetControls()
However even better would be an AI Process that does nothing but accepts a complete VehicleControls Object
including a complete weapon mask. Needed for DLL controled ships.
// Might be useful, especially with the above
SetAIProcess(Handle h)
// Return true if the ship has a special like phantom vir activated. The DLL cannot know that as it is now.
HasSpecialActivated(Handle h)
// Returns the charge level of a charge gun weapon. The DLL cannot know that as it is now.
int IsChargingWeapon(Handle h)
// I think it is not possible to know what map one is on in IA
GetMap()
// Might be useful to dynamically generate paths
CreatePath()
// Since 1.3 odf inheritance is supported, whoever all of the getter function do not track back
// the inheritance tree to find a value
GetODFFloat(), etc
// Get a height map. Useful for manual navigation
GetTerrain()
// It does not seem possible to reliably test if an odf is of a certain type (see next suggestion too)
char * isClassLabel(char * odf);
// check if an odf has a section (possibly empty)
HasODFSection(char * sectionname) returns true if the odf has this section
// Return true if the user is targeted and by whom
Handle IsTargeted(Handle h);
Re: New DLL callbacks - any requests?
Already exists, use this. Just replace ".trn" with ".bzn", as there's a 1:1 relationship between .bzn and .trn files// I think it is not possible to know what map one is on in IA
GetMap()
// Gets the currently loaded map's .trn filename.
DLLEXPORT const char* DLLAPI GetMapTRNFilename(void);
Tracking up the inheritance tree is *expensive*. Saved for map loading only.// Since 1.3 odf inheritance is supported, whoever all of the getter function do not track back
// the inheritance tree to find a value
GetODFFloat(), etc
Also expensive. Items know who they target. But, many items may target an object, so it has to search all items and test them individually to see if they are targeting the specified handle. Also, passing lists back and forth from exe to DLL is rarely done, and when done, only in a C-style array. This is because C++ structures (std::vector, etc) allocated from the exe cannot reliably be freed by the DLL, and vice versa. The exe uses dlmalloc for allocations, while the DLL can use Visual Studio 6, Visual Studio 2002, 2003, 2005, 2008, 2010, or 2012 libraries for allocations.// Return true if the user is targeted and by whom
Handle IsTargeted(Handle h);
-- GSH
Re: New DLL callbacks - any requests?
Speaking if cleaning up, is there a way for the DLL to now if the user manually aborted the session?
Re: New DLL callbacks - any requests?
With what, the AIP? Making dummy AIPs just to make a factory or recycler make something is pretty nonsense.Red Spot wrote:Not sure what the issue there is, as it is you can easilly get the recy and fact to produce whatever you want, even if its scouts from a fact and Atanks from a recy.
- General BlackDragon
- Flying Mauler
- Posts: 2408
- Joined: Sat Feb 19, 2011 6:37 am
- Contact:
Re: New DLL callbacks - any requests?
Thought of a neat one:
SetTeamName(int Team, name Name);
Set the name for a specific team. I know it uses Team1/2 in team play, and anything > team 10 is either a fallback or "unknown team". This would allow custom DLLs to assign the team's name.
SetTeamName(int Team, name Name);
Set the name for a specific team. I know it uses Team1/2 in team play, and anything > team 10 is either a fallback or "unknown team". This would allow custom DLLs to assign the team's name.
Battlezone Classic Public Forums
*****General BlackDragon*****
*****General BlackDragon*****
Re: New DLL callbacks - any requests?
Isn't this already done? I've played games with custom team names...General BlackDragon wrote:Thought of a neat one:
SetTeamName(int Team, name Name);
Set the name for a specific team. I know it uses Team1/2 in team play, and anything > team 10 is either a fallback or "unknown team". This would allow custom DLLs to assign the team's name.
- General BlackDragon
- Flying Mauler
- Posts: 2408
- Joined: Sat Feb 19, 2011 6:37 am
- Contact:
Re: New DLL callbacks - any requests?
There's Team 1 and 2 in shell, (Team 1-5, 6-10) and then there's an svar11 for a fallback team name instead of "unknown team"
But, there's no way to specify a specific name for team 11, 12, 13, 14, and 15.
Code: Select all
11: Team name for a craft on team "group" 3 (teams
11..15). Teams must be on for this to take effect. This is not an
officially supported team group, but support was added for named items
on it. If this svar is empty, the default "Unknown Team" string is
used instead.
Battlezone Classic Public Forums
*****General BlackDragon*****
*****General BlackDragon*****
Re: New DLL callbacks - any requests?
Would it be possible to "up" the simulation speed? Such that bots could fight each other in faster than realtime.
This would be for machine learning purposes.
This would be for machine learning purposes.