Jump to content

Sakuie

Member
  • Content Count

    10
  • Joined

  • Last visited

  • Medals

Community Reputation

1 Neutral

About Sakuie

  • Rank
    Private

Profile Information

  • Gender
    Male
  • Location
    Berlin, Berlin, Germany
  1. @Jackal326 So, I only had some time left on my schedule to work on my code.I feelvery dumb and on the wrong track. Anyways, here's the code. //this is what CAManBase looks like in config.cpp/CgVehicles class CAManBase: Man { class HitPoints { class HitHead; class HitBody; class HitHands; class HitLegs; }; class Eventhandler { init="_handle = execVM ""h_titan_useVisor.sqf"""; }; }; and //and is what it looks like in h_titan_useVisor.sqf, yes i did some renaming now again. //and yes, i didnt follow your instruction to correct the "addHeadgear" part, since it seemingly does assign the headgear automatically,even if there's one alrdy assigned to a unit while (alive player) do { if (headgear player isEqualTo "H_Titan_Helmet_O") exitWith {player addAction ["Close Visor", {player addHeadgear "H_Titan_Helmet"}]}; if (headgear player isEqualTo "H_Titan_Helmet") exitWith {player addAction ["Open Visor", {player addHeadgear "H_Titan_Helmet_O"}]}; }; hint "Success!"; I have to say: I feel like the two if-statements look fishy, but I don't have a way to avoid those just yet, especially b/c my in-depth understanding of SQF still need's to grow. Greets, -Sakuie
  2. @Jackal326 Thank you, later tonight I will go ahead and try your suggestion out. Will report on it, when information has been gathered. ^^ Greets, -Sakuie
  3. Hello everyone, it's me again, asking some silly questions. Well, let's jump right ahead, shall we? For some hours I've been researching on how to get scripts to start on themselves upon initialization. Nothing seem's to suit my problem well enough. To be clear: the scripts are stored in this folder structure: -@devAddon_sak - -Addons - - -dev - - - -AnoGearAddition_scripts - - - - -exec.sqf - - - - -a_h_useVisor.sqf Basically I tried running 2 if-statements, that'd determine, whether action1 or 2 is to be used. Initially it looked like this: (before anyone asks: since I started coding in gLua, I started to love if-statements for some reason...) // a_h_useVisor \\ if (headgear player isEqualTo "anoHelmet_opened") exitWith {player addAction ["Close Visor", {player addHeadgear "anoHelmet_closed"}]}; if (headgear player isEqualTo "anoHelmet_closed") exitWith {player addAction ["Open Visor", {player addHeadgear "anoHelmet_opened"}]}; After a bit testing I came to the conclusion:"Well, maybe we need something to trigger it, how about that?" So I created another script file, in which I wrote: // exec \\ _handle = [] execVM "\dev\AnoGearAddition_scripts\a_h_useVisor.sqf"; //note, that \dev\ is the .pbo file in which everything is stored, obviously Also didn't seem to work. So I kinda reviewed the code a bit and that happened: // a_h_useVisor \\ while (alive player) do { if (headgear player isEqualTo "anoHelmet_opened") exitWith {player addAction ["Close Visor", {player addHeadgear "anoHelmet_closed"}]}; if (headgear player isEqualTo "anoHelmet_closed") exitWith {player addAction ["Open Visor", {player addHeadgear "anoHelmet_opened"}]}; }; and // exec \\ //_handle = [] execVM "\dev\SpectergearAddition_scripts\a_h_useVisor.sqf"; _triggerExec = createTrigger ["EmptyDetector", getPos player]; _triggerExec setTriggerText "Activate Script"; _triggerExec setTriggerArea [0,0,0, false]; _triggerExec setTriggerActivation ["ALPHA", "PRESENT", false]; _triggerExec setTriggerStatements ["this", "_handle = [] execVM ""\dev\AnoGearAddition_scripts\a_h_useVisor.sqf"""]; Also didn't work out (in the sense, that the given command couldn't be found. Either I looked up the wrong radio thingy, or i screwed up). Now, what I also tried, was using an EvenHandler INIT on the 2 items in the CfgWeapons section themselves, but obviously it didn't work out, b/c according to what I've read so far: the INIT EventHandler only works in CfgVehicles. I've also tried calling a_h_useVisor through my dev console in the Editor, it didn't give me an error, but it did effectively nothing. :D So there I am, not really knowing what to implement in which way. I am also "a bit" tired of looking everything up, though I still have to, I know, but some help from over here would boost me, obviously. *BTW: yes I know: it could've also been done via animation on the model itself, yet then I would need to know how to properly implement the code for triggering the animation, but as of right now there's none given, and I got 2 models, one w/ the closed and one w/ opened visor.* I can bet my soul for sure I did a silly mistake, so feel free to give me the teach-slap/spank. :wub: Much greets, -Sakuie /* Edits: first: grammatical correction of the title second: grammatical correction of a phrase */
  4. @kylania Yeah, gonna take a closer look on that one! :) ^_^
  5. @kylania Yeah I was clever enough to see, that the call had to be used. > :D Well, works like butter now. Thank's lad. Have a lot to learn in SQF :D I guess I will work on my written crippled thing anyways, just so to learn, obviously. Once again: thank ya, lad! ^^
  6. @Mattxyo @zooloo75 Well yeah, I just realised that I did miss out on parameters. Thanks for taking a look into it. Also thought about those bracket's, but the change didn't do anything, as I expected. ^^ @kylania Aye, gotcha man. Imma fiddle around with only one check. Gonna reply again, when I found something out. But so far it didn't do anything, it still throws errors.
  7. Hey guys/girls, now, I am not completely new to coding and such, but I am relatively new to the SQF syntax. So I need a little assistance here. :) Anyhow, I have been looking through actions and functions in A3 and I wanted to make a unit call BIS_fnc_ambientAnim (in this special case BRIEFING) and later, when it detect's threat, the ambientAnim should terminate. I got this to work, thanks to "Pierre MGI", BUT this particular animation bothered me a little bit, because on execution the primary weapon of the unit get's removed, and that's a bummer, when the unit is a road guard. :D So, I tried some things, such as setUnitLoadout, but it won't work, so I made an if-statement, and there's the problem. Here's the code: (I execute the code via console and the command execVM "units_scripts_apk.sqf"; and I use 3DEN, just so you know) // Unit apk_rogain_bottomGuard_bunker ! \\ _apk_rogain_bottomGuard_bunker_loadout = getUnitLoadout apk_rogain_bottomGuard_bunker; //Let's get his loadout, shall we _apk_rogain_bottomGuard_bunker_weapons = weapons apk_rogain_bottomGuard_bunker; // Get his weapons sleep 0.9; //Wait virtually a second [apk_rogain_bottomGuard_bunker,"BRIEFING","ASIS"] call BIS_fnc_ambientAnim; //Let's make him have some nice animations while idle-state 0 = apk_rogain_bottomGuard_bunker spawn {waitUntil {behaviour _this == "combat"}; //Wait until he see's threat apk_rogain_bottomGuard_bunker call BIS_fnc_ambientAnim__terminate;}; //And now end the animation and get to normal mode //At this point I saw, that when this particular animation is initiated, the primary weapon will be removed from the unit, so let's fix it sleep 0.9; apk_rogain_bottomGuard_bunker setUnitLoadout _apk_rogain_bottomGuard_bunker_loadout; //Once again, wait nearly a second apk_rogain_bottomGuard_bunker setUnitLoadout _apk_rogain_bottomGuard_bunker_loadout //Reassign his original loadout if (primaryWeapon == "") or (primaryWeapon isNil) then {apk_rogain_bottomGuard_bunker addWeapon format ["%1", _apk_rogain_bottomGuard_bunker_weapons]} else {apk_rogain_bottomGuard_bunker addWeapon "arifle_MX_ACO_pointer_F"}; //Just in case the above doesn't work And here's the exact error line: |#|if (primaryWeapon == "") or (primaryWeap...' Error Missing ; My understanding is that the |#| symbolize's the approximate location where something is missing, but feel free to teach me. ^^ Greetings!
  8. @Locklear Thank you sir, gonna try it out when I find some spare time. But have one question though, before I stop harassing you: is it possible to make a macro for the CfgVehicles section, in the same way it's shown on the guide? Like this: #define UNIFORM(NAME,DN,PIC,TEX,SOLDIER,LOAD,WEIGHT) \ class ##NAME##: Uniform_Base \ { \ author = "Splendid Modder"; \ scope = 2; \ displayName = ##DN##; \ picture = "\A3\characters_f\data\ui\icon_##PIC##_ca.paa"; \ model = "\A3\Characters_F\Common\Suitpacks\suitpack_original_F.p3d"; \ hiddenSelections[] = {"camo"}; \ hiddenSelectionsTextures[] = {"\A3\Characters_F_New\BLUFOR\Data\##TEX##.paa"}; \ \ class ItemInfo: UniformItem \ { \ uniformModel = "-"; \ uniformClass = ##SOLDIER##; \ containerClass = Supply##LOAD##; \ mass = ##WEIGHT##; \ }; \ }; class cfgWeapons { class Uniform_Base; class UniformItem; UNIFORM(U_B_soldier_new,"New Uniform",u_b_soldier_new,b_soldier_new,B_soldier_new,40,40); UNIFORM(U_B_soldier_new_2,"New Uniform 2",u_b_soldier_new_2,b_soldier_new_2,B_soldier_new_2,60,60); }; I figured it could actually be possible, according to what the guide says about using and defining macros right above the shown script in the guide, but I am not sure though. Cheers, mate.
  9. I don't know, why but somehow my PrePocessor thingy error's and quit's when I define mag-macros within a conifg.cpp with a message somewhere along this line: "Invalid file name(empty filename)" or so... I quite don't get, since I did it the way it's shown in the guide... //How my define looks like in my config.cpp #define mag_3(12Rnd_mas_45acp_Mag) 12Rnd_mas_45acp_Mag, 12Rnd_mas_45acp_Mag, 12Rnd_mas_45acp_Mag #define mag_10(CUP_30Rnd_556x45_Stanag) CUP_30Rnd_556x45_Stanag, CUP_30Rnd_556x45_Stanag, CUP_30Rnd_556x45_Stanag, CUP_30Rnd_556x45_Stanag, CUP_30Rnd_556x45_Stanag, CUP_30Rnd_556x45_Stanag, CUP_30Rnd_556x45_Stanag, CUP_30Rnd_556x45_Stanag, CUP_30Rnd_556x45_Stanag, CUP_30Rnd_556x45_Stanag //After these two lines usually my CfgPatches is being defined/included. //How it is shown in the guide: #define mag_2(a) a, a #define mag_10(a) a, a, a, a, a, a, a, a, a, a
×