Jump to content

theVestarr

Member
  • Content Count

    9
  • Joined

  • Last visited

  • Medals

Community Reputation

1 Neutral

About theVestarr

  • Rank
    Private
  1. Hi all, I've recently taken my first steps in arma modding and have successfully created an object in blender, added textures and materials, imported to the game etc etc. Consists of 7 components and 4 different textures. I'm attaching a picture of it below: It's basically an airport taxiway direction sign, for immersion. These 3 "displays" with letters on them are their own components in the custom LOD (display_L, display_M, display_R) and have an emissive material applied to them (no texture in the material), which works pretty great. However, I would like to be able to switch the textures on those displays with scripting (setObjectTexture command), and I''ve been trying to use hiddenSections for that with no luck so far. When I run getObjectTextures on the object, it returns the ones that are set in the config. If I run setObjectTexture and then getObjectTextures, it gets updated, but nothing changes on the model. Model has these 7 components and display_L, display_M and display_R have the same textures assigned to them in the object editor as the ones mentioned in the config. Here's my configs: model.cfg class CfgModels { class Default { skeletonName = ""; sectionsInherit = ""; sections[] = {}; }; class VAP_DTD_SIGN : Default { skeletonName = "VAP_DTD_SIGN_Skeleton"; sections[] = { "body", "display_L", "display_M", "display_R", "Leg1", "Leg2", "Leg3" }; }; }; class CfgSkeletons { class Default { isDiscrete = 1; skeletonInherit = ""; skeletonBones[] = {}; }; class VAP_DTD_SIGN_Skeleton : Default { skeletonBones[] = { "display_L", "", "display_M", "", "display_R", "" }; }; }; config.cpp class CfgPatches { class VESTARR_AIRPORT_PROPS { requiredAddons[] = {"A3_Structures_F"}; name = "Name"; author = "Vestarr"; url = ""; requiredVersion = 0.1; units[] = {"VAP_DTD_SIGN"}; weapons[] = {}; }; }; class CfgVehicles { class Thing; class VAP_DTD_SIGN : Thing { displayName = "D-T-D Taxiway Sign"; author = "Vestarr"; editorPreview = "\airportshit\data\dtd_sign\icons\dtd_sign_icon.paa"; scope = 2; mapSize = 0.9; accuracy = 1; destrType = "DestructNo"; model = "\airportshit\data\dtd_sign\objects\dtd_sign.p3d"; hiddenSelections[] = {"display_L","display_M","display_R"}; hiddenSelectionsTextures[] = {"\airportshit\data\common\textures\taxiway_dir_b_9_ca.paa", "\airportshit\data\common\textures\taxiway_mark_a_ca.paa", "\airportshit\data\common\textures\taxiway_dir_b_9_ca.paa"}; }; }; Also my material, in case it matters: ambient[]={1,1,1,1}; diffuse[]={1,1,1,1}; forcedDiffuse[]={0,0,0,1}; emmisive[]={100, 80, 28,0.2}; specular[]={0,0,0}; specularPower=2; PixelShaderID="Normal"; VertexShaderID="Basic"; Can anyone shed some light how does this thing work and how to use it properly? I'm really confused.
  2. theVestarr

    Drawing a text on an object

    EDIT: I'll move it to a new topic as it's already kinda out of scope of the question. So - quick update. After a long research and hundreds of attempts, I've gotten somewhere. Finally my model is showing in game, has correct textures, even managed to get the material to be emissive and it's looking good so far. However, I still can't get this setObjectTexture thing to work. I'm still not sure if I understand sections/hiddenSelections. I've got a few components in my LOD (it's a low poly model so I use one resolution LOD). Here's my model.cfg: class CfgModels { class Default { skeletonName = ""; sectionsInherit = ""; sections[] = {}; }; class VAP_DTD_SIGN : Default { sections[] = { "body", "display_L", "display_M", "display_R", "Leg1", "Leg2", "Leg3" }; }; }; these sections correspond to my Component names in the model. Now my CfgVehicles for this object goes like this: class CfgVehicles { class Thing; class VAP_DTD_SIGN : Thing { displayName = "D-T-D Taxiway Sign"; author = "Vestarr"; editorPreview = "\airportshit\data\dtd_sign\icons\dtd_sign_icon.paa"; scope = 2; mapSize = 0.9; accuracy = 1; destrType = "DestructNo"; model = "\airportshit\data\dtd_sign\objects\dtd_sign.p3d"; hiddenSelections[] = {"display_L","display_M","display_R"}; hiddenSelectionsTextures[] = {"\airportshit\data\common\textures\taxiway_dir_b_9.paa", "\airportshit\data\common\textures\taxiway_mark_a.paa", "\airportshit\data\common\textures\taxiway_dir_b_9.paa"}; }; }; I assumed I'll be able to change these textures in-game with setObjectTexture but it doesn't happen. If I call getObjectTextures afterwards, it returns the updated textures, but it doesn't reflect it on the model, like it's not connected. Am I supposed to set no textures at all to that component in the object editor or something? Thanks for the help so far!
  3. theVestarr

    Drawing a text on an object

    So - quick update. After a long research and hundreds of attempts, I've gotten somewhere. Finally my model is showing in game, has correct textures, even managed to get the material to be emissive and it's looking good so far. However, I still can't get this setObjectTexture thing to work. I'm still not sure if I understand sections/hiddenSelections. I've got a few components in my LOD (it's a low poly model so I use one resolution LOD). Here's my model.cfg: class CfgModels { class Default { skeletonName = ""; sectionsInherit = ""; sections[] = {}; }; class VAP_DTD_SIGN : Default { sections[] = { "body", "display_L", "display_M", "display_R", "Leg1", "Leg2", "Leg3" }; }; }; these sections correspond to my Component names in the model. Now my CfgVehicles for this object goes like this: class CfgVehicles { class Thing; class VAP_DTD_SIGN : Thing { displayName = "D-T-D Taxiway Sign"; author = "Vestarr"; editorPreview = "\airportshit\data\dtd_sign\icons\dtd_sign_icon.paa"; scope = 2; mapSize = 0.9; accuracy = 1; destrType = "DestructNo"; model = "\airportshit\data\dtd_sign\objects\dtd_sign.p3d"; hiddenSelections[] = {"display_L","display_M","display_R"}; hiddenSelectionsTextures[] = {"\airportshit\data\common\textures\taxiway_dir_b_9.paa", "\airportshit\data\common\textures\taxiway_mark_a.paa", "\airportshit\data\common\textures\taxiway_dir_b_9.paa"}; }; }; I assumed I'll be able to change these textures in-game with setObjectTexture but it doesn't happen. If I call getObjectTextures afterwards, it returns the updated textures, but it doesn't reflect it on the model, like it's not connected. Am I supposed to set no textures at all to that component in the object editor or something? Thanks for the help so far!
  4. theVestarr

    Drawing a text on an object

    I'll use the textures, but thanks for that, I'll definitely need that in the future. However, I'm really struggling with the configs, and both search and google didn't point me anywhere that was helpful, documentation didn't make much sense to me either. Could anyone point me in a direction how to understand some things here? First of all, I've got the model - all exported from blender, textured (even normal and specular maps generated, I'll try to generate materials later), but I'm not sure how to configure both my material and model/mod in general. The object is supposed to be a static prop so I believe the config shouldn't be too hard, but samples don't have anything that simple if I'm not wrong. Also, my model components have 4 different textures, 2 of which I would like to control with setObjectTexture in the missions and stuff. Im confused what sections, hiddenSelections are and how to configure them to my needs. Could anyone shed some light on that? Also, can I use setObjectTexture when a component has a custom emissive shader, or is it one or the other? Sorry for asking do many questions but I spent a day looking for answers and found nearly nothing.
  5. theVestarr

    Drawing a text on an object

    Thanks for a quick response. I'll check the samples and documentation. As you said, I don't have much experience with Arma modding itself so I'm kinda trying to find my way around it. I've done some game modding in general in the past and done some scripting for mission in arma though. Also thanks for that example. It requires Contact DLC or am I wrong reading it? I gave it some thinking and I decided I'll use the texture approach, I'm just gonna write a script in node that will generate necessary letters on an image and save it. I'll also have to figure out how to make it setObjectTexture-friendly and it should be fine.
  6. Hey all. Apologies if I posted in a wrong section. I'm getting into modding and I'm playing around with some different solutions. I was thinking about creating and releasing a mod soon. As a part of it however, I need to create a custom object that can draw a text (from its custom attributes) on its flat surface. I really want to avoid creating textures for every single digit and letter of the alphabet. I'm guessing it's possible, as even aircraft HUD's and dials can display current altitude and speed. I tried looking it up on the forums but I didn't find anything useful. Obviously performance is key for me, so if there isn't any good way to solve it, I'm happy to do it with a ton of textures instead. The object is very unlikely to change its text mid-game because it's basically a specific, static sign, so I don't know if having each frame loop to update it is really necessary, unless it doesn't take too much power. In case I need to use the textures approach, can anyone shed some light how to create an object that works with setObjectTexture? As mentioned earlier, I would like to provide some extra options in the eden editor's object's attributes to customise the sign's textures, is there a way of making it reflect its textures set in attributes in Eden after they've been changed? Is there a way of creating textures that glow in the dark, or otherwise having a light on an object that turns on at night and lights up the sign? Thanks!
  7. Thanks for the script man, I was actually looking fo it for some time! Still, it would be great to display a message to the users, but the script doesn't seem to see the difference. PublicVariable handler goes completely ignored.
  8. Hello everyone! I've recently started my first very own A2:OA Dayz Epoch server. It's all going well and I'm loving it, so I was trying to make some improvements and learn SQF scripting. I've found this mod on this forum some time ago: https://github.com/FullyGored/Cherno-Train-Service and I decided to implement it on my server. It really worked well. The only thing I didnt like about it, is the fact that the wagon is actually the Ikarius bus, so that the players can actuall get in (because normal wagons are not "proper" vehicles - you can get inside of it by climbing the ladder but you can't sit inside of it like you do in a car). It just looked silly to me and wasn't really immersive, so I decided to do something about it. So if you look at the Train_Start.sqf file, in line 32 it's actually spawning the Ikarius Bus. I replaced it with the wagon and added my custom init script to it. _wf = "Land_wagon_box" createVehicle _pos; _wf setVehicleInit "nul = this execVM ""scripts\Train\InitWagon.sqf"";"; processInitCommands; which contains the following: _this addAction ["<t color='#FF0000'>Get on the train</t>", "scripts\Train\GetOn.sqf", [], 6, true, true, "","alive _target"]; the GetOn.sqf just attaches the player to the wagon: _wagon = _this select 0; _action = _this select 2; player removeAction _action; player attachTo [_wagon, [1, -2, -0.85]]; player setDir 270; player setVariable ["isOnTrain", true, true]; So, here comes my first problem: why does the action menu disappear once the user is attached to an object? That would make the whole thing 10x easier, because I would just add an action to get off the train and the problem would be fixed. I tried many approaches, trying to detect key presses, etc. Basically I've been fighting with this script for 2 weeks time and gotten almost there. User can get on the train but can't get off. I tried doing this: I introduce a public variable on the top of the script after line 4: trainCurrentStation = "Berezino Start"; publicVariable "trainCurrentStation"; Then, on top, under line 19 I added all station names where the train stops (check _stops variable - it holds all rail names which should ) _stopNames = ["Berezino Station", "Berezino", "Nizhnoye", "Solnichiy", "Solnichiy Factory", "Solnichiy Factory 2", "Kamyshovo", "Skalisty", "Elektrozavodsk", "Prigorodki", "Chernogorsk", "Balota", "Komarovo", "Kamenka"]; So then, since the variables are not too descriptive, I figured I can add this piece of code to line 142 - to execute that code every train stop if (_i in _stops) then { [_train] spawn _horn; _currentStop = _stopNames select _b; trainCurrentStation = _currentStop; publicVariable "trainCurrentStation"; }; And then, I added a script for the clients to init.sqf which, I assumed, would listen to the changes in the trainCurrentStation variable and then react to it waitUntil { !(isNil "trainCurrentStation") }; "trainCurrentStation" addPublicVariableEventHandler { _station = _this select 1; _isOnTrain = player getVariable "isOnTrain"; if (!isNil "_isOnTrain") then { _hintText = format ["Thank you for choosing Cherno train services.\n Current station: %1 \n If you'd like to continue your journey, get back on the train.", _station]; titleText [_hintText, "PLAIN DOWN"]; detach player; sleep .3; player setVariable ["isOnTrain", nil, true]; player setVariable ["st_mh6_enhance_ffv_active",false]; }; }; I put into the init.sqf this way: if (!isDedicated) then { // other DayZ init scripts // init train scripts execVM "scripts\Train\clientInit.sqf"; // other DayZ init scripts } But this script does basically nothing. No script errors in the console (I'm connecting with the -showScriptErrors parameter), players are still stuck on the train forever (or unless you abort and re-join the game). The script is getting executed though! I tested that and it runs, but just does nothing for some reason. Any clue what I'm doing wrong? Is there a better way of doing all this stuff? Any clue if I can find another workaround (or just enable the action menu when the player is attached to an object?). I was thinking on attaching the player and then forcing the player to sit down in the train and then wait for the change in his stance (if he gets up, then detach from the train) but I'm not quite sure how to do that. Sorry for the long post, hoping someone can help with it.
×