CreativeProduct
Member-
Content Count
26 -
Joined
-
Last visited
-
Medals
Everything posted by CreativeProduct
-
Chances in an array
CreativeProduct replied to CreativeProduct's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I would have never thought about reading the wiki! Thanks a lot! Cheers. -
Hello there! I've been working the entire day and just came up with a new idea about an hour ago. I'm having problems reight now in gettin the "correct" item. My Goal is the following: I have stetup an array, which contains weapons, Alternative version of weapons and ultimatively the chance by using this: ["SomeWeapon",["WeaponSKin1","Weaponskin2"],70] Now, the problem is the following, im creating a random number the "general" chance. If the Chance of the weapon is lower, it gets added to an array. Creating a big array with all the weapons with a >70% spawnrate. Now I want to select only the weapon with the highest chance and cant seem to get it. I feel like im pretty close but can't figure it out right now (should take a break sometime soon ;) ). Anyway, thats what I have gotten so far: _chance = 100; _array = []; _selectedWeapon = ""; _pistol = [["hgun_ACPC2_snds_F",["hgun_ACPC2_snds_F"],70],["hgun_Pistol_heavy_01_F",[""],5],["arifle_MXC_Black_F",["arifle_MX_khk_F","arifle_MX_F"],35]]; _weapon = _pistol call BIS_fnc_SelectRandom select 0; { if (_chance <= _x select 2) then {_chance = _x select 2; _array = _array + [[_x select 0,_x select 1]]; _selectedWeapon = _array select ((count _array) - 1);}; sleep 1; hint format ["%1\n%2",_array, _selectedWeapon]; } foreach _pistol; Getting the alternate versions isnt big of the porblem, im currently just stuck with selecting the weapon with the highest chance blew the "general chance". Thanks in Advance, CP~
-
Chances in an array
CreativeProduct replied to CreativeProduct's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Now, since i got it working so far, im wondering how that "weightet" system works. If we have for an example a value of 35 and a second value of lets say 1, how would the Chance be calculated? Would the 1% be 1/36? Thanks for helping me out, got a thanks from me! ~CP -
Chances in an array
CreativeProduct replied to CreativeProduct's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Oh my. Theres the command sort solving all my problems. /sigh. -
Help required for Dialogs.
CreativeProduct replied to CreativeProduct's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Alright, I got it working. Had a long break from scripting and well, the result speak for themselves. Thank you for your help! -
Hello there, I am having problems figuring this out, its probably just some dull misake by myself, but the lack of knowledge lead me to create this topic. I have used the ArmA Dialog Creator to create a dialog, so far soo good. Everything works like a charm when using CreateDialog. However, I need to call it with CutRsc (if I remember correctly) to make the displa appear but still be able to moeve and use the mouse. This is the main dialog, if "Customcontrolclasses.h" are just below. #include "CustomControlClasses.h" class IslandDialog { idd = -1; duration = 9999999; onLoad = "uiNamespace setVariable ['HUD', _this select 0];"; class Controls { class Box { type = 0; idc = 1000; x = safeZoneX + safeZoneW * 0.908125; y = safeZoneY + safeZoneH * 0.83333334; w = safeZoneW * 0.115; h = safeZoneH * 0.20777778; style = 0; text = ""; colorBackground[] = {0.2,0.2,0.2,0.7858}; colorText[] = {0.5608,0.3059,0.6549,1}; font = "PuristaMedium"; sizeEx = (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1); }; class HUNGER { type = 0; idc = 1001; x = safeZoneX + safeZoneW * 0.911875; y = safeZoneY + safeZoneH * 0.87; w = safeZoneW * 0.0375; h = safeZoneH * 0.03666667; style = 0; text = "HUNGER"; colorBackground[] = {0,0,0,0}; colorText[] = {0.7098,0.7059,0.1882,1}; font = "PuristaMedium"; sizeEx = (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1); }; class ThirstCtrl { type = 0; idc = 1002; x = safeZoneX + safeZoneW * 0.911875; y = safeZoneY + safeZoneH * 0.91; w = safeZoneW * 0.0375; h = safeZoneH * 0.03666667; style = 0; text = "THIRST"; colorBackground[] = {0,0,0,0}; colorText[] = {0.7098,0.7059,0.1882,1}; font = "PuristaMedium"; sizeEx = (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1); }; class HealthCtrl { type = 0; idc = 1003; x = safeZoneX + safeZoneW * 0.911875; y = safeZoneY + safeZoneH * 0.95; w = safeZoneW * 0.0375; h = safeZoneH * 0.03666667; style = 0; text = "HEALTH"; colorBackground[] = {0,0,0,0}; colorText[] = {0.7098,0.7059,0.1882,1}; font = "PuristaMedium"; sizeEx = (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1); }; class FPSCtrl { type = 0; idc = 1005; x = safeZoneX + safeZoneW * 0.911875; y = safeZoneY + safeZoneH * 0.83; w = safeZoneW * 0.0375; h = safeZoneH * 0.03666667; style = 0; text = "FPS"; colorBackground[] = {0,0,0,0}; colorText[] = {0.7098,0.7059,0.1882,1}; font = "PuristaMedium"; sizeEx = (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1); }; }; }; CustomControlClasses.h: #ifndef HG_CustomControlClassesh #define HG_CustomControlClassesh 1 //Create a header guard to prevent duplicate include. class RscListBox_WS { type = 5; style = 0; idc = -1; colorSelect[] = {0,0.2,0.4,1}; colorSelectBackground[] = {0,0.2,0.4,0.1}; colorText[] = {0.2,0.2,0.2,1}; colorBackground[] = {0.4,0.4,0.4,0}; font = "Bitstream"; sizeEx = 0.04; rowHeight = 0.025; maxHistoryDelay = ""; }; class RscPictureKeepAspect_WS { type = 0; style = 48+2048; idc = -1; colorBackground[] = {0,0,0,0}; colorText[] = {1,1,1,1}; font = "Bitstream"; sizeEx = 0; lineSpacing = 0; text = ""; }; class RscText_WS { type = 0; style = 0; idc = -1; colorBackground[] = {0,0,0,0}; colorText[] = {0.2,0.2,0.2,1}; font = "Bitstream"; sizeEx = 0.03; text = ""; }; class RscControlsGroup_WS { type = 15; style = 0; idc = -1; maxHistoryDelay = ""; }; class RscButton_WS { type = 1; style = 2; idc = -1; font = "Bitstream"; sizeEx = 0.03; default = false; colorText[] = {0,0,0,1}; colorDisabled[] = {0.4,0.4,0.4,1}; colorBackground[] = {1,1,1,1}; colorBackgroundDisabled[] = {0.7,0.7,0.7,0.8}; colorBackgroundActive[] = {1,0.5,0,1}; colorFocused[] = {1,0.5,0,1}; colorShadow[] = {0.72,0.36,0,0.8}; colorBorder[] = {0.72,0.36,0,0}; soundEnter[] = {"",0.1,1.0}; soundPush[] = {"",0.1,1.0}; soundClick[] = {"",0.1,1.0}; soundEscape[] = {"",0.1,1.0}; offsetX = 0.0030; offsetY = 0.0030; offsetPressedX = 0.0020; offsetPressedY = 0.0020; borderSize = 0.0; }; class RscTextMulti_WS : RscText_WS { lineSpacing = 1; style = 0+16+512; }; #endif My goal is to have the display up at any time. Thanks in advance, CP.
-
Help required for Dialogs.
CreativeProduct replied to CreativeProduct's topic in ARMA 3 - MISSION EDITING & SCRIPTING
class IslandDialog { idd = -1; c lass TER_RscDisplayTargetDebug { idd = 73042; fadeIn = 0; fadeOut = 0; duration = 1e+6; onLoad = "uiNamespace setVariable [""TER_3den_RscTargetDebug_display"",_this select 0]"; class Controls { class Box { type = 0; idc = 1000; x = safeZoneX + safeZoneW * 0.908125; y = safeZoneY + safeZoneH * 0.83333334; w = safeZoneW * 0.115; h = safeZoneH * 0.20777778; style = 0; text = ""; colorBackground[] = {0.2,0.2,0.2,0.7858}; colorText[] = {0.5608,0.3059,0.6549,1}; font = "PuristaMedium"; sizeEx = (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1); }; }; Somewhat like that? -
Make AI reveal all units
CreativeProduct replied to ZU23's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Oh, even a lot simpler than I thought. Interesting. Keep it up! Cheers, CP~ -
Make AI reveal all units
CreativeProduct replied to ZU23's topic in ARMA 3 - MISSION EDITING & SCRIPTING
If you have a set number of units, I THINK (s not tested yet, duh.) you could do the following: P.S.: It's late, so there could be some errors. Cheers, CP~ _MaxUnits = count Allunits; While {true} do { _Count = 0; if (_count < _MaxUnits) then { { _count = _count + 1; _x reveal [(allUnits select _count),1]; } forEach allUnits; }; Sleep 20; //To prevent explosions }; -
Make AI reveal all units
CreativeProduct replied to ZU23's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hey ZU23! Basically what you are doing is revealing them from therselves since _x is the same, until it hops onto the next unit. _X is triggered for allUnits. So lets take _Unit0 as an example for this. You are revealin _unit0 to _unit0. ( _Unit0 reveal [_unit0,1]; You need tochange the second _x value to prevent that from happening. Cheers, CP~ -
Needing help with setting an objects position
CreativeProduct replied to CreativeProduct's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Alright, I found a solution to my problem. It Seems as the Command GetPos got a new way to use it with a second parameter being the direction. I solved my problem by doing this: By Preseting _dir to 0. if ( (_x distance (GetMarkerPos "Zone")) > _Size) then { _dir = _dir + 3; _pos = (Getmarkerpos "Zone") Getpos [(_SizeMarker - _Speed), _dir]; _x setpos _pos; }; Thanks for the help, I really Appreciate it! Love, CP~ -
Needing help with setting an objects position
CreativeProduct posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello there! I was trying to Visualize a Marker by having objects placed at the edge of that specific marker. Using SHK_Pos its done in no time at all. Now, the problem is, that the Markers Size reduces over time and the created objects (in my case Cones) should continue to be at the edge of the marker while the marker is shrinking. The "shrinking" paprt works, but not perfectly, as the cones end up in random places at the end (Screenshot) Im not quite sure what happening, so those are my Assumptions: Objects cant be spawned outside of the world (Eg. Black area outside of the chart) SHK_Pos Is not getting the correct position My Way of setting the position of the cones isnt accurate The cones get stuck on other objects liek buildings, messing up the positions. Me, not seeing the most obvious thing This is the Code im using. _Size is the Distance. - _DummyList is the Array of the Cones created - _Speed is 5. If (_SizeMarker > _Size) then { "Zone" setMarkerColor "ColorRed"; "Zone" SetmarkerSize [(_SizeMarker - _speed),(_SizeMarker - _speed)]; { if ( (_x distance (GetMarkerPos "Zone")) > _Size) then { _x setpos [(_x modelToWorld [0,_speed,0]) select 0, (_x modelToWorld [0,_speed,0]) select 1, 0]; }; } Foreach _DummyList; [_size, _DummyList] Execvm "Server\Zones\zoneScaling.sqf"; Sleep 0.1; } else {"Zone" setMarkerColor "ColorBlue";}; I was trying the script in 50 Meters distance in which everything worked fine. The Script need to be run individually since the _Size Changes by a different script. Thanks in Advance, CP ~ -
Needing help with setting an objects position
CreativeProduct replied to CreativeProduct's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hey there! Thanks for the code, but im afraid it' not what I am looking for, but it looks pretty interesting. So, let me try to clear some things up. Hopefully, duh. I have created a marker, that marker decreases in Size (only in size, Center stay in the same place) after a while (similar to a Zone restriction). Since I cant attach those cones to the edge of the marker I need to move them Manually. SO I set them facing into the center and then doing my ModelToWorld magic trick. However, as seen in the pic, the positions are getting messed up. Either the cones arent the exact same distance to the center, or something "interrupts" the movement. Thanks again for your suggestion, CP~ -
In the need of help for my music addon
CreativeProduct posted a topic in ARMA 3 - ADDONS - CONFIGS & SCRIPTING
Hey there, CP here. I started creating my own mod which includes music for my mission. However, it looks like i set everything up correctly, but well, the RPT shows me, that the music is not found. ("Music music0 not found") Path of my Soundfile is "@console\Ambient.pbo\music\Soundtrack_0.ogg" CfgMusic in config.cpp class CfgMusic { // List of tracks (.ogg files without the .ogg extension) tracks[] = {"music0"}; class music0 { name = "music0"; // Name for mission editor sound[] = {"\Ambient\music\Soundtrack_0.ogg", db + 0, 1.0}; }; }; I am using the command "Playmusic "music0";" CfgPatches is also included. As far as I know, I dont need to include the cfgMusic in the description.ext, but I could be wrong here. -
EDIT: Just found out that there's a config and mod section, that was my bad and I'm sorry for posting it in the wrong section.
-
rRemoveaction in Framework
CreativeProduct replied to CreativeProduct's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Works like a charm! Thanks! ~Creative- 3 replies
-
- rremoveaction
- removeaction
-
(and 1 more)
Tagged with:
-
rRemoveaction in Framework
CreativeProduct posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hello there, I seem to have a little of an issues regarding the multiplayer frameweork. Long story short, I am using the multiplayer framework to add an actionand to remove it afterwards (see example below). However, removing that specific action doesn't seem to work, does anyone have an idea why? Thanks in advance! _gear = [nil , _unit, rAddAction, "Gear", "client\gear.sqf",[],-1,false] call RE; [nil, _unit, "per", rREMOVEACTION, _gear] call RE; Everything seems to work in my script, but the removeaction part. There's also stuff going on after the Removeaction part which works perfectly well.- 3 replies
-
- rremoveaction
- removeaction
-
(and 1 more)
Tagged with:
-
rRemoveaction in Framework
CreativeProduct replied to CreativeProduct's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I will try that out later, I will keep you updated. Thanks in advance! ~ Creative- 3 replies
-
- rremoveaction
- removeaction
-
(and 1 more)
Tagged with:
-
Thats correct, yes. Best regards.
-
Check if Array is in items player and remove it afterwards
CreativeProduct replied to CreativeProduct's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Works like a charm. Thank you very much. Best regards -
Check if Array is in items player and remove it afterwards
CreativeProduct posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello there. Im facing a difficult thing for my circumstances. Maybe im just to sleepy to get my mind right. However, im creating a script, which checks if any of the items in the array are in the players inventory. If that's the case, one of the items should be removed, but I just dont know how. This is what I've got sot so far: _unit = _this select 0; _foods = ["ARP_sandwich","ARP_twinkies","ARP_pineapples","ARP_soup","ARP_spaghettios","ARP_tuna","ARP_skittles","ARP_snickers","ARP_pitabread","ARP_potatobag","ARP_chili","ARP_beefjerky","ARP_dip"]; If ( {_x in _foods} foreach (items _unit) ) then { hint "Item exists, should be removed." } else {Hint "false"}; It's basically getting the _x for each item again. However, as you can propably tell, iI didnt get it to work. Thanks in advance. Best regards. -
Check if Array is in items player and remove it afterwards
CreativeProduct replied to CreativeProduct's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Well, it seems like this way it checks if those items are (Maybe all of them?) are in the inventory. After trying out a bit { if (_x in (items player)) then { hint "Worked"; } else { systemChat format ["Food - %1 found",_x];;}; } forEach _foods; i made this, to see if the condition was false - returning every item as found, obviously caused by the false condition - was made for debug reasons. Well, the purpose of the scirpt is to check if ANY item is in the inventory and then remove that item. Best regards -
Not sure if you found out, but let me give you an example: //Color makes everything better, doesnt it? _Title = "<t color='#ff0000' underline='true' size='1.5'align='center'>This is colorful.</t><br/>"; _text = "<t color='#ff0000' size='1.3' align='center'>Have fun!</t>"; Hint parsetext (_Title + _text) That's the simple version, but works nontheless. hintSilent parsetext format["<t size='1.2' font='Bitstream' align='center' color='#FFBF00'>Your name: %1</t>",(name player)]; Hopefully no typo is involved. ;) Best regards.
-
Move to exact position, set facing, make ai reverse vehicle
CreativeProduct replied to pexmo's topic in ARMA 3 - MISSION EDITING & SCRIPTING
After thinking about your problem and having a sleep I cam up with the following idea: To make the target unit face the direction the player was, you would need to save the direction of the player. You can do this by simply setting a variable with the direction the player was facing. _dir = Getdir player; //Save it on the player player setVariable ["Heading", _dir]; To get the direction again (in a different script) use this: _DirTarget = player getVariable "Heading"; _TargetUnit setdir _DirTarget; Now you would only need to get the right timing to set and get the variable, but thats up to you. ;) Best regards. -
3D sounds JIP compatibility
CreativeProduct replied to Halford.T's topic in ARMA 3 - MISSION EDITING & SCRIPTING
That one should work. [nil,_TargetUnit,"loc"+"per",rSay,[_SoundName,5,1]] call RE; Best regards.