#enfusion_scripting
1 messages Β· Page 23 of 1
log has no details
13:19:45.171 BACKEND : Ping Site: new_york
13:19:45.370 DEFAULT : Entered online game state.
13:19:45.470 SCRIPT (F): Cannot start game. Check log for details!
server runs, people can join it, but when they try to spawn in it just hangs on loading screen
i made no changes from last night to this morning, the update broke it
Oh maybe you need to use ForceChamber to false.
This log means the server failed to start. Do what it says. Read the log
bro i am lol, theres nothing here to indicate why it failed
its something to do with my gamemode, i removed gamemode and i could spawn from camera
(same behavior in editor) was hanging on spawn
what changes are there that were not in the patch notes? is there link to the diff anywhere
the diff link should be included in the patch notes news updates
because u guys always change something thats not in the patch notes
thank you!
weird problem here but probably super easily fixable
it says this "68570C6DF24DE342 1.0.3 not found" but that guid is the mod im tryin to update to v1.0.3
GameProject {
ID "VehicleArsenal1"
GUID "68570C6DF24DE342"
TITLE "VehicleArsenal1"
Dependencies {
"58D0FB3206B6F859" "666AD6D3A4C5D771" "5B383D4CB27E0D54" "669E20987D8BB3B5" "620D239ED2B0BFAC" "66F2FE84CFBB0D0F" "63294BA2D9F0339B" "5D9ECAD071E9ECBC" "5C721177A220B42F" "5D1880C4AD410C14" "63120AE07E6C0966" "5E0AB16BEB16D6A4" "61BA4EB5C886D396" "595F2BF2F44836FB" "64610AFB74AA9842" "61ED28EAECF0D304" "61A6374EF871C0E3" "620D239ED2B0BFAC"
i already deleted it and re downloaded and that did nothing
ForceChamber is what exactly? π
How exactly do we add more scenario properties to the game master menu?
A method
Must be some Bohemia Black Magic method as I cant find anything like that anywhere
it might be a param
GM attributes are registered in Configs/Editor/AttributeLists/Edit.conf
The scenario properties just expect the game mode entity to be passed instead of an editable entity component.
e.g. SCR_GlobalCharRegenEditorAttribute
Haha I figured it out but appreciate it. Love the config naming 
Edit seems to be the name for anything GM related haha
GameModeEditModeEdit
no way
You would think this isnβt possible
we heard you liked crashes so we added a crash to the crash for more crashes
With being better at troubleshooting than coding itself(atleast on the enfusion engine). I've felt more useful lately 
I do enjoy troubleshooting but it sucks I canβt debug the problem deeper. It will be cool when/if itβs figured out
Maybe once I hit 5000 hours in the workbench. Only 3500 so far
Yeah I have tried somewhat but it's difficult to extract logs from console versions of the game. If a developer could find a server where players are constantly crashing, do a playtest with the same mods, and use their tooling to see when and why the game freezes constantly, it would open up the avenue for either:
The core issue being fixed so that mods cannot cause it.
A announcement to tell modders to not do the thing which is causing it.
I've seen here from Mario that it is not the job of modders to try to optimize the game.
Conversely, in the feedback tracker ticket that has been open since May of last year concerning these freezes, Lou said that it is an issue of mods/modders not optimizing. Seeing the issue compound for 9 months with each update is concerning to say the least. If mods are the issue, we need to be told where and why - because the rare minority of modders are going to be able to actively find issues, especially those on a platform they either don't play on, or can't see the logs for.
Weve had luck posting our crash ids in enfusion general
Usually Arkensor is able to tell you exactly what caused the crash
Wish there was some API we could use that'd tell us so we didn't have to pester a dev for it

@mellow stump to continue what I mentioned in #enfusion_engine message
Here's an example for what I did for a vanilla weapon, I put this in a component that is in the weapon's prefab:
[Attribute("0 0 0", desc: "Yaw, Pitch, and Roll of the w_sight bone")]
vector m_YawPitchRoll;
//------------------------------------------------------------------------------------------------
override void EOnActivate(IEntity owner)
{
TNodeId sightBone = owner.GetAnimation().GetBoneIndex("w_sight");
vector mat[4];
Math3D.AnglesToMatrix(m_YawPitchRoll, mat);
owner.GetAnimation().SetBoneMatrix(owner, sightBone, mat);
}
does anybody use visual studio code to mod or make a mod in or for amra reforger?
Which class could I override so players in a fuel truck get XP for transporting fuel from point A to point B, not just the refuel_support XP? They're a bomb on wheels so figure anyone in the fuel truck gets XP for being sacrifices of science.
Wish that was possible, but everything is integrated for Script editor AFAIK.
AIRBURST :DDDDD
It's possible because ik a guy that does it bc he's currently working on a arma life, like he ripped all the stuff from arma 3 and put it in arma
Bruhhhhhhh I've been looking for a mod that does this lol hurry up with it lmao (jk) π€£
ill try and finish up the framework asap and hopefully everyone can go nuts lol, its mostly just getting the projectile to read the fuze time from the gun thats a pain in the ass because it goes through the player char too.
I searched high and low, even asked creators that were trying π
Main things to check atm are that it works in MP [so getting an otherwise working xm25 to really test it] and i'll still release an SP version for people to fix it if i can't for MP BUT I think should just work π€
I wrote you a DM
Bruhhhhhhhh lmk when ya upload the mod man I can't wait to play with it
Does the EventHandlerManagerComponent work on a weapon or just on a character?
For example the "OnAmmoCountChanged" handler. The wiki says it works on both, but I can't get it to work on a weapon.
I'm running this on the weapon EOnInit event:
EventHandlerManagerComponent eventHandlerManager = EventHandlerManagerComponent.Cast(owner.FindComponent(EventHandlerManagerComponent));
if (eventHandlerManager)
eventHandlerManager.RegisterScriptHandler("OnAmmoCountChanged", owner, OnAmmoChangeCallback);
Here's the callback function for testing, but it's not executing when firing the weapon.
protected void OnAmmoChangeCallback(BaseWeaponComponent currentWeapon, BaseMuzzleComponent currentMuzzle, BaseMagazineComponent magazine, int ammoCount, bool isChambered)
{
Print("TEST");
}
I guess the code for the named event handlers is hardcoded since I can't find the scripts that invoke the events, so I can't see where and how they are invoked.
Yes it comes from game code not script
Ok, so is there a way to tell which predefined event handlers work on which type of entities?
No not really. Check vanilla scripts. They are purpose built and added when needed. They usually don't work anywhere else than where we use it
Ok, thank you. I'll try to work around them.
Just trying to figure out how to detect a weapon firing.
By chance have a video of how to script with arma reforger code
It seems these event handlers only work with the SCR_ChimeraCharacter entity that already has the EventHandlerManagerComponent.
Although I was able to add the "OnProjectileShot" handler to the event list manually as it was not there, but it still works.
I think these are the only official videos at the moment. That's how I started.
https://www.youtube.com/playlist?list=PLfUcrRpCM_fKjkTrkV-bqnknVbFCPA3YU
You need basic OOP programming knowledge to get much out of them, though.
anyone know if there is a way to detect ambient light level as of right now id like to move my Auto on off function of my NVG mod to detect ambient Light levels in the world but fear there is a Hard Engine limit for it
Can anyone point me at any resources regarding Enfusion and its threading model? Is it possible for race conditions to occur? ( particularly when using GetCallqueue ... eg GetGame().GetCallqueue().CallLater(SomeFunction, 60000, true); I havent noticed any obvious concurrency primitives so I suspect not, but I'm new to Enfusion so may be missing something.
There is no multi threading of scripts
Thats what I expected to hear but just wanted to check. Thanks for the help.
No multi threading, callqueue is just processed in main thread on a later frame i.e. it's async but not threaded. IIRC it is advised to not overload the global callqueue with your own stuff, rather you should create your own callqueue for your mod/system e.g.
class DL_LootSystem : WorldSystem
{
ref ScriptCallQueue callQueue = new ScriptCallQueue();
override void OnUpdate(ESystemPoint point)
{
float time = GetGame().GetWorld().GetFixedTimeSlice();
callQueue.Tick(0.001 * time);
}
override void OnInit()
{
callQueue.Call(ReadLootCatalogs);
callQueue.Call(ReadVehicleCatalogs);
}
}
Thanks ... I was thinking about this very thing.
think that is just screen based
that blows
Any info on what the TraceParam class "float TraceDist" field contains?
The description says "traced polygon plane distace". I'm guessing it means distance of the traced polygon plane to somewhere, but where?
It's not to the start of the trace or to the end. Doesn't matter where I trace it from, or where on the face the trace lands, the value is the same for the face that was traced.
Iirc it would always be zero or one unless you enabled some flag
I'm getting values of -150 to 150 and everything in between depending on the normal of the face. Ocean surface seems to be 0.
Maybe it's a distance from the center of the face to the nearest aligned axis? When I move the entity closer to the world origin, the numbers get smaller.
Also, opposite faces of a square object seem to give opposite signs, the other positive and the other negative, so maybe the sign is the face direction?
my flags are TraceFlags.ENTS | TraceFlags.WORLD | TraceFlags.OCEAN
Its just trace distance from start to hit
You are probably into that case where it does not matter to fill it
So its probably just reading junk
We would need to see your entire setup, including the params and the trace call
I'm starting the trace from my gun when I fire, and no matter where I stand, the TraceDist is the same. But if I move my target entity to a new location, the values change, so I'm thinking it's related to a distance from the face to the world.
Share the code itself
Otherwise is just guessing and you are wasting your time
just a sec
I have a lot of test stuff there, I'm trying to condence it to the relevant
Just drop the whole thing, its fine
Any ideas?
DOn't do custom Param classes
TraceDist should always be 0 to 1.0
The extra param classes you see are handled by CPP
and you should not do custom ones from scripts
I guess we should block it
You are reading junk from memory
Ok, good to know. I'll try it without the custom class.
I saw that the TraceSegment method from SCR_PhysicsHelper calculated the hit position the same way, so I thought it was not available in the TraceParam
thought I'd derive from the TraceParam since there were other classes that did that too.
but I'll make my own container
If the problem still persists, make a feedback tracker ticket and tag me on it (I have same name there)
Ok, thank you
Is it normal for peertool to return the same PlayerID for peer and client?
PlayerId, from PlayerController GetGame().GetPlayerController().GetPlayerId()
I think it always returns 0 on client
Maybe try ```cs
SCR_PlayerController.GetLocalPlayerId()
If it's normal behavior for peertool but works on dedicated, then no worries really tbh. Was just confused as why my error print was popping up saying a PlayerId was already registered for my script lol
at first I thought you were talking about the duplicate identity error on the peer, thats annoying
ohhhh like from the backend api?
luckily I haven't needed to rely on that just yet 
Likely ran server side if it returns the same id then?
I never had issues with the pc.getplayerid()
class SCR_CampaignMapUIBase : SCR_CampaignMapUIElement
{
override bool OnMouseEnter(Widget w, int x, int y)
{
...
super.OnMouseEnter(w, x, y);
...
}
}
is there any way to override OnMouseEnter and call super.OnMouseEnter but not from SCR_CampaignMapUIBase but the one from SCR_CampaignMapUIElement?
only way to do this - override entire file where SCR_CampaignMapUIBase is defined and remove unwanted code
Is there a reason why print wouldn't work in game system OnUpdate? The code runs, just there is no prints working?
Hi any idea why my rendertarget not show the rig of the player ? any solution ?
Rig?
If you're meaning it's not showing your characters head, that's expected because your head isn't rendered in first person.
what could be causing a call later to not get called on clients?
Oh, okay, I understand better now. I guess it's only the person watching who can't see their head? If, let's say, another player stood in front of them, would I be able to see their head?
You know, these are the reasons why it's always better to ask about an issue before trying to figure it out one self. I feel like this would have taken forever to figure out if not aware in some way or another.
Pretty sure it would be quite hard for non modelers
I only know because one of the first things I did early on was start messing with render targets.
SAW mod?
Hey all, I just wanted to make a really basic component that destroys the engine of a vehicle when the component is initialized with EOnInit(), but a lot of the setters in this engine are actually protected. It's done through hitzones somehow I believe, but I can't find how to work with them. Is there like a GetHitzoneByName() or something? What component actually lets me interact with the hitzones through scripts? I've looked through SCR_EngineHitzone, SCR_DestructibleHitzone and the likes
Dont remember exactly, but it has the word Damage in it, maybe damageManager?
The first thing I looked at was something called VehicleDamageManagerComponent, but the setters were all protected
What's the best way of spawning a task when two other tasks are completed in the Scenario Framework? The Activation Conditions to do it seemt o be bugged
Get the hitzone and use SetHealthScaled(float), 1 = full health, 0 = fully damaged.
I would probably try 0.7 or something, not fully damaged.
And the hitzone I get how? Through GetHitZoneContainer() ?
SCR_VehicleDamageManagerComponent VDMComponent = SCR_VehicleDamageManagerComponent.Cast(pOwnerEntity.FindComponent(SCR_VehicleDamageManagerComponent));
array<HitZone> hitzones = {};
int count = VDMComponent.GetAllHitZones(hitzones);
then loop through to get engine one
Huh, I expected a getter that just gets me a hitzone by it's name or some type of number
Oh well
I'll try this, thank you
IDK, might be possible, Ive always got all the hitzones and looped through
Oh, well there you go, I looked at where GetAllHitZones even comes from and there's this here too
proto external HitZone GetHitZoneByName(string hitZoneName);

nice yeah thats probably faster! For what I was doing, I had multiple hitzones that I needed to grab anyways, some even were same type. I doubt there are 2 engines in many vehicles.
fuel tanks, there were 2 in some vanilla vehicles.
Fair. Might need to grab multiple down the road, we'll see
Kind of weird BI didn't have the fuel component inherit from some more generic fluid component. Right now if you wanted to have a water tank, acid tank or other type of fluid tank you'd have to use FuelManagerComponent - for fluids that are not necessarily a type of fuel.
Not sure how they could have the foresight to see someone would want that abstraction. If you're only thinking about fuel tanks its a "weird" idea
Well I mean FuelManagerComponent itself is pretty generic. It allows you to fill a container, drain a container, and have a container leak after it's damaged. There isn't much else it handles. To make it flammable you use a DamageManagerComponent instead, and to use up the liquid you use a FuelConsumptionComponent
It's weird they'd call it FuelManager when nothing in the component strictly makes it fuel
Either way I'm not complaining, it's just a weird choice imo
I was actually planning to make my own liquid component, but then I realized the FuelManagerComponent is not strictly for fuel, it's literally a liquid component that can be used for anything
It's not entirely clear with it being called FuelManager
In the base there is a method to call gethitzone by name
Also get all hitzones and all the goodies you need
Also if there are protected or private setter you can always cheese it by modding the class and making a public method that just calls it for you
Morning! Been interested in learning scripting for ages now, been reading through the wiki and following some of the examples in there - anyone know of any other learning resources? Tutorials or similar that are simple would also be really good to follow along? π
https://reforger.armaplatform.com/news/modding-boot-camps-introduction
This Modding Boot Camp seminar was originally held on the Arma Discord Server on November 20th, 2024.
Join Modding Supervisor Mario EnrΓquez for our first Modding Boot Camp, where he gives a quick overview of the Arma Reforger Tools and Workbench.
00:00 - Modding Boot Cam...
For scripting you need to watch the bootcamps video on
- introduction to enfusion
- scripting
- replication 1 and 2
And then you should have good enough bases to get properly started and work on your own stuff
The bootcamps vids i just listed are a must watch, you'll be completely lost without those
Arma Reforger scripts source code is the best learning resource available
That too but if you don't understand replication you'll be kinda stuck, i feel like the two bootcamp vids on replication are a MUST watch.
At least it's what made me understand the way it works
Yep replication bootcamps are definitely useful
Speaking of replication; I HAVE A DREAM, a dream in which custom classes were automatically made compatible with rpc calls without implementing codecs
We share the same dream
Allow me to pass a custom JsonApiStruct as an argument for an rpc call por favor 
Im trying to build a dayz 2.0 server in reforger. How would I go about using loot spawner mods to get loot to spawn in containers etc
I mean json structures are less optimized, just an immediate compatibility with replication (or a flag to raise)
Would be PEAK
A lot of my work is with the REST API so Json structs make more sense atleast until I go and learn how a Managed class works
Although to get around(works on workbench, needs tested in a DS env) that, I have a global custom struct variable, and the rpc on the client calls a function that takes that global var as an argument, and inside the function just sets it to itself xd
JStruct struct;
void func(JStruct struct)
{
struct = struct
}
8^) I love it here
Fair
Is there a way to open a VehicleDoor without character? i tryed with AnimationComp CMD but this is not working π
Via the compartment component I think. There is a method for it programmatically for sure, I use it in save game data
alls i can find is CompartmentAccessComponent opening doors, which I guess would still require a character π«€
Hey, would there be any reason that in a game master context action the hovered entity would be null?
override void Perform(
SCR_EditableEntityComponent hoveredEntity,
notnull set<SCR_EditableEntityComponent> selectedEntities,
vector cursorWorldPosition,
int flags,
int param = -1
)
{
LogKittenEye("KE_SpectateContextAction.Perform");
if(!hoveredEntity)
{
LogKittenEye("KE_SpectateContextAction.Perform: hoveredEntity is null, aborting");
return;
}
So most people who use one of my mod have no issues using the gm action but there is one user for who it just doesn't work the hovered entity is always marked as null and i find it quite strange, is there something i'm missing?
20:07:53.369 SCRIPT : -----[KittenEye] KE_SpectateContextAction.Perform
20:07:53.369 SCRIPT : -----[KittenEye] KE_SpectateContextAction.Perform: hoveredEntity is null, aborting
(The canbeshown also return false if that hoveredentity is null so it's really confusing me)
Maybe can use this for vehicles
CompartmentComp needs char.
Yeah you are correct, script can not do it at this time. make a modding feedback ticket about it perhaps
Hi,
I'm trying to use the Respawn Limiter mod: https://reforger.armaplatform.com/workshop/65F8F0B85BAAB7F9-RespawnLimiter
But I'm getting this error:
SCRIPT (E): Virtual Machine Exception
Reason: Index out of bounds.
Function: 'ClearPlayerRespawnTracking'
Stack trace:
scripts/Game/Components/PlayerRespawnLimiterComponent.c:284 Function ClearPlayerRespawnTracking
scripts/Game/Components/MyCustomGameMode.c:30 Function OnPlayerConnected
SCRIPT : Γ’ΒΒ
ClearPlayerRespawnTracking llamado para jugador 1
The function in PlayerRespawnLimiterComponent.c is :
static void ClearPlayerRespawnTracking(int playerId)
{
// Limpiar estructuras que usan playerId
s_mRespawnCounts.Remove(playerId);
s_blockedPlayers.Remove(playerId);
// Buscar entidad controlada por el jugador para limpieza adicional
PlayerManager mgr = GetGame().GetPlayerManager();
if (!mgr)
return;
PlayerController pc = mgr.GetPlayerController(playerId);
if (!pc)
return;
IEntity entity = pc.GetControlledEntity();
if (!entity)
return;
// β
Eliminar la entidad por valor (no por Γndice)
if (s_registeredEntities.RemoveItem(entity))
PrintFormat("ποΈ Entidad removida de s_registeredEntities para jugador %1", playerId);
if (s_countedDeaths.RemoveItem(entity))
PrintFormat("ποΈ Entidad removida de s_countedDeaths para jugador %1", playerId);
s_blockedPlayers.Insert(playerId);
s_newlyConnectedPlayers.Remove(playerId);
}
and its called in MyCustomGameMode.c here:
{
super.OnPlayerConnected(playerId);
PrintFormat("π [GameMode] Jugador %1 se ha conectado", playerId);
if (PlayerRespawnLimiterComponent.CanPlayerRespawn(playerId))
{
PrintFormat("β
Jugador %1 puede reaparecer normalmente", playerId);
return;
}
//Desbloquear player
PlayerController pc = GetGame().GetPlayerManager().GetPlayerController(playerId);
if (pc)
{
IEntity entity = pc.GetControlledEntity();
PlayerRespawnLimiterComponent.ClearPlayerRespawnTracking(playerId); // βοΈ
PlayerRespawnLimiterComponent.s_newlyConnectedPlayers.Insert(playerId);
PrintFormat("β
ClearPlayerRespawnTracking llamado para jugador %1", playerId);
}
}
Is the error returning because s_blockedPlayers is empty?
s_NewlyConnectedPlayer is using remove which will be the index
So if the playerId is 99 its removing index 99, assuming you are removing player Ids from that im guessing that unintended
Change it to RemoveItem and it should work assuming thats line 284
Line 284 is s_blockedPlayers.Remove(playerId) sorry
But I'm guessing its the same issue
I'm new to scripting and its not helped that the comments are all in Spanish trying to fix this haha
I've changed the Removes to RemoveItems, but I'm getting:
scripts/Game/Components/FixComponent.c(6): error: Undefined function 'map<int,int>.RemoveItem'
Ohhhh it's a map nvm
s_mRespawnCounts is a map
{
override static void ClearPlayerRespawnTracking(int playerId)
{
// Limpiar estructuras que usan playerId
s_mRespawnCounts.Remove(playerId);
s_blockedPlayers.RemoveItem(playerId);
// Buscar entidad controlada por el jugador para limpieza adicional
PlayerManager mgr = GetGame().GetPlayerManager();
if (!mgr)
return;
PlayerController pc = mgr.GetPlayerController(playerId);
if (!pc)
return;
IEntity entity = pc.GetControlledEntity();
if (!entity)
return;
// β
Eliminar la entidad por valor (no por Γndice)
if (s_registeredEntities.RemoveItem(entity))
PrintFormat("ποΈ Entidad removida de s_registeredEntities para jugador %1", playerId);
if (s_countedDeaths.RemoveItem(entity))
PrintFormat("ποΈ Entidad removida de s_countedDeaths para jugador %1", playerId);
s_blockedPlayers.Insert(playerId);
s_newlyConnectedPlayers.RemoveItem(playerId);
}
}```
This validated so let's see...
Then just leave that for the map, as the Remove method goes off of the Key
Well it's gotten rid of the error, but it turns out that error isn't why it wasn't working haha
Isn't the .Remove meant for indexes? Shouldn't you use RemoveItem(playerId)?
Tbf if it's not your mod all you can do is report the issue to the mod owner
Yeah that got rid of the error π
Oooof.... AI code....
AI code? How can you tell?
Btw if anyone has a clue of what's going on about this issue please let me know.
- print format
- π the system has SUCCESSFULLY STARTED
My best advice would be to try to do without ai code, it is a pain to learn properly but it is worth it, unfortunately ai in Enforce has no idea of how to write code that is working properly with Replication (client/server interactions), usually reinvent the wheels in a greatly unoptimized way and as soon as a major update will hit most of your work will require heavy refactoring to get back to a working state
It's not my code
Oh ok fair
I'm just trying to get the Respawn Limiter mod to work but it is refusing to do so haha
I got rid of the error but it's still not clearing everything on game start - so if you run the mission, die too many times so you go into spectator, then run the same mission again, it will still throw you into spectator
I'm trying to understand how it works but all the comments are in spanish + my scripting isn't great so it's giving me a headache
I'm not trying to be mean to the mod author but that mod has only 159 downloads, is written by AI, chances are it never worked and is still a WIP, or an abandoned project(the guy hasn't updated this mod in 5 months so the latter is more likely)
Trying to get it to work is probably easier than starting completely from scratch though, if it's working a bit now
Honestly no.
Fair enough
Ai code is nearly impossible to maintain without getting severally rage baited, you could get it work but i think it would be wiser to just start from scratch.
You could use the death event to track the number of death in the session of the user using a map of <player_uid, death count> and when they exceed a set threshold you disable the respawn button and assign them to a camera at their last death pos like that mod does.
I'm verynew to scripting so don't know what the death event is xD
Is it OnDestroyed?
OnPlayerKilled or OnPlayerDied i believe haven't messed with those in a bit
OnPlayerKilled, I have found it π
Looks like AI code, I'd just drop the mod
Yeah, I'm now onto the more complex problem of me learning to script when I haven't done any reforger scripting for 3 years π
Tbf it's not the most complicated thing, just tricky with replication
We shall see if I am crying in a few hours time
@stark cobalt
Thanks
They detail how replication works for the most part in RplDocs.c, the boot camp videos cover a lot
Workshop is becoming flooded with fully gpt-generated mods made by people who have absolutely no idea what they are doing, but descriptions of these mods (often gpt-generated as well
) claim that they do something useful, and other people believe it. At best, these mods do nothing (but still get planty of downloads). At worst, they actively make everything worse. I think Bohemia should start doing something about these tons of AI slop.
How will they detect ai generated mods?
π The system has started successfully
Wait, where is that guy who called modders who don't rely on AI gatekeepers and affirmed he would be having a fully functionial rp "arma life server thing" mod made entirely using AI?
Gate keepers? What gate? 
Cline's paywall probably
probably by using ai? LOL!
Did your cousin write this?
hahah yea my cuz grok wrote that slop
The workshop was full of slop long before AI was useable.
people just didn't have a word for it until recently
Is there a solution to this? I'm trying to use IEntity::SetObject to swap in progressively more smoked/burned down cigarette models in a character's mouth, but when I call SetObject, the new cig model loses its attachment to the character's skeleton or bone it's supposed to be attached to. When i take the cig out of the mouth slot and put it back in, then the cig appears in the correct position and is attached to the charcter. I guess the other option is to use morphs, but someone said that could be too expensive and model swapping would probably be more performant.
No, the bindings for that aren't exposed.
are cig model morphs a viable alternative? would those cause performance and/or replication problems if 100 people were all smoking at the same time?
Why does the cigarette have the character rig?
i actually don't know a ton about models, rigging, and animations. i'm just doing the coding part. my buddy @random oracle did the models and rigging. is there a better way to set up something like a cig?
Yes, make it a gadget that is held instead of it being a piece of clothing.
would that still make it possible to have the cig sit in a player's mouth? we have a smokeable component that is a SCR_GadgetComponent, so scripting wise, it's already set up like a gadget
if we go that route we will have to make an animation graph, right?
Yes
thats why we didn't go that route
Well it's either do that, keep it as a piece of clothing or write your own way of handling it.
I haven't been able to make sense of animating gadgets
i found a hacky way to keep the new swapped model in the player's mouth using InventoryStorageManagerComponent::TrySwapItemStorages. you basically call that and swap the cig into the storage slot again immedately after calling SetObject
This is why we can't have nice things. lol
yeah it's a dumb solution. but it works?
and it breaks the gadget update. so now i gotta find a hacky way to get around that
Inventories are replicated. I wouldn't use the "swap" approach.
so you think we gotta bite the bullet and go the gadget route?
That's the proper way.
or maybe try morphs. i got that to work where the cig gradually burns down
It's better to go the proper route than pile jank on jank.
but i don't know what the performance ramifications are
If it's a gadget it can have its own animaions.
But you'll need custom character animations too.
There are numerous ways to do it.
But it shouldn't be a piece of clothing lol.
Best to take a look at the flashlight and it's animations.
And it's gadget component.
i was thinking if it's a gadget like the flashlight, it could have an attachment slot in the player's mouth similar to how the flashlight attaches to shirts and vests. maybe?
If it's a gadget you can have hand animations for lighting it, flicking it, etc.
yeah that'd be ideal. we'd just have to get a lot better at animations
That's a skill that you develop over time like anything else.
i'm trying to do all the heavy lifting with scripts because that's all i'm "good" at haha
I'm no animator but, have been able to create a drinking animation, bind and play it from script via input.
yeah i think it'd be good to learn. for the time being we'll have to keep the cigs as clothing until we can do the animations properly
For something like that, i'd look into the hand storage or whatever. Find out how to insert things into it, and when the cigarette is inserted, spawn another prefab attached to the mouth, deleting the one in the hand.
If anything it would be a good learning experience.
cool, maybe we'll try that eventually. thanks for the tips man.
Are you the guys doing smokable smokes mod?
I've stepped off the ledge...with first steps. Let's see how far I fall into the abyss.
Welcome to Learning Enfusion Script!
This channel is dedicated to helping beginners learn Enfusion scripting and the Enfusion Workbench - the powerful game development tools behind titles like Arma Reforger and upcoming Arma 4.
Whether you're a complete beginner or looking to enhance your modding skills, you'll find step-by-step tutorials cove...
Yep thatβs us
this is a hiliarous statement.
so true
Mind if I DM you about an issue I found last night?
yeah no problem!
This place is flooded with miserable haters. Pay no mind to it.
im seeing that
What is the best way to simulate a bullet hit on an entity? Is it through DamageManagerComponent?
Drive a nail in it.
LOL
J/K
or do I spawn a bullet entity and give it velocity?
If you just want to simulate damage, then the damage manager component.
Ok. Ideally I'd want all the same effects as a specific bullet hit
BaseWorld.TraceMove() doesn't seem to trace ChimeraCharacter entities no matter what TraceFlags I put in the TraceParam.
Is this a bug or am I doing something wrong?
There is a ChimeraCharacter.TraceMoveWithoutCharacters() which is supposed to make a trace excluding ChimeraCharacters, so I'm assuming the default trace should include them.
Does SCR_CharacterInventoryStorageComponent::SetStorageAsHidden() work? Because it's not hiding the storage in character's inventory, or do I misunderstand what it's supposed to do?
Here's my script for handling it, and it prints saying it's not shown, but it is still very clearly shown. The goal is to have it not be shown in inventory menu when equipped by player
//------------------------------------------------------------------------------------------------
override void EOnInit(IEntity owner)
{
if (!GetGame().InPlayMode())
return;
m_InventoryStorage = SCR_UniversalInventoryStorageComponent.Cast(owner.FindComponent(SCR_UniversalInventoryStorageComponent));
if (m_InventoryStorage)
m_InventoryStorage.m_OnParentSlotChangedInvoker.Insert(OnParentSlotChanged);
}
//------------------------------------------------------------------------------------------------
protected void OnParentSlotChanged(InventoryStorageSlot oldSlot, InventoryStorageSlot newSlot)
{
if (newSlot)
{
ChimeraCharacter character = ChimeraCharacter.Cast(newSlot.GetOwner());
if (character)
{
SCR_CharacterInventoryStorageComponent characterInventory = SCR_CharacterInventoryStorageComponent.Cast(character.FindComponent(SCR_CharacterInventoryStorageComponent));
if (!characterInventory)
return;
characterInventory.SetStorageAsHidden(m_InventoryStorage);
Print("CONVICT TEST: IS STORAGE SHOWN?: " + characterInventory.GetIsStorageShown(m_InventoryStorage));
}
}
}
actually, looking at vanilla script, I don't even see how the method could possibly work ??? It just seems like a dead method because the array it's getting removed from is not referenced anywhere else
The work can be done in the cpp which doesn't show you how it work behind the scene
I mean, maybe, but the array and method are all defined in that script class, so I wouldnβt think itβd be the case of being behind the engine. And thereβs no class inheriting from the character storage component, and the array is protected with no getter, so idk.
You're just doing it wrong
Yes, it can trace characters just fine, just post what you were doing.
since 1.6 every time i select the script editor window, it lags for 5-10 seconds before i can do anything or select another editor window
and its driving me absolutely insane
it even lags if i add a brand new script file, like something is checking all the scripts every time the script editor is active
and makes me wait until the check is over
Ah I see that you deleted it again... does it mean you fixed it?
Yes, I figured out that EPhysicsLayerDefs.Default doesn't include characters
You should just not assign the params you don't want to change from default to begin with.
Yup, that makes sense
EPhysicsLayerDefs.Character seems to include some capsule around the character model.
Do you know which layer the character hit boxes are on?
They are FirGeo. You can just check the xob: https://enfusionengine.com/api/redirect?to=enfusion://ResourceManager/~ArmaReforger:Assets/Characters/Basebody/Basebody_Male_01.xob
OK, thank you very much.
I've had a similar issue for longer than 1.6, it happens when there are a lot of mods loaded
It's pretty unbearable tbh
Available head and body prefabs can be found in the identity part of faction config. Should be accessible through scripts via faction manager.
And what if I don't use faction manager lol?
Its custom game mode that doesn't use it at all
I'll dig around but if anybody knows anything lmk.
Every game mode should have a faction manager, otherwise something is wrong with it.
No, I built it without it on purpose. Replaced with a job system and custom spawned systems
It is a life mode
bruh
But yeah, I mean, I can throw it on there.If I have to and if I decide, it's worth it
I can't even imagine all the things it could possibly break, but latest when introducing AI, you gonna need it for faction relations.
It broke a lot of things, and I had to rebuild custom systems for them.
About six months deep in it now
Probably just do our own ai also
Ultimately it's up to you, but I see no reason to go these great lengths to avoid a faction manager.
Anyway, you could ofc just directly load the identity configs and read the prefabs from there
Ok tyvm
The main reason is so I don't have to change as much for arma 4
With a bunch of independent systems built on enfusionscriptapi
None of us knows how A4 changes, but first of all you have to invest way more now and also there is no guarantee it won't break anyway. I saw plenty of examples where modders went on with their own item prefabs that completely broke after updates, while mine that inherited didn't break, as they inherited the changes needed π
We still use override prefabs
Hey does anyone know if it's possible to display script variables on screen for debugging at runtime? Maybe it's possible through the debug menu? So I can get in a vehicle for example and have variable X from component X from this specific vehicle and things
Maybe I can do something with DebugTextScreenSpace() actually
Can anyone explain the relationship between OnDamage, HijackDamageHandling and ShouldCountAsHit in SCR_DamageManagerComponent. I often see that HijackDamageHandling returns false, and ShouldCountAsHit returns true, but then i see no OnDamage call. This is particularly obvious with rockets to vehicles. There might be many calls to HijackDamageHandling and ShouldCountAsHit ( usually for the spall projectiles only), but the damage from the non-spalled projectile doesn't usually show up via OnDamage even though damage was not hijacked and it should count as a hit. Another example is just shooting an armoured vehicle with a rifle where OnDamageis rarely called even though the other two methods indicate a small amount of damage being inflicted. The only way i can explain this is that my modded SCR_VehicleDamageManagerComponent is being overriden by another mod. I just want to understand the relationship between these calls, So i can explain why OnDamage is rarely called compared to the other calls. Apologies for the essay.
How can you even see that HandleDamage is called? You shouldn't be able to override it in the first place, as it's native.
Argh ... sorry i meant OnDamage . I think my brain was stuck there while I was typing that up. I've updated my question.
Well, this is the flow chart that the devs posted, so either it's incomplete or exiting somewhere that you haven't considered yet: https://community.bistudio.com/wiki/Arma_Reforger:Damage_System
That's very useful. Thanks for the link. Based on that, it implies that a ComputeEffectiveDamage call somewhere is deciding no damage will be dealt. This occurs after HijackDamageHandling and ShouldCountAsHit, so explains why OnDamage is not called.
Also there are damage-type specific multipliers defined on damage managers/hitzones. I'm not sure at which point they get applied and when the damage handling is exited in case of a multiplier of zero though.
Good chance it's happening in the native implementation of ComputeEffectiveDamage
Agreed. Thanks again!
how would you guys add a raycast to determine if as character has an object above it? or is there something better built in for that already?
@minor agate EnfusionScriptAPI will be the same for Arma4, at least generally yes?
I will say to not expect things in Game module to be the same
Ok cool ty.
may find something here, not sure
https://community.bistudio.com/wiki/Arma_Reforger:Startup_Parameters
Hey @late kite
I'm putting together a milsim event for the squad and plan to use your excellent mods along with the Vietnam War faction ones. To build some hype, I wanted to create a promo video using ArmaVision, but one of the dependency mods (likely yours) disables the function, and I can't find where to override it.
Any tips on how to re-enable ArmaVision for GM/video use without breaking the deps?
Thanks!
Not sure, but Iβll look into it!
Hi guys, I'm trying to use OnPlayerKilled and OnPlayerSpawned to make a Respawn limiter script...
All is going well except that OnPlayerKilled and OnPlayerSpawned seem to need to use static methods, but if I want an attribute to set the maximum number of respawns if I use static the attribute doesn't work
So this returns no error but the attribute doesn't work:
class herb_PlayerRespawnComponent : ScriptComponent
{
[Attribute(defvalue: "0", desc: "Maximum number of respawns permitted", category: "Game Mode")]
protected static int MaxRespawns;
static ref map<int,int> ideathCount = new map<int,int>;
static ref map<int, vector> s_lastDeathPosition = new map<int, vector>();
static void addPlayerDeath(int playerId, IEntity playerEntity)
{
vector deathPos = playerEntity.GetOrigin();
s_lastDeathPosition.Set(playerId, deathPos);
int current = ideathCount.Get(playerId);
current++;
ideathCount.Set(playerId, current);
Print("The player has died " + current + " times.");
}
static void checkRespawns(int playerId, IEntity controlledEntity)
{
int current = ideathCount.Get(playerId);
PlayerController pc = FindControllerByEntity(controlledEntity);
Print("Player has died " + current + " times of a maximum of " + MaxRespawns + " times.");
if (current > MaxRespawns)
{
Print("Activate the camera!");
ActivateSpectatorCamera(pc);
}
}
Whereas this gives errors for trying to call non-statis functions and static:
class herb_PlayerRespawnComponent : ScriptComponent
{
[Attribute(defvalue: "0", desc: "Maximum number of respawns permitted", category: "Game Mode")]
protected int MaxRespawns;
static ref map<int,int> ideathCount = new map<int,int>;
static ref map<int, vector> s_lastDeathPosition = new map<int, vector>();
void addPlayerDeath(int playerId, IEntity playerEntity)
{
vector deathPos = playerEntity.GetOrigin();
s_lastDeathPosition.Set(playerId, deathPos);
int current = ideathCount.Get(playerId);
current++;
ideathCount.Set(playerId, current);
Print("The player has died " + current + " times.");
}
void checkRespawns(int playerId, IEntity controlledEntity)
{
int current = ideathCount.Get(playerId);
PlayerController pc = FindControllerByEntity(controlledEntity);
Print("Player has died " + current + " times of a maximum of " + MaxRespawns + " times.");
if (current > MaxRespawns)
{
Print("Activate the camera!");
ActivateSpectatorCamera(pc);
}
}
Called via this:
class herb_PlayerRespawnGameModeClass : SCR_BaseGameModeClass
{
}
modded class SCR_BaseGameMode
{
override void OnPlayerKilled(int playerId, IEntity playerEntity, IEntity killerEntity, notnull Instigator killer)
{
super.OnPlayerKilled(playerId, playerEntity, killerEntity, killer);
Print("Player has died");
herb_PlayerRespawnComponent.addPlayerDeath(playerId,playerEntity);
}
override void OnPlayerSpawned(int playerId, IEntity controlledEntity)
{
super.OnPlayerSpawned();
Print("Player has spawned");
herb_PlayerRespawnComponent.checkRespawns(playerId,controlledEntity);
}
override void OnGameEnd()
{
super.OnGameEnd();
herb_PlayerRespawnComponent.ideathCount.Clear();
herb_PlayerRespawnComponent.s_lastDeathPosition.Clear();
}
}
Anyone know what the solution is? I am new so it might be something very obvious
it's probably something in one of the arma conflict dependencies, but not sure what without digging into it
How can I get the list of all base names using SCR_MilitaryBaseSystem?
From map descriptor component on each base
or GetBaseName() if its an instance of/casted to SCR_CampaignMilitaryBaseComponent
thanks, I eventually made it to where I use separate arrays and don't need all the base names
How do you add stuff to / use the DiagMenu? I'd like to get in a vehicle and display variables from the Components it has. It's not explained very well.
https://enfusionengine.com/api/redirect?to=enfusion://ResourceManager/~core:scripts/Core/generated/Debug/DiagMenu.c
Maybe there are examples somewhere in the game code?
Are you modifying how DiagMenu works or trying to get it to work right? If ladder: https://community.bistudio.com/wiki/Arma_Reforger:Diag_Menu
Well I'm trying to display a float value from my Component I added to a vehicle. For example there is a vehicle diag that when enabled will show you the current steering, throttle, brake input and so on when you're sitting in the vehicle. I'd like to do this with my Component so I can see the value changing live
No idea how I would even add to the diag menu, register my float value there and so on. Both the wiki and the script file don't really tell me much, and there aren't many exposed scripts that give you an example.
best i can think of is utilizing the power of print() debugging to the console whenever your new component class/method is referenced. I'm not that familiar with DiagMenu
try slapping a [RplProp()] above the var that holds the respawn limiter.
I think would work, then in the end of your addPlayerDeath, add a Replication.BumpMe();
Unsure if it works with maps, but if the component is on the chimera character or character controller, i feel like making it an int, instead of a map, would work better. No need to store information about an user on a component on the user
Would I ever need to use Replication to broadcast fuel levels for player-built structures?
what is the error you are getting? why do you make things static. if you want to count deaths per player and set a maximum i would recommend attaching a component to the player controller prefab, which exists per each player. the respawn system already works with it, so accessing it is easy. from there you can do the rest. if you want all player data in one place, attach the component to your gamemode instead.
If they don't make them static then OnPlayerKilled and OnPlayerSpawned do not work, like I said π
Hey, question: "SCR_CompartmentAccessComponent - GetInVehicle" This should be called where the character is local. But if i try to move a none player controlled character into a player controlled vehicle. Its not working. If i understand this right, it need to be called on the Master/Server side, because its not a player? Or should it called on the proxy who is owner of the vehicle?
thanks for this tip, was having a hard time trying to get a keybind to work xD full reset was the answer
Is there any way to add to an enum in Enfusion? VehicleDamageManagerComponent has the enum for vehicle hitzone groups, and I want to add my own hitzone group. Right now if I try to repair my hitzone it will display some totally wrong hitzone group like "Repair: Controls" or "Repair: Engine" which would just confuse players.
I would just overwrite the enum in my mod but I'd have to overwrite the entire damagemanager as the enum is not a separate file. Some other mod is bound to have overwritten the damagemanager and would conflict.
AFAIK you should only need to do that if your override script is 1:1 duplicated path/filename of the original where Enfusion will do full file replacement, when your override script has a different name (e.g. put your own prefix on it) it should do partial replacement/merge of types using modded keyword
Good shout, I'll check that out. Thanks
since it got blocked for some reason. question in the pic
Yes, you can mod enums like classes
Afaik, unknown file extensions will be excluded from packed addon, so you will need to place this file into profile folder or mask it by some other extension (like .c but place content in /*...*/)
I think it was blocked because xyz domains are used for spam so much.
Yes you can open any file extension with that method, but you only have APIs to read text files, you won't have much success with arbitrary binary.
The method will not work on consoles
Is it possible to retain an npcs ragdoll state when they die or are moved/pushed? Working on a telekinesis mod and I canβt seem to get a continuous ragdoll on killed or downed npcs
i believe we forcefully stop ragdoll simulation very shortly after they stop moving much, as ragdoll is ridiculously expensive. not sure if you can manually enter the state again, if not it might be requestable via feedback ticket
Are active ragdolls possible for modders?
Hello, I'm a beginner modder and don't know much, but I'd really like to create my own mod, but it's on hold because I don't know how to create my own logic and integrate it into my mod/prefab.
Thanks in advance!
Check out the modding bootcamps on youtube created by Bohemia, great place to start
How can I disable this ? i want to be able to refuel even if the support vehicle is moving.
- You are not searching for "moving" and do this only in this document
- Search for IS_MOVING enum value
Hi, can anyone share the names of Kolguev's bases? (m_sBaseName)
What is best practice for replication of a client side method?
if (Replication.IsServer())
{
if (server_side_check())
client_side_method();
}
(I'm checking player bohemia GUID server side, but teleport player method only works when it's client side).
Yeah I'm just going to use it to extend the csv object placer to allow for point cloud data as well in xyz.
Random but if anyone's interested in VSCode / Zed editor support I had started a very rudimentary LSP implementation here: https://github.com/landaire/enforcer
And the zed extension is here: https://github.com/landaire/zed_enforce_extension
Can't quite remember where I left off, but I think class and function resolution works but it does not currently support scoped vars etc.
There is zero documentation and you'll probably need to change some hardcoded paths: https://github.com/landaire/enforcer/blob/main/build.rs#L4
It's built on top of simonvic's great work on the tree-sitter grammar: https://github.com/simonvic/tree-sitter-enforce
cc @ocean needle since you were asking about this in Nov
Just haven't had time to focus on it
We have one in the works along other things. I will see if we can start releasing it to community.
Does anyone have tutorials or basics that can help beginners?
Solid move for modders.
Talking to player controller, back or forth
So you can have methods that communicate intent up to serverside, which can do server only things, or communicate from server to clients, either data, or things that are only client able.
modded SCR_PlayerController and add your RPC methods therre
Appreciated, will give it a shot
so I just lost all of the plugins like the dedicated server tool. how do I reload them? reloading and recompiling scripts doesn't work. they still exist in the reforger files
they show up in other projects, but this project appears to be borked now
edit: fixed by deleting resourceDatabase.rdb and letting it create it again. very weird bug
is there a way to check the compatibility of a "SCR_JsonLoadContext" ? My problem: i did some changes on my guns and they are no longer compatibile. If i now load such old Json, the GameCrash. If i delete the old loadout it works fine.
blip blop blup here comes the stupid questions :
class CodecOclock
{
private const int BYTE_SIZE = 52;
float m_floatVal; // 4 bytes
vector m_vectorTransform[4]; // 48 Bytes
static void Encode(SSnapSerializerBase snapshot, ScriptCtx ctx, ScriptBitSerializer packet)
{
snapshot.EncodeFloat(packet);
snapshot.EncodeVector(packet);
}
Would using EncodeVectorwork for the transoform or should i use something else ? since it's an array of vectors rather than a "simple" vector ?
Thx in advance ^^ (found no use it in reforger's code)
if you added new values to your new version of the json try to load those and if it's null it means you're reading an older version and then handle it.
But how do i know if a prefab is still compatible or not?
idk, idek what you're trying to do or what json you're reffering to so i am not sure what you're trying to achieve
It should usually not crash, just return false at some point. can you submit a feedback ticket with the json file you attempt to load and an example code to load it - which reproduces the crash?
We have added a "version" property to any data written for persistence as very first thing so if you want to change the layout, you can raed it back, and switch the reading code for what ever properties to expect in the given versions
A hole transform is 4 vectors, you you would call encode vector 4 times to copy the entire transform over
would this extract method be correct ?
static bool Extract(KE_CameraData prop, ScriptCtx ctx, SSnapSerializerBase snapshot)
{
snapshot.SerializeFloat(prop.m_targetCameraFov);
// transform
vector trans0 = prop.m_vectorTransform[0];
vector trans1 = prop.m_vectorTransform[1];
vector trans2 = prop.m_vectorTransform[2];
vector trans3 = prop.m_vectorTransform[3];
snapshot.SerializeVector(trans0);
snapshot.SerializeVector(trans1);
snapshot.SerializeVector(trans2);
snapshot.SerializeVector(trans3);
// end: transform
return true;
}
That's the only way i found to feed it all of the vectors "correctly" and still allowing it to compile
@minor agate any opinion on this?
i might've fucked up the implementation of the codec but as of right now the float value get properly sent however the vector is received as a bunch of vector.zero
it's just that since i will end up sending a lot of data i want to do it the proper way rather than to cheese it by dumping everything through individual rpc params
@red cedar Can you share all the methods of the codec?
Sure, i'll send it in a file to avoid having a text wall.
I'm trying to properly learn how to implement those.
In inject, you are injecting to the local vars you created in the method. Not to the class's
Ok so i got it to work using SerializeBytes
static bool Inject(SSnapSerializerBase snapshot, ScriptCtx ctx, KE_CameraData prop)
{
snapshot.SerializeFloat(prop.m_targetCameraFov);
// transform
snapshot.SerializeBytes(prop.m_targetCameraTransform, 48);
// end: transform
return true;
}
Is there a way to make it work using SerializeVector or not ? if so how ?
Serialzie the whole array with bytes
Do not separate vector by vector
Super wasteful perf wise
Ok that's good to know, for strings and such i should still use SerializeString right ? (not an array of strings)
We do not have such thing as array of chars exposed in script
It's a string object, so yes. use the string one
Thank you
I am running into a problem. I am trying to fix the SCR_TimeandWeatherHandlerComponent. The issue is the attribute for the number of days in a month only goes to 12. I am trying to increase to at least 28. I've put in a feedback ticket and BI said they fixed it, but I haven't seen it yet.
So, I thought as part of my learning to script, I could try and fix it by modifying the script. But nothing I do changes the component to allow setting a date higher than 12. I even just tried to change the defvalue to 5 to see a difference. I am missing something.
I created a new script "BHS_TimeAndWeatherHandlerComponent.c"
modded class SCR_TimeAndWeatherHandlerComponent
{
[Attribute(defvalue: "1", UIWidgets.Slider, desc: "Day", params: "1 28", category:"Date")]
protected int m_iDay;
}
I've tried copying the whole script and doing overrides where indicated but that did not work either.
Thanks for the advice! I watched these video courses a long time ago, but I didn't understand the gist of it. That's why I'm writing here, hoping for some help.
Thank you! Placed in a request, fingers crossed 
Is there an event or method anyone knows of on an Entity to observe when replication has finished updating the client? I have a weird race condition where the entity's sub entities aren't fully spawned for the client before my code runs. I want to run my code only after the entity has finished being set up on the client, preferrably without just using a CallLater call.
afaik, you can't override/mod attributes. you would have to make a new attribute var, or make a whole new class that has the attributes you want.
Understood. Thank you.
So for instance, make your new attribute variable, then override SCR_TimeAndWeatherHandlerComponent::OnWorldPostProcess to use your new variable instead of m_iDay when SCR_TimeAndWeatherHandlerComponent::SetupDate is called
Oh, that would be great, and it would be even better if JetBrains IDEA supported it too. 
Hi. How can i get steamId64 from player in client-side? Thanks.
PlayerController playerController = GetGame().GetPlayerController();
if (!playerController)
return;
// Get player's internal numeric ID
int playerId = playerController.GetPlayerId();
string playerUid = GetGame().GetBackendApi().GetLocalIdentityId();
Print("This is player ID " + playerId);
Print("This is player UID " + playerUid);
You do not. We do not expose platform identifiers to script, use the identity provided by https://enfusionengine.com/api/redirect?to=enfusion://ScriptEditor/Scripts/Game/Utilities/SCR_PlayerIdentityUtils.c;7
This is UUID is unique?
Is it possible to create a custom log file to print specific things to or is the only way using json?
FileHandle::Write as well as SCR_FileIOHelper::WriteFileContent if you want to just keep overwriting a file instead of making new ones
Can you dictate the file type too?
I've only worked with existing files atm, but theres FileIO::MakeDirectory which might do what you want in creation. Keep in mind, only text based files. No binary.
Thanks I'll check it out!
Hello, I'm a beginner modder and don't know much, but I'd really like to create my own mod, but it's on hold because I don't know how to create my own logic and integrate it into my mod/prefab.
Thanks in advance!
start with the modding bootcamp videos on the arma youtube channel
There is no problem with writing binary
FileHandle file = FileIO.OpenFile(β$profile:/somefilename.binβ, FileMode.WRITE);
float data1 = 5.0;
int data2 = 12345;
string data3 = βsome textβ;
file.Write(data1, 4);
file.Write(data2, 4);
file.Write(data3.Length(), 4);
file.Write(data3);
Good day all again,
I would like to get some opinions on converting sqf to enforce script. Possible? Difficulty? Don't bother?
I have some Arma 3 sqf addons I would like to convert and create for A4.
You wouldn't really be "converting", you'd be taking an idea and implimenting it in new code on a new engine. I would first look to see if you could even impliment a specific idea in the current engine/data structure.
Not possible, neither technically not conceptually. Two way too different approaches to "scripts"
Is there a built-in way to generate a GUID in Enforce Script? Something like System.CreateGUID()?
Hello. I'm creating new world in my mode with default eden map. What is needed to configure to allow AI move across map? I added SCR_AIWorld and added needed navmesh files for soldier, vehicle and lowres, as usual. But AI spawned and just stay. Cant find difference with my previous world, but looks like I missed something.
Any ideas?
Guid myGuid = Guid.Generate();
Do you have PerceptionManager?
Yes
Why do you reply with some hallucination.
The correct way would be the UUID class @errant fog
ChatGpt said so
Thanks for a proper reply lol π
UUID newUid = UUID.GenV8();
Something like that iirc
has anyone encountered a crash when trying to call HitZone::SetDamageOverTime() on two different hit zones? i'm implementing a system where the player lights fuel tanks on fire if they're smoking a cigarette while refueling, but when i run the following code, i get a crash somewhere in the engine, but don't know why
flammableHitZone.SetFireState(SCR_EBurningState.SMOKING_IGNITING, fireRate, true); // ----> eventually calls HitZone::SetDamageOverTime on the flammable HZ once we fully catch fire and then crashes
has anyone encountered a crash when
im working on a GUID whitelist and its not working
Isn't the file extension for enfusion script .c, not .cs?
Extension is correct, idk what the code is. I'm on my phone rn
its for a guid whitelist
Sigh... why are prefabs that are trees, WorldEditorAPI.CreateEntity creates them using ATL but when you use say a rock, it creates it using ASL (or whatever editor 0 absolute y is)...
both trees and rocks are created using the same algo and same data to test
From what I can see is you're trying to reinvent the wheel on json parsing. I'd def look into whats available through the JsonSaveContext and JsonLoadFontext
so the question is, how do i determine if a prefab uses coords which are absolute or relative?
I have a "utility mod" that does that.
ADD ME BACK
Just send your message or whatever
Go to the entity properties
Flags
Relative Y
Can I add this flag during creation? Doing the creation, quats, etc all through script.
SetFlags from IEntity
@minor agate any way to get a fast moving projectile to simulate outside world bounds? Basically trying to simulate 155mm rounds that have a high arc. Right now they just delete above the world bounds
Could someone tell me how to get player's ID and write to and from a file on a dedicated server? Also, where should I put this code. I'm just starting off and trying to implement a simple json database/file for my server, to spawn a returning player to the position he logged off at and new player to a predefined location.
BIKI says BackendApi.GetPlayerIdentityID(int iPlayerId) on 'Game Identity' page. Is this the one I should use? If so, how?
I saw a message by Arkensor here pointing to UUID GetPlayerIdentityId(int playerId). Would it then be SCR_PlayerIdentityUtils.GetPlayerIdentityId(int playerId)? What do I put in the parameter if I don't know the ID?
I can't find any good tutorial/documentation of this.
I tried going through Arkensor's code on Github in EDF/EPF/EL repos, EveronLife/src/Scripts/Game/Feature 'Character' and 'Account' folders in particular but I can't figure it out. I'm not experienced with coding, especially object-oriented. I would appreciate if someone could point me in the right direction, since chatGPT is kind of useless for this.
Have you looked into the vanilla persistence system that was recently introduced? https://discord.com/channels/105462288051380224/1430828753717559430
I would think itβd cover most of what youβre wanting already
I just watched a video on it. The reason I wanted to write my own code for this because I was planning to introduce other character stats, like money for example. I don't think it's possible with that? Also, the video said it crashes after 999 saves, is it still the case?
You can add onto the existing persistence to track things like money and etc., very easily possible. For example, I use it to track metabolism values of a character, like hunger, thirst, etc (all that being custom-made).
I think the 999 saves crash has been fixed, whether the fix has been released yet in a game update, unsure. But I assume by the time that your mod is prepared for release, the persistence system should be ironed out even more and that shouldnβt be an issue
Could you explain to me why it keeps so many savepoints in the fist place? Is there something I don't understand? To restore server after restart you would only need the last one, am I right?
Yes and no, but from my understanding, essentially the persistence system was more-so built around the vanilla game-modes. Doesnβt mean you canβt use it custom game-modes, but it requires some tweaking for long-term persistence.
Arkensor (the dev behind it) could probably explain it much better. But I believe having the many save points is just for flexibility. Like, if you have auto-save set to every 10 minutes, thatβs a save point every ten minutes. Letβs say something happens detrimental to the gameplay and you didnβt realize for multiple save intervals; because of the many save points, youβre able to go back and recover it still instead of just relying on the latest save with the issue or having to wipe the entirety of the database because of that one mess up
Thereβs plenty of resources and questions from others that have been asked in the https://discord.com/channels/105462288051380224/1430828753717559430 if you wanna take a look in there and scroll through a bit. And if you have further questions, donβt hesitate to ask them!
Cheers! I appreciate it
SCR_PlayerIdentityUtils is the way to go, the wiki page was created before it existed. it will be updated in the future when we remove GetPlayerIdentityID from backend api as well as all the other obsolete marked methods. we have a large refactor incoming how we handle identity and authentication so apis will change. the script wrapper used by vanilla everywhere will stay comaptible. thus use it
because the system can handle both single player and multiplayer content. in SP people are used to having multiple saves to go back to if they want to. multiplayer can indeed be fine with just one to recover from crashes, but you can also host a coop mission you want to go back 3 points, skipping two auto saves, because you want to try the final approach from another side without a full replay. server admin will be able to choose how many save points to keep in 1.7 with config.json
Also by default it only keeps 10 and rotates the old files out
thanks, Arkensor
Something like this I feel might need some jank like spawning a new round around where it would be re-entering the world bound ceiling
Why not just make the world bound huge. Weather doesn't work outside of them either.
Because you can't do this universally for all
Modding worlds is just f*cked in reforger
Agreed.
Could you guys have printed a deprecation message and disabled this API instead of removing it outright? I understand it was being abused for exploits but this breaking backwards compatibility could have been easily avoided
`07:41:36.335 SCRIPT (E): Can't compile "Game" script module!
Scripts/Game/generated/Weapon/BC_M1GarandAnimationComponent.c(203): Undefined function 'SCR_InventoryStorageManagerComponent.AskServerToDeleteEntity'`
Got a quick question. Is this problem caused by the 1.6.0.119 Update? I saw in the patch notes that the devs changed a few SCR files or something like that..
Looks like yes
Ok yeah that's what I thought. Thank you for the validation.
Can anyone explain why BI is using the component class now? This is all from the new update. somthing to do with memory usage?
For example SCR_MapGadgetComponentClass
very interesting
so basically attributes now go in class data
If you don't plan on modifying them yes. It's been a thing for awhile just not widely talked about. I guess the issues with xbox having poor performance boils down to memory and this is them trying to cut back on the usage.
If the prefabs gonna be spread out over every character id presume so
How can i extract the map name from the current mission?
Like "Everon"
question about custom chat commands, so i have made my implementation that implement ScrServerCommand
But i am not sure how to reference it, whenever i try to type it i get this error :
DEFAULT : Server command error: #AR-ServerCommands_UnknownCommand {cmd: find test}
I assume i'm missing a step but i'm not sure where i can indicate that "hey this command exist now"
Okay, i have to try the obvious first, are you sure you are typing it correctly? it is case sensitive
override string GetKeyword()
{
return "find";
}
yes
is there like a manager entity or a game mode component we have to register our command at ? or a config file iunno
I havent registered mine anywhere, just implementing ScrServerCommand
Can you send the class here maybe?
Hmm, i cant help you with this sorry
all good, ty for your time
ok found it -_-
for anyone reading this in the future here is the reason :
Blip blop blup
Even a client sided command need to override
override ref ScrServerCmdResult OnChatServerExecution(array<string> argv, int playerId)
and probably some other goodies
This class gets the island name somehow. Not entirely sure. You can see it the bottom right of the map ui
SCR_MapLocator
Hmm, not sure i get how it does it either π
I was most of all hoping for something like GetGame().GetWorld().GetName()
But seems i can only get the name/filpath of the scenario.. and not the island
Who even changes the API in a MINOR update?
Me
I believe that API was being exploited by hackers
Which our server fell prey to a couple times now, never wouldv'e thought to look in a script we don't use ;-; glad it's out, boutta search for that function to see if its exposed anywhere else
Is the ide support planned to be in 1.7?
technically the world is the scenario, so it's hard to get the "real scenario name", in an ideal world the original name would be in the scenario name (like how GM on Everon is, guess it: GM_Everon), good luck getting people to name their scenario in such a way.
Yup... and i am trying to make an AAR system, so i kinda need some unique identifier for the island, to link it with the correct map in the webapp
What I ended up having to do was create a master config which puts name > map
no, the concept of just freeely asking the server to delete something is completly insane. And all the method did was call the delete entity from utils class, so if you needed it on server logic just use that. if you wanted to call this from the client, rethink your approach, its wrong
More so I put 2 and 2 together and was wrong, never have personally used it and if I did I already know to throw it into something the server will be doing. Atleast was able to piece together you should never allow the client to delete/spawn/teleport anything, also you get yelled at in the logs if that happens to happen(prob where i learned that from).
I always try to add something to indicate that this action should happen from this player before it executes completely, best I can do with the knowledge I have
world.FindEntityByID(entityId) doesn't work client side ?
It does work, but the entity ids are not replicated, they are local to each game instance. if you want to reference a replicated entity, send its RplId instead.
oh ok, i also have another question regarding the launch params so i have set my WB launch params to
-nds 1 -nwkResolution 10
to make the replication range as little as possible but i see that game master still load way further than that, is there a way to set the game master's replication range ?
fair lmfao
This mod exactly disables this behavior for anything, but players in GM:
https://reforger.armaplatform.com/workshop/60B2AD8092C4C94A
ok i'll give it a shot
also, do anyone know if i search an entity by it's RPL id (client sided) do i have to be within replication range to get a non null result ?
Bottomline, there is that GM by default has no replication range at all. It streams in everything.
Yeah it has to be in your bubble to grab it
Replication.FindItem() returns null otherwise
Yes, you ofc do. No proxy streamed in, no way to get anything but null.
You could disable streaming on that entity you are trying to get but it just depends on what you are trying to do
no need to, i already have a working code where i await that the entity i'm looking for is loaded on the client's side.
I was just wondering if there was a way to cheese it
You can just use ctor/dtor for detecting that a particular class got streamed in/out on the client.
But I need that replication stalled in my life 
Oh, you finally fixed this exploit. Great.
What about other public methods that allow clients to ask the server to perform actions?
As far as I remember, cheaters were able to spawn items and use GM privileges via script execution of such methods. Is that fixed as well?
I would assume whatever was in the Security Patch 1 (mod) that was published over the holidays is included in 1.6.0.119
We are fixing all issues we are aware or or being made aware through proper means (e.g. private feedback tracker ticket). If you know of anything and also have some idea what is being exploited how then feel free to submit a ticket so we can check if it is already on our list.
We have a lot more coming but we started with a few low hanging fruits.
also is there a more convenient way to load pluggins on a peertool instances ? having to get the order right is very tedious for me
Can I link a blog post in the ticket 
Hello. Have a problem with spawning AI. With migration of my mod to new map, I have a problem with bots spawn. I'm spawning near 500 bots and in new map Eden, after 200-300+- AI deleted. Like I'm spawning and in the same moment I can see OnAiGroupDelete event. I have max allow 2k bots and 1k active bots in SCR_AIWorld.
Any ideas which system and why could call group delete right after spawn? Dynamic despawn is disabled
i've got new kind of crash on dedicated server
30.01 2026 16:19:51
Unhandled exception
Program: /reforger/ArmaReforgerServer
Reason: Unknown
Function: 'DeleteEntityAndChildren'
Stack trace:
Scripts/Game/Helpers/SCR_EntityHelper.c:179 Function DeleteEntityAndChildren
Scripts/Game/Core/EH_LobbyManager.c:587 Function ApplyPlayerToSlot
Scripts/Game/game.c:866 Function OnUpdate
actual call in EH_LobbyManager.c:587 -
if (defaultEntity)
SCR_EntityHelper.DeleteEntityAndChildren(defaultEntity);
where default entity is SCR_ChimeraCharacter. It worked and works fine all the time, this is first time when i've got crash with some callstack.
any help?
||Crash GUID: e21eedb5-93f1-4858-a86c-d86a808937c9 if you need it for further debugging||
same issue 
DeleteEntityAndChildren already handles null entity, the check is not needed
The deletion code itself is fine, it crashes when trying to delete the chimera character. there is some event that is failing during unsubscribe or something, we will need to have a look
thanks, i added crash guid to message above, hope it will be useful
Trying to override a method but the Workbench logs says "Function 'SetTotalFuelPercentage' is marked as override, but there is no function with this name in the base class" even though it has the method in the auto complete. What am I doing wrong??
get rid of the scope under the super
also
it's β¨cs SetTotalFuelPercentage(float percentage, SCR_EFuelNodeTypeFlag hasFuelNodeFlags = 0, SCR_EFuelNodeTypeFlag ignoreIfHasFlags = 0, SCR_EFuelNodeFlagQueryType queryType = SCR_EFuelNodeFlagQueryType.ALL_GIVEN_TYPES)β©
need all of the parameters for the method
I need to include all params in the override and super?
Yes. So it'd be like:
β¨```cs
override void SetTotalFuelPercentage(float percentage, SCR_EFuelNodeTypeFlag hasFuelNodeFlags = 0, SCR_EFuelNodeTypeFlag ignoreIfHasFlags = 0, SCR_EFuelNodeFlagQueryType queryType = SCR_EFuelNodeFlagQueryType.ALL_GIVEN_TYPES)
{
super.SetTotalFuelPercentage(percentage, hasFuelNodeFlags, ignoreIfHasFlags, queryType);
}
thank you, that made it reload scripts without errors. Learning c++ as I go π«‘
Im looking to extract the map of islands, f.eks a sattelite map of Arland
Anyone knows of a way to do this?
I want to extract it as .png
SCRIPT (E): execCode(6): error: Method 'SCR_CampaignMilitaryBaseComponent' is private
Why is the log saying this when the method is not private? Just trying to pull the base name where a structure was built
Try SCR_CampaignMilitaryBaseComponent.GetBaseName()
huh...Trying to call non-static function 'GetBaseName' as static
ive seen that before
Maybe this'll work, it's empty right now so ill test in WB game
Blast, it won't print anything when a structure is built
I think you will just have it better watching one of those 1 hour youtube videos about OOP
You are running into some basic mistakes that it is better to just start with that
impossible, this whiskey makes me an expert in everything.
Hi! I try override static method but always the original runs, i don't understand why.
- Tried inherit child class and use override static method. Result the original script's breakepoint stopped the game.
- Tried use modded class with override static, result again the original runned.
- Tried modded class with his parent and override static method.
Where is my fault?
no compile error, not looks sealed class
did you compile/reload?
Also it says it uses objects currently known class, so if your class is ClassB : ClassA, and things are asking about ClassA, ClassB is not known to them
should be able to use modded keyword and override, would need to see an example
β¨β¨```
modded class SCR_PlacingEditorComponent : SCR_BaseEditorComponent
{
override static SCR_EditableEntityComponent SpawnEntityResource(SCR_EditorPreviewParams params, Resource prefabResource, int playerID = 0, bool isQueue = false, SCR_EditableEntityComponent recipient = null, bool canBePlayer = false)
{Print("test");
..........ect.....}
};
ah you don't need to do that, do this:
β¨```
modded class SCR_PlacingEditorComponent
{
override static SCR_EditableEntityComponent SpawnEntityResource(SCR_EditorPreviewParams params, Resource prefabResource, int playerID = 0, bool isQueue = false, SCR_EditableEntityComponent recipient = null, bool canBePlayer = false)
{Print("test");}
};
it was the 2nd try, runs the original script not the modded
without the β¨ : SCR_BaseEditorComponentβ© ?
ye
and next try is the class somethingclass : SCR_PlacingEditorComponent and override
where does SpawnEntityResource live? It also might be game code
nvm
the override will only apply in something class if you do that
which means you must make sure that SCR_PlacingEditorComponents are changed to your new class if you want your override to be functional
also that you reference your new class when casting
i want use modded class, because i not want change other files for it. i just want add some new lines, my script invoker sends the entity towards from this static method
yeah modding keyword should function, not sure why not
It should work. Did you recompile your script after modifying it?
(Ctrl shift f7)
ofc, its 2 days old problem, there was some WB crash and restart since then π
somebody can test it? maybe need use -clearsettings on WB startup parameter
And when you put a breakpoint in the vanilla method it properly hit it right?
yes
I'll get myself a coffee rq then i'll take a look at it in the WB.
Hello,
I want my character to spawn to the position he logged off at. How would I achieve it? I just set up a basic scenario. In Slot1 I set SpawnPoint_CIV.et for 'Object to Spawn' and GameModeSF currently has SCR_MenuSpawnLogic set. What exactly do I need to modify or code on my own. I realize it might be too complex to fit in one message. Maybe someone can provide some examples for it? Do I need to write my own Spawn Logic? how can I simplify it as much as possible?
first of all for me it doesn't compile
what is error message?
no return statement, the return canal expect a SCR_editableEntityComponent.
this works to compile it
β¨```
modded class SCR_PlacingEditorComponent
{
override static SCR_EditableEntityComponent SpawnEntityResource(SCR_EditorPreviewParams params, Resource prefabResource, int playerID = 0, bool isQueue = false, SCR_EditableEntityComponent recipient = null, bool canBePlayer = false)
{
Print("test");
return super.SpawnEntityResource(params, prefabResource, playerID, isQueue, recipient, canBePlayer);
}
}
sry i was only write test print because original was too long, i use copy of original codes
forgot SCR_EditableEntityComponent retun
may i ask you in what folder is your modded file ?
Scripts/Game/Components
scripts should have a lowercase s iirc
nvm im seeing the same issue as you are
ok so @clever oxide
i don't know what you're trying to achieve with the mod, if you're trying to modify the behavior of how the game spawn stuff then this likely won't help, however if you're just trying to like detect when a GM spawn somethnig you can do it this way :
β¨```
modded class SCR_PlacingEditorComponent
{
override protected void CreateEntityServer(SCR_EditorPreviewParams params, RplId prefabID, int playerID, int entityIndex, bool isQueue, array<RplId> recipientIds, bool canBePlayer, RplId holderId)
{
Print("test");
super.CreateEntityServer(params, prefabID, playerID, entityIndex, isQueue, recipientIds, canBePlayer, holderId);
}
}
I think you can't override static methods ??? regardless this method does call the same one you were trying to override so there is likely a way to achieve a similar or identical goal from here.
https://community.bistudio.com/wiki/Arma_Reforger:Scripting:_Keywords#override
This page doesn't really mention this. π
but last try is hard overwrite with full path and filename
ty, i get other way just wanted understand this thing
yeah i know. i just don't understand why the both of us aren't able to override that method, hard overriding the path won't help.
i'm just assuming it's because the method is static and i don't remember overriding a static method so.. i'm just assuming i could be totally wrong
honestly it fucked my brain trying to understand why something as simple as printing didn't work
Hard overwrite (file based) works fine, but in this way i need full copy of original file with some path and filename, not need modded and override keyword
i want avoid from this type of modding because its maybe more maintenance-intense when game updates coming out.
Oh ok i didn't know it was even possible
trick from MarioE, he said 1-2 years ago if i remember good π
Oh i didn't even own the game then lmao
I'm still confused as to what made it impossible to get the override to work as it should
When he comes, he'll hold his head and fix everything in 5 minutes. π
I'm still fuming mad that custom chat command don't have to be referenced anywhere, just implement the class and it somehow works ???
yeah, i mean it probably registers itself in engine
I mean yeah but i just like consistency so like registering a component inside of an entity made sense to me, same for registering a system in a config file or an infodisplay in a component, etc.
And then there are chat commands that are just magic
i mean when you think about it, yeah they require chat entity to work, but those commands are tied to game code and RCON as well, so it makes sense for that to be kind of different
fair
honestly i'm just whining because i did my first command thing a few days ago and couldn't figure out how to reference it, wasted a few hours on it only for it to just "work".
i think it's more frustration of not understanding how it works behind the scene
Possible get script trace? Or i need write planned VME for get error log with list?
There's a couple, like, levels to this. One thing is not understanding how it works, another is weird design. The latter is very prevalent ie. you cannot intercept server commands, you cannot use inheritance fully with commands and so on.
Hey. I have a question. Does anyone know if there's already a freely available script to automate things like vanilla barrier gates, so that when a car or person approaches the gate, it opens automatically?
Static calls are selected at compile time
Not runtime
Its why they are also "faster"
@clever oxide
You can
Just the selected method to be called is done at compile time, which depending on when references of the method tried to use it. It might be old one or new one
I will write some example later to give the idea out.
Also why modded keyword behaves a certain way here with overrides on static.
is there a path on the diag menu that shows me every script that gets executed as it's being called? so i can find out where ccertain things begin etc
No
God forbid we get any diag tools like that
Trying to debug this game is the same as owning a old Audi with the electrical wiring falling apart
print() it is
Define old, my 1.9 diesel told me what's wrong through the OBD port
All Audis before 2000 have biodegradable wiring sheaths
Whew, lucky me
If you move any of the harness it cracks all the insulation
Your best bet for this is to use script debugger and set breakpoints in scripts you suspect being called, when triggered it will pause execution on them allowing you to inspect call stack and step through execution
there is a really funny thing you can do when you make your own callqueue and redirect the entire game to it

Was using it for a mod to see what was exploding the call queue for reference, you can also clear it but it might mess up things that run on it
Whatβs the best game mode to use for a Life server if I donβt build it by hand?
u pretty much have to build it yourself
no vanilla game mode really does what you would want for a life server
Iβm still very new to this whole scripting gig but I think Iβm in the right place for questions considering the familiar Discords
So if Iβm building the game mode by hand, how would I get it to assign players to a faction I.e Civillian vs Police or military?
this guy has a framework for life server stuff here:
https://github.com/Arkensor
Right on, Iβll check it out my man, thank you.
Okay, after checking, itβs Everon life, I want to stay away from using it as a dependency so the water marks and stuff are not showing up, Iβm building my own proprietary system, Iβm under the impression per the licensing I can modify the water marks and names? I donβt want to carbon copy this.
you can change all that, there are no water marks
the only thing is the "everon life" on the bottom of the screen
which you can change
everything related to everon life is open source
Would you be able to assist and provide guidance on tweaks for this?
u can use it as a base to build your stuff up from
Can I copy the files and inherit them? Or do I have to use this as a dependency and just credit the author?
the license should be on the git somewhere if you want to know the knitty gritty of it
"MIT License
Copyright (c) 2022 EveronLife
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE."
Right on, thanks for sharing that.
I guess Iβll pop back here in a few days with my progress and pick some brains, thanks again.
Youre welcome bud
AFAIK the fuel type does not matter (yet?). So you will see diesel, petrol, kerosene in some SCR files but it looks like they're treated the same
Thx, I got it to set the fuel level for for gas stations, vehicles, and structures (helipad/fuel depot/veh dept (conflict). Very strange, seems there's more than 1 gas tank on some things
script 
i'd stay away from everon life, i have not maintained it since the original few weeks of development time and it is quite frankly bad in every way imagine able. you are better off starting from scratch
Does it also have bad refs?
Personally i'd stay away from life in arma in general but that's just me, I just find it pointless 
We are doing a completely custom one if you are interested in checking it out dm me
PVP disguised as a RP server 
I have an array defined in a component:
β¨β¨[Attribute("", UIWidgets.Object, "Destinations")] ref array<ref SDRC_FlyPathPoint> m_vFlyDestinations = {};β©β©
All good, works as expected. In the prefab I try to define multiple items. From the code within the component, I can only see one item in the array β¨β¨m_vFlyDestinations β©β©.
What am I missing to access all three array items?
Nothing, it looks correct. Make sure you are loading what you think you are and restart workbench
Seems that β¨β¨= {}β©β© was the issue. It clears the array. Defining it like this works: β¨[Attribute("", UIWidgets.Object, "Destinations")] ref array<ref SDRC_FlyPathPoint> m_vFlyDestinations;β©β©
Bug or correct behaviour?
Damn donβt tell me that. I want to build RP so bad
intended
then build it, but with your own building blocks π the most difficult part - persistence is now in the base game so you can do the peach farming part
Definitely don't let it discourage you from doing so, maybe take inspiration from Everon Life but don't use it completely.
Our mod was initially based on Everon Life, which was phased out over the course of a year with some bits remaining due to its utility. You do have quite a lot to learn though
I don't understand people's reluctance to create life mods. If it's possible in Fivem, why not do it here? People have always created mods in games that allowed them. And now the veterans who created these types of mods themselves are against them π
I'm the opposite view, I just don't see a point when FiveM exists. GTA is quite literally the best thing to build on for that type of stuff which is why I find it pointless. Some may see it ironic given well.. me.. but back then FiveM wasn't a thing, if it was I wouldn't of wasted my time 
I can understand that on the one hand. Because roleplay on English-speaking Fivem servers is good. Here in Poland, it's terrible, which is why I do it xd
I've been trying to recreate the experience that I had back in Arma 2 Life days, just need a jihad car at this point. Any Life server/community owner seems to be the minority of server owners on here, but also run into a lot more problems it seems like
Hello. I need two events or methods which I can override to use my own logic
- When player take specific item from arsenal. Or just take item with name .
- When player move to seat in vehicle (move from one seat to another and getin to seat using door)
Who can help?
Money is one motive. There was big money in Fivem modding for both server owners and modders. This game no money in it.
This is probably a problem for the entire RP community, because once upon a time, people wanted to play, there was no money involved, everyone just wanted to have fun, and now...
I mean the tools are there and i think this is one of the game that offer the best possibilities and documentation. So if one of you is passionate about rping you can always create whatever you need
Thats true
We are creating a server for gamers, by gamers, not for profit.
At a minimum, it'd be nice to offset the server costs. Even with monetization approval, our community wanted something else so we went with that. Rather have the player base than the money.
We want to show the FiveM community that in this game can be done better π
Money is always involved whether you see it or not.
Lets start low, 256 player count
That's true, I hope it will be bigger in Arma 4.
One advantage this game has over fiveM is you have control of AI. Can maybe do some fun/creative things like AI police with that.
Yeah exactly
Definitely something i'd like to dabble in in the future. I figure there'd be ways to make AI drug buyers and whatnot. Got a static solution for that rn, but someone actually walking around instead of just standing there would be sick
Slow down there, lets try fitting more than 80 in the same spot without the server exploding first.
That would be great. AI bots walking around the city.
tru tru, never forget your
if(!Replication.IsServer())
return;
in user actions
You learn a lot about replication when dealing with constant entity deletes in dense areas, the whole bubble pops
Or just make your useraction local only.
Depends on the action, sometimes setting that makes the action not work as needed, although every one of our open menu actions has it, else it opens it for everyone in the bubble
Yes, and if the server doesn't need to do anything then it needs to only be perfomed locally.
Indeed 
Am I still meant to be pressing 'Ignore' on this popup every time I validate my scripts? I remember this from a few months ago, didn't expect to still see it tbh
yes
the action should not have any serious mp logic tbh, you could not do checks on the action at all and the components/managers that it talks to should be in charge of rejection, that way it works in SP and MP
Here's an example of one way to do this, I use this pattern with the MFD framework as the RplProps holding the page states are always synchronized.
I'm not worried about SP as much as I work on a life mod, although the pattern may help as this stuff gets twisted in my mind
Yes, and for your issue of a player using an action affecting other players, ensure you return true for local effect only, or if you need server to be aware, return false on can broadcast - otherwise the server will automatically trigger the action for everyone in the bubble, resulting in your menu script triggering for other players lol.
Otherwise a good pattern I found is:
LocalEffectOnly for UI
UI loads and talks to SCR_PlayerController
Player controller RPCs to server method
Server method collects data and sends it back down to player controller
UI pulls data from player controller when updated.
Yee we got a handle on that, but as I said sometimes returning true for local effect only would cause the action to not work as intended. Thats atleast outside of menu actions
That's what I did for TDL to send requested changes (like player callsign set in the menu) to the server - though player controller might not be the best to use - it allows selective transmission unlike managers which will replicate for everyone.
Thats essentially the pattern i'm working with as I deal with player data quite a lot and we're 'modernizing' by switching Many user actions into a menu
Yeah it seems to be the best way to do it, and it's kind of "anti-cheat" because you don't have the sensitive data stored on objects in the world everyone has access to
Anything that needs manipulated outside of the user is normally stuffed in a controller/manager
Iβve actually been working for quite a while starting with Everon Life and your persistence scripts. Iβve been building on top of them until now. Do you think Iβd run into major issues if I completely drop Everon Life? Also, is there a big difference between your script and whatβs currently in the base game? I feel there is, because I know where the player data is saved, and Iβve modified it to support multiple charactersβeach one saves in the same place but has its own unique ID.
Is there good documentation for the gameβs persistence system? Or is it very different from your script? I know how each component works in my versionβfor example, components for cars, the player, and I can add other things like food and drinkβbut how different is it compared to the base gameβs system?
Sorry for my questionsπππ
Definitely a good idea to drop EL+EPF asap. New vanilla persistence system can persist most things out of the box and is easy to add custom stuff. Migrating from EPF a lot of the patterns are similar but everything is configured from system rules instead of directly on components
There were links to some docs or something near the top of https://discord.com/channels/105462288051380224/1430828753717559430 I think, otherwise there are a heap of usage examples in vanilla scripts
Does it mean they are synchronized for clients that arent even in the vehicle?
Why Rpc to server itself? Rpc is ifed for IsServer-only, but RplRcver is Server, so it just equal to directly call function, just not in current call
Hello. I need two events or methods which I can override to use my own logic
- When player take specific item from arsenal. Or just take item with name .
- When player move to seat in vehicle (move from one seat to another and getin to seat using door)
Who can help?
I mean it partly depends on what your end goal is.
Any easy way to attach entity on dynamic objects? (Door,Vehicle,Character etc.)
Itβs an array of ints, so yes it is synchronized for everyone but only page state and power state, simulation is client side, and only when the player is in the vehicle.
Example is a bit chopped, yes a check is probably unnecessary since the call would be dropped anyways, but that pattern would apply more accurately to client side UI (that isnβt a user action which can be implicitly registered by server)
Would it be possible
To create a halo style degredation mechanic in Reforger?
Eg being able to blow the gun or hatch of a tank, or bend and break apart the gun shield on a turret?
I don't wanna spend time making unique damage models if I can't in some way get it to behave nicely in the enfusion engine
You can swap models/prefabs. the way Iβd imagine it working is having a βbaseβ which doesnβt deform, then having preset prefabs for each damage phase, when one is destroyed (via damage damager) enable the next phase?
I keep getting these 'Assertion failed' errors when I place NPC's I've made onto the terrain.
First it says "Reason: Condition '!BadVec(mat.Position())' has not been meet, once I click ignore it says "bbox.IsValid() has not been met"
These are just duplicate NPCs from other NPCs I already have placed, and it only seems to happen sometimes, sometimes removing them and re-adding fixes it, otherwise I have to create them again.
Any ideas?
How and where are you placing them? Are you scaling them?. Are you messing with the basis vectors of the transform?
So im having this issues explained in the video to showcase, i was working on a new component script for my character based on an other one that was already working, but to make sure i didnt break that one i created an other one, that seem to be working at first with the settings, but once i pressed play to check it out my wokbench died, when i opened it again, my prefab was empty, just had the basic entity with not a single component in it, i had to recreate the whole prefab from scratch, i deleted that script, recompiled the scripts and stuffs, but now whenever i try to apply my old working component or any other by changing it, it doesnt allow me, but doesnt give a single error, any suggestions or help is rly appreciated it. Thank you
Just placing them in the editor, they're basically just a default SCR_ChimeraCharacter with some actions changed, so not messing with anything in transformation at all.
But then I delete it from the editor, drag in another of the exact same version, and no problem now.
Is there a server-wide event I can use to track if any faction built a service station? I'm looking at using ** SCR_NotificationPlayerBuildService** somehow, just need to pull the name without knowing the playerId, structure GUID etc.
Afaik those entities of regular characterd for players sould never be spawned by world file
Is there a way to swap materials on a prefab via script? pls ping me if you can help
β¨SCR_Global.SetMaterial()β© may be what you're looking for?
thanks ill look into it
sounds like some workbench caching, i had something similar with a prefab not updating. in the end had create a new prefab with a new name and delete the old to make him recognize my changes. just a thought. in the end i deleted the .meta file too iirc, but i think recreating with a new name was key.
im making a event crate script but im getting errors
Hello, i searching guy to help me with my campain mod with AI, i've proposition
#creators_recruiting but i'll be honest you're unlikely to find anyone
Most modders are already tied to a team or working on their own project. You won't find people by pitching an idea, you'll find people by showing what you already have made.
i know, i've already do my scenario i've juste problem with AI, i would like to AI spawn only when players was in 500m around... actually my AI was already spawned at start...
Well for that you'd need to write your script. It's nothing too crazy
i watch a tuto on youtube but that doesn't work
Most likely some deprecated code then
i think so i'm lost with this
try spawning them as ambient patrol groups, the ambient patrol system has logic to only spawn AIs when players are nearby and automatically despawn when there are no players near
you probably wanna override β¨SCR_PlacingEditorComponent.OnEntityCreatedServerβ©
okay thank you, i test that
Hi guys how to read mouse scroll wheel values bot hpositive and negative and in general too other vlaues
i have gone thorugh the documents but i havent fot very specifc answers
we have context
context contains actions
and we also have keybinding for menu setups
explaination would be great but atm im only looking for mouse scroll values
Hello, I moved all my scripts to a new project, and since then, all my scripts no longer exist in the Workbench, even though they are still there. They are gray instead of green, and I have no idea how to fix this. i try reload et validate script but not works... any idea ?
Swapping materials is done via set VObject it seems, unless that changed recently
Which can break anims, etc.
i just ended up swapping prefabs instead of materials
Are they in the right folder? Aka Project/Scripts/Game
Or whatever module they should be in (GameCode, etc.)
Anybody knows what could cause this ?
A lot of things π recently for me it was due to lots of replication calls happening in a short space of time and it falling apart i believe
The logs will tell you a bit more than the popup, look a few frames before the kick
For me it's a few seconds after spawing in the world. It only happens on dedicated server and not relevant logs
Iβve tried many things. I will take any suggestion lmao
Start eliminating things, either in the hierarchy or mods.Until it goes away and then slowly add things back until you isolate it.
@hazy ether what was yours from?
Rpl crash
does anyone know why the Project realism planes wont let my server start say "Cant compile game script module" and something about too many instructions per function
It was 1 of 2 things... i think it was when I deleted several prefabs from my world and replaced them and made sure to override them instead of duplicating... or it was when I went into my server files and deleted all my previous saves under that scenario
Sounds like broken scripts in that mod, will be unusable until the author fixes it
Look at the reason it can't compile
Can be a duplicate class name for example
Yes they are well in the good gamecode folder I was careful... I don't know how to correct his
I'd look into DestructionMultiPhase component, seems to have what you need out of the box (haven't tested it but it exists and is vanilla, so might save some headache)
Is there anyway to restart the server in game script or would I have to communicate to an external process
Also how can I restart a server in a way that allows everyone to instantly reconnect? Ive seen it where a public server goes down and I instantly reconnect to the new scernario.
There is a way through script and definitely preferrable as the game will be able to clean itself up. I also believe there are ways to restart the server itself and change the scenario running without a complete restart, look at whats available in the gamemode scripts
Yeah the current scernario reload method is broken as of 1.6
That's only possible on servers with low pop because of the jip error that arrived in 1.3
Now you have to GetGame().RequestClose(); on the server so that it can fully restart the server which is the same as having the -autoShutdown cli param
Ah so is there anything fancy I have to do or just call RequestClose() and players will automatically connect back afterwards?
can anyone sned me a zip file download for kunar zombies and its requirement workshop keeps glitching
We use the RequestClose, it takes a second but the reconnect feature in the main menu will let them rejoin after the server is ready again. They don't stay in the server at all, they get kicked back to the main menu and that 10s reconnect timer starts
Ah okay bet thank you
ig i should say that my server starts back up because my docker container puts it back up
No they won't. Since 1.3 you can't get a populated server to gracefully restart
Before that you could just request another scenario and it would work fine (at the expense of proper memory leaks)
How do you run your server?
We have our own server box where we just launch it with a powershell script
Currently we just swap the scernario id and ctrl + c and run it again
Just looking for a way for players to auto connect again as scernario loading in game is busted rn
I feel like some magic with batch could be possible to do that, might not be as graceful as youd like but still hands off
Yeah that was my first thought process but if graceful restarts aren't a thing anymore then Im not gonna invest the time
hi, anyone know the author's contact info of this mod?
1.3 also introduced the freezing which was reported and ignored, saw a post though from Mario saying they are looking to try to test game updates with mods. Not asking to be hand held but would love if they picked a high pop public PvP server, copied the mod list, and tested that with dev kits to find common issues (either mod based, or game based)
Shitty workaround: kill the server while it's loading the world, swap scenario and start it. Games will receive a timeout and will reconnect after 5 seconds.
For everon this is ~74 seconds after the conflict round ends. From experience.
I have the ability to read Ik that Iβm just curious if anyone may know why thanks to all that responded thoπ€£
Hey, can someone explain to me what I need for a missionHeader setup? or where I can find information about it, or a small example. for example for this bool "[Attribute(defvalue: "true", desc: "Whether the MiniTab can be Used.")]
bool m_bIsTabMiniAllow;" or per config/Profile
No one can possibly know why from reading the vague sentence you posted.
There are like 14 mission headers in base game that you can look at.
If you're meaning how to add attributes to one, it works like everything else.
Hey, who prefixes their scripts with BS_?
We got a rolling error that looks like the world's worst Matrix screensaver.
[37mReason: NULL pointer to instance[0m
[37mClass: 'SCR_ChimeraCharacter'[0m
[37mEntity id:4611686018427399548[0m
[37mFunction: 'EOnFrame'[0m
Thanks I'll check it out tonight and see if I have better luck
I donβt know anything about how these things work that why I was asking yβall lol
Well what mods do you have loaded?
In order for anyone to know anything about it, we need the actual errors, not a vague description of them.
But since you know who the creator is, you should be on their Discord asking them.
oh god, I'm helping someone by building out a custom arsenal and they got a lot, I just know its not in my arsenal or my conflict layer
No one knows better as to what's going on in their mod, than the creator.
Gotta get with them to figure it out, or search through the mod folders looking for scripts prefixed like that.
Iβm just keepin the energy the same as it was dealt out boss. Like I said I donβt know how this stuff works just lookin for an answer or a direction to go in but if people wanna respond to my questions half cocked Iβll meet n greet right back but any who thanks for the directional advice have a nice day.
tough guy alert!
I do have a genuine question about one of your mods if you do have time to answer out if curiosity
Not my goal just donβt see the point of hostility just bc Iβm not knowledgeable on the subject
There was no hostility.
the answer you got at first was accurate and then you were hostile. If you toss a picture of the log in here that you don't know about we might be able to actually help.
Then I apologize for my responses hard to gauge a lot of that over text
No worries.
But we can't help you with a vague description. In most cases we need the actual log, and in even more cases we need to see the actual scripts to fix the issue.
But as I said, in this case the proper channel would be to contact the creator.
Also seeing this on our server
When I get home I can post a pic of the log if itβs something you may know about
If not then no worries Iβll dig around for their discord
Fresh ambitious server owners, so eager, but gotta teach him how to clean the cobwebs out of his server folders.
Thank you
Boom new project, new folder. Clean space to use
Can you send me a list of your mods so I can cross reference?
I'll get the Json and DM you, if you block me after you see it... I full understand.
I really like Loaf host that they're using, but GOD I feel like my grandparents trying to switch inputs
Loaf host?
yes, loafhosts.com. I'm used to 0grind, so they're similar but trying to find where the buttons and options are moved to is the pain in the ass
Ahh gotcha, figured it was a server host but the second part confused me.
Those kind of logs are why I'd encourage to prefix script with the mod GUID in some form
you know, I've been working on something for about 2 weeks show you and get permission on, and these stupid little spot fires just wont quit long enoughπ€£
just saw this pop up in my logs
I killed the mod load and just loaded my arsenal build and the map build, no more run away error. Now to just slowly add things back in.
wish i could do that, was investigating another issue and saw it. Loaded all the mods up that we have on the server in workbench and there's 0 scripts related to it 
I was having the same issue, do you use improved blood effects? I've just version locked that to 1.4.8 and it seems to have stopped
Indeed we do, also loaded the mod in wb and found the script, ig i didnt have it loaded with the others, thought it was a dependency. Thank you ill lock the version
Not sure who handles that mod, there isn't a showcase for it
@past berry Any chance you'd be able to look at this?
WORLD : UpdateEntities
WORLD : Frame
SCRIPT (E): Virtual Machine Exception
Reason: NULL pointer to instance
Class: 'SCR_ChimeraCharacter'
Entity id:4611686018427484896
Function: 'EOnFrame'
Stack trace:
Scripts/Game/BS_ModdedChimeraCharacter.c:325 Function EOnFrame
Its during the damageManager.IsBleeding() check on the player, i think what might be able to conflict with it is our safezone, if a player dies or stops bleeding in some manner
It'll happen for a few frames then stop, but will happen again randomly
Hello , can you update your mod to 1.5.2
I'll leave the version blank so it updates to the latest on next restart, thank you
Thank you for your feedback i hope we don't have this problems in the future π
Anytime, thank you again for the quick fix.
How do I make a quaternion array? Something like ref array<ref array<float>> ?
Since they have fixed sizes a static array would be better. float quat[][] in the dimensions you need
Is there a way to put a static array in a normal array? like ref array<float[4]> or something?
Not sure, do you have a dynamic amount of quaterions? have you considered making a small wrapper class called quaterion that is just some vector3 members or something? you could store that as ref array
oh true, I can just make my own quaternion class 
Can we use preprocessor directives between two mods?
Like:
Child mod:
#define CHILD_MOD
Parent mod:
#ifdef CHILD_MOD
β¦
#endif
Yes and no. In my experience they mostly work and then with some other mod or file it does not. I think it relates to file order/naming. So ... if you define it early in your directory structure and call the file AAA_smth.c, it should work.
Ah thanks. Will give that a shot
Can anyone explain why a call later or eonframe in a component on a generic entity would not be being called on clients?
Did it set the frame mask? So are you sure the call later was queued? Are you also sure the entity was not streamed out an in again in the mean time?
Yeah I had .Frame set and it didn't work, no prints from on frame
And the calllater was queued as far as I know (I had a print to check) but it did not run the function
I don't believe it was streamed out and in, it periodically runs anyway and they are stood next to it. Plus rpl is not set to spatial so it shouldn't get streamed out
How can I call this for newly built prefab? This causes VM errors and probably isn't the best way because I'm a c++ newb. Trying to go off of the filename when a base structure is built
You have to instance the component, not sure where the component is at exactly but before you print hte selected prefabs youd have to do
foo = SCR_PlacingEditorComponent.Cast(GetGame().GetGameMode().FindComponent(SCR_PlacingEditorComponent));
The GetGame().GetGameMode().FindComponent(SCR_PlacingEditorComponent) may be different in order to find the component
I've seen you call this C++ numerous times and I'd like to clear up some confusion that you have. The engine is written in C++, the scripting language is Enforce Script.
In regards to your post. What exactly are you trying to do?
I can happliy joing a VC if you'd like.
Making it so anything with a fuel depot has limited fuel. The first built at each base will have a certain amount of fuel.
- pull the latest prefab that was built
- if the prefab file is x, y, or z AND it isnt in a list, set its fuel to 100 gallons then add the basename to an array
yes i can do VC
! prefix works well to ensure that it compiles first
And obviously it only takes effect in that module (Game should be used in 90% of cases anyways)
Not true, you just need a file with a prefix so it compiles before other files in the mod and other mods with the define, which will make that define exist any time that mod is loaded. Defines via project settings may be supported now with 1.6, but script has been the way I have done it for my projects.
In the filename or the parameter?
Alright.
Thanks you. π
First time fellas bare with me!
3 essentially custom factions how do I now set this up for when I spawn in I can click between each faction and play as that faction?
is procedural animation window broken or smth???
afaik you need faction keys for all of them also you should register the faction Enums. Then in your scenario(world editor) you need to put the faction configs into a Faction Manager. And you need some spawnpoints that belong to the corresponding factions.
Enums and keys will help you on adding custom loadouts to your faction. You also need to set up the faction loadouts the player is spawning with.
There are some really good tuts on yt on doing all of this.
got any links for me pls
For the Scenario: https://www.youtube.com/watch?v=AyGeke4kDck&t=969s
For the Factions https://www.youtube.com/watch?v=bkKGcSGYlM4&t=523s
Learn the basics of how to create a scenario for Arma Reforger in the Enfusion Workbench!
More Documentation should be coming, check here: https://community.bistudio.com/wiki/Category:Arma_Reforger/Modding
Part 2: https://www.youtube.com/watch?v=obrwBQTBGw8
Source files: https://github.com/DasCapschen/Arma-Reforger-Tutorial-Project
Chapters
0...
Setting Up New Faction Arma Reforger Tools Enfusion
β‘οΈ Donate here: https://ko-fi.com/andeerock
Discord: andeerocks
Probably not the best channel for bug reports, check dm 
Hahaha just noticed what channel we were in
File name
The define can be named anything but I recommend tag combined with mod name
What do I need to do to be able to inspect my item?
Edit: its in InventoryItemComponent Item Animation Allow Inspection
Is it a weapon?
If it's not a weapon you'll have to do a lot of things to make it "inspectable"
My edit did the Trick
Blip blop blup back at it with my stupid questions :
I wasn't able to figure out how to get the english value of the string #AR-Weapon_M16A2_Name, anyone know where i can find those or if there is a helper that can help me grab those quickly ?
Thanks in advance ^^
i do see a code sample that uses
notificationMessage = typename.EnumToString(ENotification, m_Data.GetID());
But i wonder what's the typename for weapons / vehicles
Maybe try this out: #enfusion_scripting message
Tysm !
i'll see if it works but it looks like what i need
man you helped me out with that too, was trying to figure out that junk bc its in the prefabs lmao
Now there just needs to be a UH-1H mod that resembles an AC-130
theres a ".stars" file filled with that gibberish, some kinda DB for the stars
ig i'll have my web service filter out the weird chars
i'm not in a mood to do that myself
or not that, theres something in there thats similar
hahahaha, and how did you modify ?
What exactly does the condition:!BadMatrix33(val) mean?
Usually that you have have an inf or nan value somewhere in it
this is a bit of a silly because i feel like i should know by now but when we create a component, should we use the componentClass to store attributes or not really ?
Is there any advantage to storing attributes there instead of simply in the component
See #enfusion_generic message
The component data Arkensor is talking about is referring to the componentClass.
And it's basically a form of the flyweight pattern if you want to look up the concept.
that's really nice to know
i'll def look more into it thanks a lot kex
How can I prevent character falling animation? charController.SetOrigin(vehicle.GetOrigin()+ Vector(0.5,0,0)); vehicle.AddChild(charController,-1);
Don't fall.
You can reach it as well if any of your basis vectors in your transform matrix is Zero vector after doing some operations on them
Yeah i was doing Math3D.MatrixInvMultiply3
this guy I am watching for a tutorial is making a custom faction. He is now duping "EEditableEntityLabel.c" over to his files and able to change the files code. This is so I can have my faction label set as Faction_Police...
Any ideas why this is not working when I am duping them across?
If that's how he showed you how to do it in the tutorial then you should stop watching that video.
okay sweet, how should i do it then?
cheers dude β€οΈ
I may have misinterpreted what you were implying in your post it might be a good tutorial. But if it's not explaining how to mod that class and the fact that you have to compile scripts for scripts to "update" then it can't be that great of a tutorial.
yeah I can't seem to get it to function i'm going through the wiki now to see if that helps but I genuinely can't override it at all
You can override it. When you duplicate a script it's required to have a completely different name (in 99.99% of cases).
The link i sent explains exactly what to do. Not in the greatest English, I'll give you that.
can only dupe
which i duped and did this
compile the scripts.
Could anybody suggest how I could achieve something similar to Arma 3's attachTo, between two player characters?
For example, an escort script. I've tried a few things so far and not had much luck, I realise it might not be pretty but I'm happy to look into any suggestions
If you're referring to the way handcuffed dude were getting transported in A3 i can think of 2 ways, one that might not be pretty and one that might not simply work/be possible.
1 : manually set the transform of the escorted player as the escorting player's transformation (with a slight projection in front), would have to do that every post fixed frane.
2 : i don't know if you can simply add the other character to your character hierarchy??? Maybe?? I know in the world editor everything in an entity's hierarchy will move with the parent object
You could take a look at how ace has done the carry function
They use a invisible vehicle compartment
Question: if I put a print in the constructor of a custom class and reference the custom class in another class, with ref, would it print or no?
Running into the issue of seemingly my class instances are doubling, or even quadrupling in some cases, after the loading of persistence. And can't really identify whether it'd be a bad serialization on my part or bad code that references the custom class (or both)
ref usage will not duplicate the class instance
gotcha, so I was probably chasing the wrong thing and it's probably an issue with my serialization, thank you!
Is there any chance we can get stronger compiler type safety between int and float usage? It's possible to accidentally pass a float to functions that only work with int and not get any compiler warning instead just causing weird and hard to debug issues
No because it is an implicit conversion and by design
Doing it seems to cause random issues that might not be immediately obvious, in my case I was adding custom budgets for build mode and when I accidentally forgot to make the value of one an int the budgets would all work on first open of a building provider, but subsequent opens would inexplicably cause all budgets except for props to be disabled entirely
If it has potential to cause stuff like then it seems like there shouldn't be this implicit conversion as it can cause unpredictable issues at runtime
Can you give a concise example with code?
If there is such an issue, then that's a bug and not something inherent to implicit conversion.
Sure, I have this override for β¨β¨β¨β¨FilterAvailableBudgetsβ©β©β©β© to compute and inject cash + rep budgets based on the supply budget.
Everything works fine with this example now, but originally I mistakenly was passing a β¨β¨β¨β¨floatβ©β©β©β© as the value for rep budget. Everything would work as expected on first time accessing a building provider but subsequent opens had all budgets except for props disabled (not just my custom ones even other vanilla ones like supply and cooldown vanished from budgets array).
Since there were no runtime errors and the compiler provided no useful warnings about me passing a float where an int was expected I was only able to figure out the cause by random trial-and-error
Relevant override included below, if you want all the scripts to try running it I'll be pushing it in next update for DE shortly
β¨β¨β¨β¨```cs
override protected void FilterAvailableBudgets(inout notnull array<ref SCR_EntityBudgetValue> budgetCosts)
{
if (!trader)
return super.FilterAvailableBudgets(budgetCosts);
DE_EconomySystem economySystem = DE_EconomySystem.GetInstance();
float repRequirement = 0;
int supplyBudgetValue = 0;
for (int i = budgetCosts.Count() - 1; i >= 0; i--)
{
SCR_EntityBudgetValue budget = budgetCosts[i];
// cache supply budget to generate cash budget from
if (budget.GetBudgetType() == EEditableEntityBudget.CAMPAIGN)
{
supplyBudgetValue = budget.GetBudgetValue();
continue;
}
// read item-specific rep requirement
if (budget.GetBudgetType() == EEditableEntityBudget.REP)
repRequirement = budget.GetBudgetValue();
if (!IsBudgetAvailable(budget.GetBudgetType()))
budgetCosts.Remove(i);
}
// inject cash and rep budgets for any item with supply budget
if (supplyBudgetValue)
{
float cashValue = economySystem.SupplyToCashValue(supplyBudgetValue, trader.traderMargin);
int budgetValue = cashValue * economySystem.vehicleTraderValueMultiplier * economySystem.intPrecisionFactor;
ref SCR_EntityBudgetValue cashBudget = new SCR_EntityBudgetValue(EEditableEntityBudget.CASH, budgetValue);
budgetCosts.Insert(cashBudget);
// if no item-specific rep requirement set, check for rule to apply based on supply cost
if (!repRequirement)
{
float repMult = economySystem.vehicleTraderRepValueMultiplier;
float repCashValue = supplyBudgetValue * repMult;
ref RepSupplyCostRule foundRule = economySystem.GetRepRequirement(repCashValue);
if (foundRule)
repRequirement = foundRule.repRequired;
}
// if a budget value is typed as float, all budgets break!
int repValue = repRequirement * economySystem.intPrecisionFactor;
ref SCR_EntityBudgetValue repBudget = new SCR_EntityBudgetValue(EEditableEntityBudget.REP, repValue);
budgetCosts.Insert(repBudget);
}
}
intPrecisionFactor data type is integer?
yes, originally I was passing β¨β¨β¨float repRequirementβ©β©β© directly and it was breaking budgets, by trial and error I tried passing a static β¨β¨β¨intβ©β©β© in and it fixed the problem so I updated it to multiply floats by the precision factor and explicitly assign to an int before setting as budget value, then divide by precision factor again before showing in UI
The problem makes total sense now my gripe is just that I feel like the compiler obfuscated that problem from me due to the implicit conversion being allowed but seeming to not work as expected at runtime here
Works for me π€·ββοΈ
Or do you mean something else?
yes the β¨SCR_EntityBudgetValueβ© instance seems to create fine as expected and as I said the budgets all work fine in first use of an entity spawner/building provider but upon opening it a second time they would all break
What do you mean by "opening it a second time", what happens on a technical level?
It's based on Conflict Vehicle Service building setup, here are 2 example videos, the only difference between these 2 runs is in the broken (first) example I changed the type of β¨repValueβ© to β¨floatβ©, so β¨SCR_EntityBudgetValueβ© is being passed a variable initialized as a float and implicitly converted. The working example is passing a variable explicitly assigned as an β¨intβ© as in my example code above
I recommend doing some debugging with breakpoints to check where the origin of the issue is
Note how in the broken example subsequent opens of the build menu don't apply any budgets to catalog browser entries, it seems somehow all disappeared/got removed from the building provider's β¨β¨m_aBudgetsToEvaluateβ©β© except for β¨β¨Propsβ©β©.
Just because a float got auto converted to an int instead of explicitly assigned as one before being passed to a function expecting an int??? how does that make sense??? for the use of auto conversion to cause such radically different behaviour something is definitely broken here
If auto conversion were functionally equivalent to using an explicitly assigned int then there would be no difference in behaviour here
If you create a similar float value budget and inject it into budgetCosts in an override on SCR_CampaignBuildingBudgetEditorComponent.FilterAvailableBudgets I think you will experience the same issue upon opening a vanilla Conflict vehicle service provider sign
Where on the first open vehicles you don't have enough supplies for are locked out, but close and re-open the menu and suddenly the supply budget has vanished and UI shows everything enabled
sdffdsgdfgs
true
Can anyone help me understand how to use a loot spawner mods
Hello.
Cant fix the problem with spawn in water. On kolguev it works fine, but on Everon not.
I have vector (lets image that Y is random). How can I check if this spawn point will be in water? Ignoring Y, or getting lowest terrain point by Y
Iirc this worked for me.
SCR_WorldTools.GetWaterSurfaceY();
Look it up in Script Editor.
Will try. Thanks
There is also:
ChimeraWorldUtils.TryGetWaterSurface(world, worldPos, waterSurfacePos, waterSurfaceType, transformWS, obbExtents);
Can't remember which one i used but i think it was the first one.
Let me try. Thanks
Could someone who understands scripting, let me know if I can do anything to fix this, or should I ignore it?
it tells you where the error is in the stack trace SCR_DeployableInventoryItemReplacementComponent::EOnInit
is this just something you noticed, or did you do something that caused this
I created this, using the Base Deployable Inventory Item component. It throw's this error in the console log as soon as I save the prefab, and then whenever I use the prefab.
are you missing something in the component? go to that class and look at line 52, thats where the null error is
Maybe it's throwing the error because the damage component was turned off on the replacement prefab?
yes, damageManager is null
there isn't a null check in that method so it just crashes
so add back the SCR_DamageManagerComponent
I turned on the damage manager, now I'm getting errors for default hit zones.
