Andrew Downing
Members-
Content Count
7 -
Joined
-
Last visited
Community Reputation
0 NeutralAbout Andrew Downing
-
Rank
On the Coast
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
class A<Class T> { void A() { PrintFormat("this is %1", Type()); // this is A<@B> PrintFormat("T is %1", T); // T is B } void bar(A<T> other) {} } class B {} void foo() { auto a = new A<ref B>(); a.bar(new A<ref B>()); //Error: Types 'A<@B>' and 'A<B>' are unrelated auto arr1 = new array<ref B>(); auto arr2 = new array<ref B>(); arr1.InsertArray(arr2); //Error: Types 'array<@B>' and 'array<B>' are unrelated } array.InsertArray(array<T> other) or any template function that uses T without the `ref` qualifier when the class was instantiated with a strong reference type parameter seems to be broken. The source of the problem seems to be that the `ref` qualifier is dropped from the template type parameter. If you add `ref` before T in `bar`, there is no error. If this wasn't just a mistake I'd guess that it was done because you can always add the `ref` qualifier on the template parameter, but not take it away. I think this causes more harm than good though because now you can't actually write a generic function. You need to write two versions of the function, one with `ref` and one without. To me the reasonable thing to do would be to retain the `ref` qualifier on the type parameter and provide a way to remove it if needed. Something like void bar(A<remove_ref<T>> other).
-
You need to copy the .bikey files from the keys directory of the mod to the keys directory of your server.
-
I'm wondering this too. I can get messages to show up, but only in red. The other message styles don't seem to work. Which mod is this? I think you could use a PBO decompiler to see how they did it.
-
The issue was that I was trying to use Weapon_Base which is the 3_Game module, inside AnalyticsManager which is in the 4_World module. I didn't realize that classes defined in a module are only available in that module, or higher numbered modules. I haven't seen any documentation stating that, I just happened to find that info in someones personal blog. The solution was to use a modded override on PlayerBase::EEKIlled() and ZombieBase::EEKilled() which are in 4_World along with MissionBaseWorld. I added a modded override MissionBaseWorld::OnEntityKilled() which the EEKilled() functions call. I could then override OnEntityKilled() in my mission class in the 5_Mission module.
-
I just saw Debug->Debug Server in the script editor, that works. It seems like there must be a way to log to the server console too though.
-
How do you print messages to the server console? Print() calls seem to go nowhere when running DayZDiag_x64.exe with the -server flag. They aren't showing up in the server console, or in the script editor output pane. Also, is it possible to get DayZDiag_x64.exe with -server to connect to the script editor? It seems like only the client instance of DayZDiag_x64.exe connects to the script editor.
-
I'm an experienced programmer, but have no experience with Enforcescript or modding DayZ. This got me started: https://community.bistudio.com/wiki/DayZ:Modding_Basics. I'm expanding on the example they have there and trying to show when a player kills something. Here is what I have. #include "scripts/3_Game/analytics/analyticsmanagerserver.c" #include "scripts/4_World/entities/firearms/weapon_base.c" modded class AnalyticsManagerServer { override void OnEntityKilled( Object killer, EntityAI target ) { super.OnEntityKilled(killer, target); Weapon_Base w = Weapon_Base.Cast(killer); Print(killer); Print(target); Print(w); } } This mostly works except for casting to Weapon_Base. The script editor outputs this when I shoot a zombie: SCRIPT : Object killer = Mp133Shotgun_Base<179c6ec0> SCRIPT : EntityAI target = ZmbM_HermitSkinny_Base<deea31b0> Here is the problem I have when compiling: SCRIPT (E): FirstMod/Scripts/3_Game/analytics/AnalyticsmanagerServer.c(9): error: Unknown type 'Weapon_Base If I take out the first #include I also get this error when compiling (everything still works the same though): SCRIPT (E): FirstMod/Scripts/3_Game/analytics/AnalyticsmanagerServer.c(14): error: Unknown type 'AnalyticsManagerServer' I'm not sure what i need to do to be able to use Weapon_Base here, or any other class I might later decide to use. I also have no idea why in their example linked above there is no unresolved type error for PlayerBase, but I do have one for AnalyticsManagerServer unless I have that first #include.