Nebulazer
Member-
Content Count
38 -
Joined
-
Last visited
-
Medals
Everything posted by Nebulazer
-
Need help, this is giving me the points instead of the player who killed.
Nebulazer replied to Nebulazer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
thank you for this, I will study this and learn from it. -
Need help, this is giving me the points instead of the player who killed.
Nebulazer posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I am trying to make it so players get money and xp when they get kills on AI and enemy players but this is for some reason it i giving me the money and xp when I run the mission on my computer. I don't have it running on a dedicated server yet but the description of !ifDedicated made it seem like it would work anyway. //Get Cash and xp when you kill if (!isDedicated)then{ _unit=(_this select 0); _unit addEventHandler ["killed", { _unit= (_this select 0); _killer= (_this select 1); if (isPlayer _killer)then{ p_exp=p_exp+100; cash=cash+100; execVM "Levels.sqf"; hint "$+100 and +100XP"; (uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: $%1",cash]; _unit removeAllEventHandlers "killed"; }; }]; }; -
Need help, this is giving me the points instead of the player who killed.
Nebulazer replied to Nebulazer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I think this is what I am missing. I looked into initPlayerLocal.sqf, and it looks like that runs on the clients only, so is that where I am going to set the variables? and also should I take the set variables out of the normal Init? -
Need help, this is giving me the points instead of the player who killed.
Nebulazer replied to Nebulazer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I tested this with another player joining my server, and when he kills the AI it still gives me(host) the money and XP even though its with set/getvariable. I thought doing all of this was to make each individual player have their own money gain. Do I need to run a dedicated server for this to work? Is there no way to have a money system when you just host on your computer? -
Need help, this is giving me the points instead of the player who killed.
Nebulazer replied to Nebulazer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I got it to work on the AI, now i need to see if it works for players who join my game, and I need to make sure the player event handler works as well. this addEventHandler ["Killed", {Null = [_this select 0, _this select 1] execVM "AI_Killed.sqf";}]; AI_Killed.sqf fnc_handleKill_AI = { _killersCash = killer getVariable "cash"; _xp = killer getVariable "p_exp"; _newXP = _xp + 100; _cashForKill = 100; _newCash = _killersCash + _cashForKill; killer setVariable ["cash", _newCash, true]; killer setVariable ["p_exp", _newXP, true]; (uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: $%1",_newCash]; execVM "Levels.sqf"; hint "+$100 and +100XP"; }; killedPlayer = _this select 0; killer = _this select 1; killerSide = side killer; killedPlayerSide = playerSide; [] spawn fnc_handleKill_AI; EDIT: If i wanted to spawn these AI with Spunfin's AI script, how would I have to set this up in the custom init? It says I cant use any conditions like the _this select 0, _this select 1. So I thought it would work like this but it does not. nul = [this, 2, true, 2, 50, 1, 0.35, nil, "this addEventHandler ['Killed', {execVM 'AI_Killed.sqf';}];", 1] execVM "LV\fillHouse.sqf"; -
Need help, this is giving me the points instead of the player who killed.
Nebulazer replied to Nebulazer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I think that this part is thinking that the independant side AI that are spawned are friendly and it is running fnc_handleFriendlyKill. does ! && ! mean if neither? _suicide = false; _friendlyKill = false; killedPlayer = _this select 0; killer = _this select 1; killerSide = side killer; killedPlayerSide = playerSide; if (killedPlayer == killer) exitWith {}; if (killedPlayerSide == killerSide) then {_friendlyKill = true}; if (_friendlyKill) then { [] spawn fnc_handleFriendlyKill; }; if (_suicide) then {}; if (!_friendlyKill && !_suicide) then { [] spawn fnc_handleKill;}; -
Need help, this is giving me the points instead of the player who killed.
Nebulazer replied to Nebulazer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I can see if the variables change or not on my UI as its already set to do that, it shows me when i run moneylevels.sqf that i have 500 dollars but if i run it again in Debug it keeps me at 500 dollars, I think that is the problem right there. Is there something I am not understanding about local variables and setvariable? _cash = player getVariable "playerCash"; _cash=_cash+500; ("DollarTitle_layer" call BIS_fnc_rscLayer) cutRsc ["DollarTitle","PLAIN"]; ("LevelTitle_layer" call BIS_fnc_rscLayer) cutRsc ["LevelTitle","PLAIN"]; (uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: $%1",_cash]; that keeps at 500 dollars no matter how many times I run it, but why if _cash=_cash+500; every time you run it? I think if that can be explained to me, it might solve my problem. Edit: After messing around a bit with it i found the answer. It needs a new local variable to replace the old amount as so _cash = player getVariable "playerCash"; _newCash=_cash+500; player setVariable ["playerCash", _newCash, true]; I have it so the variable is changing now when i kill AI but it is still not doing it right. The AI are independent but set to be hostile to both red and blue but when i Kill an AI it gives me -50 dollars, if I left the script the way that you gave it to me it would make you have -50 dollars at the end instead of losing -50, but really I want it so you gain +100 when you kill an independent AI and 200 when you kill a player on the opposite team. fnc_handleKill = { _killersCash = killer getVariable "playerCash"; _killersKills = killer getVariable "playerKills"; _newKillersKills = _killersKills + 1; _cashForKill = 100; _newCash = _killersCash + _cashForKill; killer setVariable ["playerCash", _newCash, true]; killer setVariable ["playerKills", _newKillersKills, true]; (uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: $%1",_newCash]; }; fnc_handleFriendlyKill = { _killersCash = killer getVariable "playerCash"; _cashForKill = -50; _newCash = _killersCash + _cashForKill; if (_killersCash <= 0) then { _cashForKill = 0; }; killer setVariable ["playerCash", _newCash, true]; (uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: $%1",_newCash]; }; _suicide = false; _friendlyKill = false; killedPlayer = _this select 0; killer = _this select 1; killerSide = side killer; killedPlayerSide = playerSide; if (killedPlayer == killer) exitWith {}; if (killedPlayerSide == killerSide) then {_friendlyKill = true}; if (_friendlyKill) then { [] spawn fnc_handleFriendlyKill; }; if (_suicide) then {}; if (!_friendlyKill && !_suicide) then { [] spawn fnc_handleKill;}; I tried running a different script on the AI with the killed event handler and changing it to AI_killed.sqf but it still gives me the same results even though the part about -50 is commented out, so that means it is still using the eventhandler of the player instead of the one on the AI? fnc_handleKill = { _killersCash = killer getVariable "playerCash"; _killersKills = killer getVariable "playerKills"; _newKillersKills = _killersKills + 1; _cashForKill = 100; _newCash = _killersCash + _cashForKill; killer setVariable ["playerCash", _newCash, true]; killer setVariable ["playerKills", _newKillersKills, true]; (uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: $%1",_newCash]; }; //fnc_handleFriendlyKill = { // _killersCash = killer getVariable "playerCash"; // _cashForKill = -50; // _newCash = _killersCash + _cashForKill; // if (_killersCash <= 0) then { _cashForKill = 0; }; // killer setVariable ["playerCash", _newCash, true]; // (uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: $%1",_newCash]; //}; _suicide = false; _friendlyKill = false; killedPlayer = _this select 0; killer = _this select 1; killerSide = side killer; killedPlayerSide = playerSide; if (killedPlayer == killer) exitWith {}; if (killedPlayerSide == killerSide) then {_friendlyKill = true}; if (_friendlyKill) then { [] spawn fnc_handleFriendlyKill; }; if (_suicide) then {}; if (!_friendlyKill && !_suicide) then { [] spawn fnc_handleKill;}; -
Need help, this is giving me the points instead of the player who killed.
Nebulazer replied to Nebulazer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
There are no script errors now, but my UI in the bottom right just shows Level: any Money : $any no matter how much money i have. It does not seem to be finding the global variables that are being set in the init. Here is the whole mission on Github, it is still very much WIP obviously and there are some old files sitting in the root that are not being used any more, i have to delete some of them, but maybe you will see what is causing me problems in the UI https://github.com/Nebulazer/CWCKunduz EDIT: I think i figured it out, it is just going to take a lot of rewriting scripts, thank you for the help. This is my moneyLevels.sqf now to display the initial UI for the money //cash and level display on GUI _cash = player getVariable "cash"; _cash=_cash+500; ("DollarTitle_layer" call BIS_fnc_rscLayer) cutRsc ["DollarTitle","PLAIN"]; ("LevelTitle_layer" call BIS_fnc_rscLayer) cutRsc ["LevelTitle","PLAIN"]; (uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: $%1",_cash]; //(uiNameSpace getVariable "myUI_LevelTitle") ctrlSetText format ["Level: %1", (p_level) call calcLevel]; EDIT2: its still not quite working, whenever i get a kill with your script, it puts my money back to zero instead of the initial 500. I am going to take away the initial 500 once it saves with iniDB, but it still should not set me to zero. I should also note that I am testing this on AI using the line you provided above for the killed event handler. -
Need help, this is giving me the points instead of the player who killed.
Nebulazer replied to Nebulazer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I see, does that mean i need to change the playerCash to Cash and do I need to create a new variable in the init for playerKills = 0;? EDIT: I made the changes I thought i would need for my variables instead but its giving me the error "undefined variables in expression: _killerscash" fnc_handleKill = { _killersCash = killer getVariable "cash"; _killersKills = killer getVariable "playerKills"; _newKillersKills = _killersKills + 1; _cashForKill = 100; _newCash = _killersCash + _cashForKill; killer setVariable ["cash", _newCash, true]; killer setVariable ["playerKills", _newKillersKills, true]; }; fnc_handleFriendlyKill = { _killersCash = killer getVariable "cash"; _cashForKill = -50; if (_killersCash <= 0) then { _cashForKill = 0; }; killer setVariable ["cash", _cashForKill, true]; }; _suicide = false; _friendlyKill = false; killedPlayer = _this select 0; killer = _this select 1; killerSide = side killer; killedPlayerSide = playerSide; if (killedPlayer == killer) exitWith {}; if (killedPlayerSide == killerSide) then {_friendlyKill = true}; if (_friendlyKill) then { [] spawn fnc_handleFriendlyKill; }; if (_suicide) then {}; if (!_friendlyKill && !_suicide) then { [] spawn fnc_handleKill;}; This is what my init.sqf looks like, maybe something there is wrong, but it seems to work fine until the point that I kill the AI, then it gives me the script error. cash = 0; p_exp = 0; p_level = 0; playerKills = 0; player addEventHandler ["Killed", {Null = [_this select 0, _this select 1] execVM "playerKilled.sqf";}]; [] spawn SRS_fnc_init; //execVM "cashKillFunc.sqf"; //execVM "killed_killer.sqf"; //execVM "respawnGear.sqf"; execVM "moneyLevels.sqf"; execVM "Levels.sqf"; execVM "fatigue.sqf"; //execVM "cashOnKill.sqf"; //execVM "Grenadestop.sqf"; 0 = [] execVM "group_manager.sqf"; 0 = [] execVM "player_markers.sqf"; nul=[] execVM "repair.sqf"; ETG_Reinforcements = 0; -
Need help, this is giving me the points instead of the player who killed.
Nebulazer replied to Nebulazer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I see that is giving money but not experience, would I need to make a similar one for the p_exp gain?so the player addEventHandler ["killed".... goes in the init then the rest of the code just goes in playerKilled.sqf, is that correct? or does the playerKilled.sqf have to be run on the AI as well? Also, kevsno, I am running this in the Init for players killing eachother and putting this in the AI init null =[this]execVM "cashOnKill.sqf" call BIS_fnc_MP; -
What am I doing wrong wtth this XP/Level script?
Nebulazer posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I thought this would be a pretty simple thing to do to update the variable, i just learned how to do a money variable that updates on my UI that you can find here http://forums.bistudio.com/showthread.php?190980-Need-help-with-my-GUI-for-displaying-level-and-money here is a picture of how i have it looking now, all I cant get the 1 on the level to change. http://cloud-4.steamusercontent.com/ugc/45376357726208726/6F30F700C484378D2E0414557A8E251665BCB660/ So I am trying to make a script where as you get more p_exp your level will go up. I am not sure if this script is just comletely wrong or if it just not updating with the GUI. if (isPlayer) then { _xp = (p_exp * 2) //Level 1 if (_xp > 0) then { level = 1; }; //level 2 if (_xp > 1500) then { level = 2; }; //level 3 if (_xp > 3000) then { level = 3; }; //level 4 if (_xp > 6000) then { level = 4; }; //level 5 if (_xp > 12000) then { level = 5; }; //level 6 if (_xp > 24000) then { level = 6; }; }; Testing it with this script in the debug console p_exp=p_exp+1500; hint "XP +1500"; (uiNameSpace getVariable "myUI_LevelTitle") ctrlSetText format ["Level: %1",level]; -
Need help with a statement in my shop script
Nebulazer posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I am trying to add a level restriction to my shop scripts that are all activated through action menu on an object. here is an example of one. //Navid Hex _cost=5000; if (cash >= _cost) then { cash=cash-_cost; hint "You Bought A Navid Hex For $5,000"; (uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: $%1",cash]; player removeWeapon (primaryWeapon player); {player removeMagazine _x} forEach magazines player; //Add new weapons player addMagazine '150Rnd_93x64_Mag'; player addWeapon 'MMG_01_hex_F'; player addMagazines ['150Rnd_93x64_Mag', 3]; }else{ hint "Not enough money"; }; I want to add something like this so it will work in conjunction with taking the money but I am not sure how to mix them together. if level >= 15) then {.... }else{ hint "Not High Enough Level"; }; -
Need help with a statement in my shop script
Nebulazer replied to Nebulazer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thank you very much, works like a charm! -
What am I doing wrong wtth this XP/Level script?
Nebulazer replied to Nebulazer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
So, I cant get either of those examples to work, i guess i dont quite understand how functions work? I tried putting the function in the init right below my variables, but when I ran it in game it just stopped the UI from showing up for both the money and the level UI. If you want to see the whole mission and maybe you will see another problem I have in their that is stopping it from working or something I have it on a github https://github.com/Nebulazer/CWCKunduz -
What am I doing wrong wtth this XP/Level script?
Nebulazer replied to Nebulazer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
hmm, are you saying I have to put it in the init of each playable unit instead? or just execVM from the init in the mission file? -
What am I doing wrong wtth this XP/Level script?
Nebulazer replied to Nebulazer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I could kiss you! haha. Thank you so much for explaining how an "or" statement works to me. I was trying to wrap my head around that for some time. This works like a charm in game and now i should be able to save my p_exp and cash variables using iniDB to save my players data on a dedicated server. This should be scale-able up to whatever level i want to make it to correct? Is there any limitations due to performance or is it a light enough script that it should work no matter how high of a level i make it? I am using this to give players XP and Money when they kill things, and it works for me but im not sure if it works for other players. //Get Cash and xp when you kill if (!isDedicated)then{ _unit=(_this select 0); _unit addEventHandler ["killed", { _unit= (_this select 0); _killer= (_this select 1); if (isPlayer _killer)then{ p_exp=p_exp+100; cash=cash+100; execVM "Levels.sqf"; hint "$+100 and +100XP"; (uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: $%1",cash]; _unit removeAllEventHandlers "killed"; }; }]; }; Is there a way I can execute that on all AI without putting this line of code in all of their Init's? null =[this]execVM "cashOnKill.sqf" call BIS_fnc_MP; EDIT: Also I got it the UI to show at least level 10 so far, I want to make it go to level 100, maybe beyond eventually. switch (true) do { case (p_exp >= 19600): { p_level = 10; }; case (p_exp >= 11200): { p_level = 9; }; case (p_exp >= 6400): { p_level = 8; }; case (p_exp >= 3600): { p_level = 7; }; case (p_exp >= 1200): { p_level = 6; }; case (p_exp >= 2100): { p_level = 5; }; case (p_exp >= 1200): { p_level = 4; }; case (p_exp >= 700): { p_level = 3 }; case (p_exp >= 400): { p_level = 2; }; case (p_exp >= 0): { p_level = 1; }; }; (uiNameSpace getVariable "myUI_LevelTitle") ctrlSetText format ["Level: %1", p_level]; -
What am I doing wrong wtth this XP/Level script?
Nebulazer replied to Nebulazer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thank you for the pointers senshi, I was not aware of that -showscripterror command. Dreaded, that is pretty much all I have for the script, so I am going to take that as I cant just manipulate the variables to make a level script? Do I need some type of event handler? -
What am I doing wrong wtth this XP/Level script?
Nebulazer replied to Nebulazer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I have been still trying to figure this out after a few days. I have been experimenting with some scripts but have no results yet :( Here is another one I have tried. Am I on the right track at least? is there something I am missing so that it will skip the first line and read the next one or does that not matter? if (isPlayer) then { //_xp = (p_exp * 2) //Level 1 if (p_exp => 0) then { p_level = 1; (uiNameSpace getVariable "myUI_LevelTitle") ctrlSetText format ["Level: %1",level]; //level 2 if (p_exp => 1500) then { p_level = 2; (uiNameSpace getVariable "myUI_LevelTitle") ctrlSetText format ["Level: %1",level]; //level 3 if (p_exp => 3000) then { p_level = 3; (uiNameSpace getVariable "myUI_LevelTitle") ctrlSetText format ["Level: %1",level]; //level 4 if (p_exp => 6000) then { p_level = 4; (uiNameSpace getVariable "myUI_LevelTitle") ctrlSetText format ["Level: %1",level]; //level 5 if (p_exp => 12000) then { p_level = 5; (uiNameSpace getVariable "myUI_LevelTitle") ctrlSetText format ["Level: %1",level]; //level 6 if (p_exp => 24000) then { p_level = 6; (uiNameSpace getVariable "myUI_LevelTitle") ctrlSetText format ["Level: %1",level]; }; }; }; }; }: }; }; I am giving my self xp in game with this script p_exp=p_exp+1500; hint "XP +1500"; execVM "Levels.sqf"; -
Need help with my GUI for displaying level and money
Nebulazer posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I am working on a GUI for my mission that will display how much money you have and what level you are but I am running into some issues and i cant find anything on how to make the GUI display variables, I have read KK's GUI tutorials and Icemans and watched videos and read the BI wiki on cutRsc and GUI but none of them really explains how to simply put 2 variables at the bottom of your players screen. I have the UI possitioned already but i cant make the two UI that i have work simultaneously together and I am not sure what needs to be done for the text to be replaced with variables since this is in the description.ext and the syntax is a little different from sqf. Here is what I have, hopefully someone can assist me with making it do what i need it to then other people who have this same problem can reference this post for help. In the description.ext class RscTitles { class DollarTitle { idd = 1; duration = 999999; class controls { class DollarControl { idc = 101; type = 0; style = 2; x = safeZoneX + safeZoneW - 0.2 * 3 / 4; y = safeZoneY + safeZoneH - 0.1; w = 0.2; h = 0.2 * 3 / 4; font = "EtelkaNarrowMediumPro"; sizeEX = 0.03; colorBackground[] = {0,0,0,0}; colorText[] = {0,0,1,1}; text = "$$$$"; }; }; }; class LevelTitle { idd = 2; duration = 999999; class controls { class LevelControl { idc = 102; type = 0; style = 2; x = safeZoneX + safeZoneW - 0.4 * 3 / 4; y = safeZoneY + safeZoneH - 0.1; w = 0.2; h = 0.2 * 3 / 4; font = "EtelkaNarrowMediumPro"; sizeEX = 0.03; colorBackground[] = {0,0,0,0}; colorText[] = {0,0,1,1}; text = "LVL"; }; }; }; }; in the init.sqf cutRsc ["DollarTitle","PLAIN"]; cutRsc ["LevelTitle","PLAIN"]; -
Need help with my GUI for displaying level and money
Nebulazer replied to Nebulazer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
WOW! I can't believe that was it the whole time, i was having dreams about how to fix this, haha. Thank you so much to both of you for your help on this, and KK thank you for the awesome tutorials that you put out there so everyone can learn about how to do these things. Heres some screenshots of it working http://cloud-4.steamusercontent.com/ugc/45376357725037082/6B0D6EACAD1D592B17F998C112CBCFC92231A5E7/ and buying a gun http://cloud-4.steamusercontent.com/ugc/45376357725037576/5FAEC02DC9F0E7BA8C76F83D6D36C7F802F042F2/ Also I want to share what my shop and cashOnKill scripts looks like now that it works This is run through submenus in the actionmenu from a box currently, might try to find a different object to put it on, maybe an AI. //SPMG sand _cost=4500; if (cash >= _cost) then { cash=cash-_cost; hint "$4,500 Taken for SPMG Sand"; (uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: %1",cash]; //Remove weapons player removeWeapon (primaryWeapon player); {player removeMagazine _x} forEach magazines player; //Add new weapons player addMagazine '130Rnd_338_Mag'; player addWeapon 'MMG_02_sand_F'; player addMagazines ['130Rnd_338_Mag', 3]; }else{ hint "Not enough money"; }; this is run from execVM in the init //Get Cash when you kill if (!isDedicated)then{ _unit=(_this select 0); _unit addEventHandler ["killed", { _unit= (_this select 0); _killer= (_this select 1); if (player == _killer)then{ cash=cash+100; hint "$+100"; (uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: %1",cash]; _unit removeAllEventHandlers "killed"; }; }]; }; Use this in debug for testing the shop if you dont have AI or players to kill cash=cash+9000; hint "$+9,000"; (uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: %1",cash]; -
Need help with my GUI for displaying level and money
Nebulazer replied to Nebulazer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thanks, so this should work for all players and headless client then right? It still works for me except it still does not show the correct amount of money in the GUI, i have not tested it with another player joining my game, all my clanmates have been playing GTA. if (!isDedicated)then{ _unit=(_this select 0); _unit addEventHandler ["killed", { _unit= (_this select 0); _killer= (_this select 1); if (isPlayer _killer)then{ cash=cash+100; hint "$+100"; (uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: 1%",cash]; _unit removeAllEventHandlers "killed"; }; }]; }; I am going to be putting this on a dedicated server very soon (maybe today or tomorrow) that i will have access to through a remote desktop program, so I want to make sure this is all set up to be able to work with that as well. still, no matter where or when i run (uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: 1%",cash]; it always returns a value of 1, but the cash=0 so why does it show 1? Also, is there a way to execute the cashOnKill.sqf on the ai without having to put null =[this]execVM "cashOnKill.sqf"; on all of them? EDIT: I have been trying a bunch of things but i still cant get it to change from a 1 all though the money script itself is still working and i can use the shop just not show the display on the UI correctly. Do i need to use onRscLoad? I am not sure if i need to use an eventhandler in the script or not and how it should exactly be formatted. I have been reading a ton of stuff and trying it with a ton of stuff from tutorials but nothing seems to work. i am testing it buy running it from the debug with execVM then using cash=cash+10000000; hint "$+1000000"; onRscLoad = { (uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: 1%",cash]; }; ("DollarTitle_layer" call BIS_fnc_rscLayer) cutRsc ["DollarTitle","PLAIN"]; I dont know much about how exactly everything should be formatted though. -
Need help with my GUI for displaying level and money
Nebulazer replied to Nebulazer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
thank you, that worked for displaying it correctly at the bottom right, but now i have a new problem with that. I cant seem to get my money system to work the way it was working before for some reason. I had it working where you could kill an enemy and it would tell you in the hint "+$100" but now it wont even give me the hint for some reason. I moved the global variable for cash to another script but that should not matter, right? I tried putting back in that script and it will work but it will not tick the numbers on the bottom right as they seem to be stuck at '1'. http://cloud-4.steamusercontent.com/ugc/45376357718345624/812530357E3E6A417C89CFE6E28E9751C135C960/ Here are my scripts currently. moneyLevels.sqf cash=0; level=0; ("DollarTitle_layer" call BIS_fnc_rscLayer) cutRsc ["DollarTitle","PLAIN"]; ("LevelTitle_layer" call BIS_fnc_rscLayer) cutRsc ["LevelTitle","PLAIN"]; (uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: 1%",cash]; (uiNameSpace getVariable "myUI_LevelTitle") ctrlSetText format ["Level: 1%",level]; cashOnKills.sqf if (isServer)then{ _unit=(_this select 0); _unit addEventHandler ["killed", { _unit= (_this select 0); _killer= (_this select 1); if (isPlayer _killer)then{ cash=cash+100; hint "+$100"; _unit removeAllEventHandlers "killed"; }; }]; }; navidHex.sqf //Navid Hex //Remove weapons _cost=100; if (cash >= _cost) then { cash=cash-_cost; hint "$100 Taken"; player removeWeapon (primaryWeapon player); {player removeMagazine _x} forEach magazines player; //Add new weapons player addMagazine '150Rnd_93x64_Mag'; player addWeapon 'MMG_01_hex_F'; player addMagazines ['150Rnd_93x64_Mag', 3]; }else{ hint "Not enough money"; }; The description.ext is the one that you provided me with above. EDIT: I have the UI working with the money script now but the UI for the money in the bottom right still does not follow the variable for some reason, it just stays at 1. Fixed cashOnKill.sqf //cash=0; if (isServer)then{ _unit=(_this select 0); _unit addEventHandler ["killed", { _unit= (_this select 0); _killer= (_this select 1); if (isPlayer _killer)then{ cash=cash+100; hint "$+100"; _unit removeAllEventHandlers "killed"; }; }]; }; -
Need help with my GUI for displaying level and money
Nebulazer replied to Nebulazer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Wow, thanks for the great responses from both of you, that definitely fixed the problem of the lvl UI replacing the the money UI and that explains a lot with the onLoad line. So it works if i leave the "Lorem ipsum" in there or any other text but whenever i try to make it a variable the same way you would a hint, i get nothing back. I have tried these to no avail. Cash is my money variable and level is my level variable. uiNameSpace getVariable "myUI_DollarTitle" ctrlSetText("Money: %1.",cash); uiNameSpace getVariable "myUI_LevelTitle" ctrlSetText("Level: %1",level); uiNameSpace getVariable "myUI_DollarTitle" ctrlSetText["Money: %1.",cash]; uiNameSpace getVariable "myUI_LevelTitle" ctrlSetText["Level: %1",level]; uiNameSpace getVariable "myUI_DollarTitle" ctrlSetText "Money: %1.",cash; uiNameSpace getVariable "myUI_LevelTitle" ctrlSetText "Level: %1",level; The last is the closest to working i suppose. It does return Level: %1 and Money: %1 at the bottom right of my screen, but it does not display the variable. the other 2 throw back nothing at all. I have tried some others too but these are the ones i figured should work since they look like they make sense. Screenshot of it kind of working http://steamcommunity.com/sharedfiles/filedetails/?id=426817356 -
Need help with variables for condensing my working loadout box script
Nebulazer replied to Nebulazer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Ok, i think i see. I will mess with this a bit and see if i can get it to work like that. I am currently messing with a money script on this as well to make it so you earn money when you get kills and can spend it on the gear. I have it working but i need to get a dedicated server so i can use IniDB and save the money on players. I think I am going to rent a dedicated this weekend, any suggestions? -
Need help with variables for condensing my working loadout box script
Nebulazer posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I am working on a script for changing loadouts using submenus with the scroll wheel. I have it working when called off the the box that I named 'menuBlu' with this script this AddAction ["<t color=""#B40404"">" +"Select Gear", "Classes\menuBlu.sqf"] call BIS_fnc_MP; There are a lot of different file that i had to use to make the submenus as I am still learning about coding, but hopefully someone here can give me some tips to head in the right direction with this. I need to be able to recreate it for the opposite side, but right now it looks like i will have to copy every single file and change paths and 'menuBlu' to 'menuRed' for opfor's box. I tried doing something like this _myMenu = menuBlu; _myMenu = 1; // // removeAllactions player; player AddAction ["<t color=""#0000FF"">" +"Machine Guns", "Classes\MachineGuns\MG_menu.sqf", "", 0, false, true, "", 'player distance (getPosATL _myMenu) < 5']; player AddAction ["<t color=""#298A08"">" +"DMR", "Classes\DMR\DMR_menu.sqf", "", 0, false, true, "", 'player distance (getPosATL _myMenu) < 5']; player AddAction ["<t color=""#088A85"">" +"Pistols", "Classes\Pistols\pistolMenu.sqf", "", 0, false, true, "", 'player distance (getPosATL _myMenu) < 5']; player AddAction ["<t color=""#DF7401"">" +"Attachments", "Classes\Attachments\ATT_menu.sqf", "", 0, false, true, "", 'player distance (getPosATL _myMenu) < 5']; player AddAction ["<t color=""#A9D0F5"">" +"Extras", "Classes\Extras\extrasMenu.sqf", "", 0, false, true, "", 'player distance (getPosATL _myMenu) < 5']; But it did not work the same as when I have it set up with just 'menuBlu'. I am very new to variables though, so i think i am doing that completely wrong. Here is the Github for the script, feel free to have a look at the rest of the mission while you are there if you like. I plan on giving full credit to any other scripts creaters if i end up running a dedicated server with this mission. I also plan on using a database and level system, but the database stuff is a bit more advanced than what i can currently do.