// Getting object with name BTR1 from world.IEntity myEntity2 =GetGame().FindEntity("BTR1");if(!myEntity2)return;// Deleting entity using SCR_EntityHelper.
SCR_EntityHelper.DeleteEntityAndChildren(myEntity2);
IEntity myEntity =GetGame().FindEntity("helmet_0");Print(myEntity.GetPrefabData().GetPrefabName());ParametricMaterialInstanceComponent cloth =ParametricMaterialInstanceComponent.Cast(myEntity.FindComponent(ParametricMaterialInstanceComponent));if(!cloth)return;
cloth.SetUserAlphaTestParam(255);// NOTE: Some items like helmet and his attached entities are hidden when changint from Third person to First person.
10. How to use Virtual Arsenal (spawn only locally) functionality.
Spoiler
/*!
This action will print all arsenal item's names and specifically M16 item name. Using Virtual Arsenal functionallity.
Used as reference: SCR_InventoryOpenedStorageArsenalUI.c
*/class SPK_UserAction2 : ARU_ScriptedUserAction
{//------------------------------------------------------------------------------------------------
override voidPerformAction(IEntity pOwnerEntity,IEntity pUserEntity){protected ref map<ResourceName,IEntity> cachedEntities =newmap<ResourceName,IEntity>();// Getting SCR_ArsenalComponent allowed/filtered items.
SCR_ArsenalComponent arsenalComponent = SCR_ArsenalComponent.Cast(pOwnerEntity.FindComponent(SCR_ArsenalComponent));if(!arsenalComponent)return;array<ResourceName> prefabsToSpawn =newarray<ResourceName>();
arsenalComponent.GetAvailablePrefabs(prefabsToSpawn);if(prefabsToSpawn.IsEmpty())return;// Creating VIRTUAL ENTITIES (spawning locally) while adding it to the map array.
foreach (ResourceName resourceName: prefabsToSpawn){
cachedEntities.Insert(resourceName,SCR_VirtualArsenalCacheManager.GetInstance().RegisterResource(Resource.Load(resourceName)));}// Using this items for any stuff we needPrint("Searching for all items: "+cachedEntities.Count().ToString());
foreach (ResourceName resourceName,IEntity entity: cachedEntities){GetInventoryItemUIInfoName(entity);}// Getting an specific item name. ResourceName myResourceName ="{3E413771E1834D2F}Prefabs/Weapons/Rifles/M16/Rifle_M16A2.et";Print("Searching for specific item: "+myResourceName);IEntity ent = cachedEntities.Get(myResourceName);if(ent)GetInventoryItemUIInfoName(ent);}//------------------------------------------------------------------------------------------------
string GetInventoryItemUIInfoName(IEntity ent){
string str ="";if(!ent)return str;InventoryItemComponent inventoryItemComponent =InventoryItemComponent.Cast(ent.FindComponent(InventoryItemComponent));if(inventoryItemComponent)
str = inventoryItemComponent.GetUIInfo().GetName();elsePrint("No name: "+ent.GetPrefabData().GetPrefabName());Print(str);return str;}};
Edition
1. Change default loadout loaded when spawning on world editor (useful for test purposes). Change it on the Loadout Manager prefab that should be present on the world map.
torials I made while helping people in Arma Discord
First Steps
Video:
Generic
1. Actions and Hints -https://discord.com/channels/105462288051380224/976155351999201390/980360446110494761
ScriptSetup
1. Create this folders: Scripts/Game/generated/UserAction/Modded.
2. In Modded folder create ScriptedUserAction.c
3. Inside this file put this:
World/EntitySetup
1. If not present, add an ActionsManagerComponent (read wiky for minimum components present in order to work)
2. Add one ActionContext
3. In ActionContext, input some ContextName (myContext)
4. In ActionContext, set Position to PointInfo and move up the Y offset (you will se the point moving in the world editor)
5. Add one Additional Actions selecting your class inside ScriptedUserAction.c in my example myScriptedUserAction.
6. In Aditional Actions/myScriptedUserAction add one parent context list and select the ContextName created before (myContext).
7. In Aditional Actions/myScriptedUserAction Add UiInfo and input some Name to be shown.
8. In Aditional Actions/myScriptedUserAction set visibility range to some value (2)
9. In Aditional Actions/myScriptedUserAction set duration to some value (2)
2. How to Kill object -https://discord.com/channels/105462288051380224/976155351999201390/995759928838996099
3. Delete Vehicle - https://discord.com/channels/105462288051380224/976155351999201390/995762975006785607
4. Get entities from world in area - https://discord.com/channels/105462288051380224/976155351999201390/1068605228653498398
5. Make a custom config -https://discord.com/channels/105462288051380224/976155351999201390/1069333335672885299
6. Hide item - https://discord.com/channels/105462288051380224/976155351999201390/1076409862101155850
7. Check if third person IsActive - https://discord.com/channels/105462288051380224/976155351999201390/1076470136632004618
8. How to get attributes from a component not spawned yet.
9. Send notification (local client)
10. How to use Virtual Arsenal (spawn only locally) functionality.
Edition
1. Change default loadout loaded when spawning on world editor (useful for test purposes). Change it on the Loadout Manager prefab that should be present on the world map.
Workbench
1. Connecting Script Editor Debuger to PeerTool Client - https://discord.com/channels/105462288051380224/105465701543723008/998630810913607760
GUI
1. First steps - Button and Hint - https://discord.com/channels/105462288051380224/976159778965438494/980534472372019250
2. Lists - https://discord.com/channels/105462288051380224/976159778965438494/986701077846061066
GUI - Game master
1. Populating dropdown list getting the variables from a component placed in the edited entity (in his case the vehicle) - https://discord.com/channels/105462288051380224/976159778965438494/1030925491080802314
2. Add new waypoint to GM - https://discord.com/channels/105462288051380224/976159778965438494/1038538873283805325
Share this post
Link to post
Share on other sites