Page 7 of 8
Re: New DLL callbacks - any requests?
Posted: Tue Mar 15, 2016 1:18 am
by Commando
Could always swap out the G66 DLL for a Stock DLL to see if it still happens. If I had the source to RD's G66 I could check to make sure it's not DLL caused.
Easier said than done. It's hard enough to find G66 games, it's even harder to find stock games.
Re: New DLL callbacks - any requests?
Posted: Tue Mar 15, 2016 9:09 am
by mase
The server knows when a resync happens and then sends hat info to the clients affected, couldn't they then call a callback into the DLL?
Couldn't you test that resync issue locally by starting 2 bz2 sessions?
Re: New DLL callbacks - any requests?
Posted: Thu Apr 21, 2016 4:18 pm
by General BlackDragon
I'd like to request a Vector GetWhere(Handle h); function, that works similar to GetWho, but returns the current vector of where the current command (GetCurrentCommand) is set to. This would help know where a unit is going, or etc.
Re: New DLL callbacks - any requests?
Posted: Tue Aug 16, 2016 9:33 pm
by Nielk1
Any way to get an enumerable set of handles would be awesome, it would really help my lua wrapper. Right now I am looking at keeping a sequence number octree as my core and at postload pushing in meta data for querying. Be nice if I didn't have to store everything myself for basic lookups (plus the fact I'd have to only sometimes update my construct's locations).
Re: New DLL callbacks - any requests?
Posted: Sun Aug 28, 2016 5:34 pm
by General BlackDragon
A few functions that would be useful:
A SetCanSnipe function that sets the same as canSnipe = true/false in the ODF, on the handle. This would negate the need for modders to make special, non snipe-able odfs for SP missions.
// Sets if a handle can be sniped, -1 = Auto-determine from type (default, tracked/walkers/flying not snipe-able), 0 = Not snipe-able, 1 = snipe-able.
DLLEXPORT void DLLAPI SetCanSnipe(Handle me, int CanSnipe = -1);
A version of Damage/DamageF that takes a handle for the causer. The current method, if something is killed by this in MP, it says killed by (AI Unit) in chat. Requesting a way to assign an owner to the damage the way SelfDamage does.
DLLEXPORT void Damage(Handle him, Handle me, long Amt);
Functions to Get/Set the spin rate of vehicles.
// Gets the omega rate of a vehicle/person.
DLLEXPORT vector DLLAPI GetOmega(Handle h);
// Sets the handle's omega rate to the specified vector.
DLLEXPORT void DLLAPI SetOmega(Handle h, Vector omega);
Also, some more functions that quarry basic types like IsPerson() might be more efficient then manually using GetObjClass and stricmp_s.
// Returns true if it's a CraftClass.
DLLEXPORT bool DLLAPI IsVehicle(Handle me);
// Returns true if it's a BuildingClass.
DLLEXPORT bool DLLAPI IsBuilding(Handle me);
// Returns true if it's a PowerupClass.
DLLEXPORT bool DLLAPI IsPowerup(Handle me);
Re: New DLL callbacks - any requests?
Posted: Mon Oct 17, 2016 2:32 am
by Red Devil
DLLEXPORT bool DLLAPI IsTargeted(Handle me, Handle him);
DLLEXPORT bool DLLAPI IsTarget(Handle him);
Re: New DLL callbacks - any requests?
Posted: Tue Oct 18, 2016 1:20 am
by GSH
RD-
The first request seems like you could use this already-existing function:
Code: Select all
DLLEXPORT Handle DLLAPI GetTarget(Handle h);
bool IsTargeted(Handle me, Handle him)
{
return (me && him && (him == GetTarget(me));
}
Second is a lot more work. Each GameObject can have (at most) one target. To see if something is targeted by someone else, the code has to do an iterate over all GameObjects, and check its target. Probably not noticeable even if called 25 times per turn thanks to all the other optimizations I've put in, but still, not free.
-- GSH
Re: New DLL callbacks - any requests?
Posted: Tue Oct 18, 2016 1:47 am
by Red Devil
darn it, i looked for Target and it found nothing :-/
Re: New DLL callbacks - any requests?
Posted: Tue Oct 18, 2016 2:36 am
by General BlackDragon
Q about the new handle list function:
Can it work similar to the GetAllSpawnpoints() where it fills in a struct with some of the useful info about a handle already filled out? Idk if it'd be easiest to just copy all the GameObject* vars into the struct, but I imagine filling out half of the useful ones wouldn't be too hard.
something like:
Code: Select all
// Structure for GetAllHandles()
struct HandleInfo
{
Handle m_Handle;
Matrix m_Position; // Matrix, so no need for separate Front. //GetFront()
int m_Team;
int m_PerceivedTeam;
int m_Group;
int m_Independence;
int m_Skill;
long m_CurrHealth;
long m_MaxHealth;
long m_CurrAmmo;
long m_MaxAmmo;
long m_WeaponMask;
Vector m_Velocity;
Vector m_Omega;
char m_Race;
char* m_Name; // Same as GetObjectiveName().
char* m_Label;
char* m_PilotClass;
int m_CategoryType;
Handle m_Owner;
float m_LifeSpan;
float m_RemainingLifeSpan;
char* m_Classlabel;
char* m_GOClass;
int m_CurrCommand;
Handle m_CurrWho;
Vector m_CurrWhere;
Handle m_CurrTarget; // Does this differ from CurrWho/GetCurrentWho?
Handle m_WhoShotMe;
int m_LastEnemyShot;
int m_LastFriendShot;
int m_TeamSlot;
// Things not currently retrievable, aside from direct ODF reading, that might be more efficient to retrieve here, and might be useful.
float m_EngageRange;
float m_CollisionRadius;
int m_ScrapCost;
int m_ScrapValue;
int m_PowerCost;
char m_ArmorClass;
char m_ShieldClass;
int m_ScanTeamLimit;
bool m_IsAssault;
bool m_CanCollide;
bool m_CanDetect;
bool m_CanInteract;
bool m_CanSnipe;
bool m_CanBeIdleVictum; // Useful for selecting targets for DLL driven attacks to omit this object.
bool m_DoIdleDispatch;
bool m_CanAIPForceIdle;
bool m_WingmanProcessAttackMines;
bool m_NonWingmanProcessAttackMines;
bool m_Bailout;
bool m_AIEject;
};
Re: New DLL callbacks - any requests?
Posted: Wed Oct 26, 2016 7:53 pm
by General BlackDragon
Dunno why I didn't think of this earlier...
DLLEXPORT int DLLAPI GetCurrCommandPriority(Handle me);
Re: New DLL callbacks - any requests?
Posted: Wed Oct 26, 2016 8:22 pm
by GSH
// Structure for GetAllHandles()
struct HandleInfo
{
...
That type of interface is extremely fragile, and would basically prevent additions in the long term. If this thread is any indication, "moar info!" is the DLL author's motto. However preserving back-compat to existing DLLs would be extremely tricky to do while adding in more info in later versions. BZ2's simple C-like API is extensible; this is not.
-- GSH
Re: New DLL callbacks - any requests?
Posted: Wed Oct 26, 2016 9:50 pm
by General BlackDragon
Ah, okay. I was just wondering.
Re: New DLL callbacks - any requests?
Posted: Thu Oct 27, 2016 2:51 pm
by General BlackDragon
Something that would be useful, would be something similar to KillPilot, which simulates a snipe, but takes a handle or team to give credit to. ATM it just says killed by (null) in MP. (I use it to simulate sniping)
DLLEXPORT void DLLAPI SnipeObject(Handle me, Handle him); // (or instead of him, int SniperTeam) Kills the pilot, and reports the killer as the specified handle.
Re: New DLL callbacks - any requests?
Posted: Thu Oct 27, 2016 6:55 pm
by General BlackDragon
Another small request:
Can "GetPilotClass()" return the cfg, not the odf? It's an odd asymmetry, SetPilotClass("blah") vs GetPilotClass() returning "blah.odf".
EDIT:
Can PreOrdnanceHit callback be made to also trigger when a terrain owning building is hit? Currently it doesn't.
Re: New DLL callbacks - any requests?
Posted: Thu Nov 03, 2016 3:56 pm
by General BlackDragon
DLLEXPORT long DLLAPI GetSwitchMask(Handle h); // Like GetWeaponMask, but returns the object's switchMask (used by pilots and morphtanks).