-
Content Count
246 -
Joined
-
Last visited
-
Medals
Posts posted by cookies2432
-
-
-
Also, i think that this part of the code is not needed (I could be wrong)
[_itemType]
When I call the function I already have the data from the can (_target = _this select 0) and so because of that, I don't think it's needed to declare it again, however, I could be completely wrong :)
-
gives me an error missing " ; ". But yea something like that, i'm kind of new to scripting but i really want to learn it so i can actually finish my project :D
-
Well _Rice is pointing to a string ("Land_RiceBox_F"), and that is a classname, if you use "_Rice" its not a variable anymore, its just a string. Thus not pointing to anything.
Yea you are correct, my bad :D. Also, I tried to make them equal to the config paths but it proved, unsucessfull, still having the undefined variable error.
-
Thanks! :D I got another issue but I think I can solve it on my own, not sure.it's that it now says "undefined variable" on them. I think I know how to fix it, not sure.
-
Yea you are using "" (quotes), you are trying to point towards these,
_Rice = "Land_RiceBox_F"; _Beans = "Land_BakedBeans_F"; _Water = "Land_BottlePlastic_V2_F"; _Soda = "Land_Can_V1_F";
So remove the "", because if you have "around something" its a string.
I thought I had to use a string format since they are classnames :/
-
You are missing a then,
if ({_x == _itemType} forEach ["_Rice","_Beans","_Water","_Soda"]) then {
Thank you! Now it's giving some weird "reserved variable in expression" error message for some reason, it's about this I think:
if ({_x == _itemType} forEach ["_Rice","_Beans","_Water","_Soda"]
Any idea why? As I understand that's correct usage of forEach but i'm proabably wrong, still learning :). Could it be because i mention the variables twice (private) and in the if statement?
-
That's tunnel vision.
Also about your function, I know its early stage, but I suggest using functions via CfgFunctions.
This way you don't have to run the code to create your function every time you pick something up.
Thanks! :D, How would I use it tho?
-
The script is still not working tho, it says that line 13 (the one with "if" and "forEach" is missing a " ; ".
-
You are calling fnc_addItem before you define it.
_itemType = (_this select 0); fnc_addItem = { private ["_Rice","_Beans","_Water","_Soda"]; _Rice = "Land_RiceBox_F"; _Beans = "Land_BakedBeans_F"; _Water = "Land_BottlePlastic_V2_F"; _Soda = "Land_Can_V1_F"; if ({_x == _itemType} forEach ["_Rice","_Beans","_Water","_Soda"]) { hint format ["Hello"]; } else { hint format ["RIP"]; }; deleteVehicle _itemType; hint format ["Rice %1 Beans %2 Water %3 Soda %4",_Rice,_Beans,_Water,_Soda]; }; call fnc_addItem;
Should do it.
Oh well, I'm happy it's that simple lol. Sometimes when you focus on one thing you find it hard to spot other things. Thanks a lot! :D
-
Hello, i'm in the need of help with a script that's supposed to "pick up" an item from the ground (soda for example) and then it will take its classname, check it if it matches any of the variables in an array and if it does it will add a value to that variable. After all of that it will find the pic of that item in the config file (haven't begun with this part yet). After this it will add the picture to a rsclistBox on a GUI (IDC = 1500) and the name of the item (for example, can of soda or whatever it's called).I have begun working on it but i'm getting errors about my function being undefined ?This is my code:_itemType = (_this select 0); call fnc_addItem; fnc_addItem = { private ["_Rice","_Beans","_Water","_Soda"]; _Rice = "Land_RiceBox_F"; _Beans = "Land_BakedBeans_F"; _Water = "Land_BottlePlastic_V2_F"; _Soda = "Land_Can_V1_F"; if ({_x == _itemType} forEach ["_Rice","_Beans","_Water","_Soda"]) { hint format ["Hello"]; } else { hint format ["RIP"]; } deleteVehicle _itemType; hint format ["Rice %1 Beans %2 Water %3 Soda %4",_Rice,_Beans,_Water,_Soda]; };
Any help would be extremly appriciated! :)
-
Thanks for all the replies, I will listen to all of your suggestions :D
-
-
For the first 2 points, you can record a path for the ai to follow:
-
Ive changed the thread title for you to "Need help with dialogs and scripting" :)
Thank you :)
-
You may want to change the thread tile to be abit more meaningful.
What do you suggest, sorry, I really didn't know what to put
Εverybody here working on something for arma and ask for some advice and help. :)
You dont need this topic .. Just make another one with the help you really need and the Guy you looking for will come .... ;)
Welcome to Arma3 forum ! :)
Thank you! I have been here a little but not too often, thing is that i need help with a lot of different kinds of things and when I work on it, I work for only a certain period of time but hard. I just need someone who can quickly helpe me with a small issue :)
-
Hello, i'm working on something for arma 3 that i've always wanted to do but I could really use some advice or help sometimes, I cannot offer any salary, just looking for someone who shares the same interesst as me, creating content for arma 3 and learning while doing so. Thanks for reading this! :)
The work is about dialogs and scripting :)
Steam: http://steamcommunity.com/profiles/76561198103602415/
-
Thank you! I tested this as well and something weird happend, some of my frames became black and some didn't, I used "IGUIBack" as a parent on all of them but it still, flipped out.
-
Where do i put this? :/ And how do i connect it to my all of my frames?
-
I don't seem to be able to change the color of the rsc_frames :(. I'm trying to make the frames have the background color of black but it isn't working, i'm using {0.0.0.1}
-
Nvm! I got it all to work! :D
-
I'm still getting the error "gunShop_dialog resource not found" :(
-
I'm about to head out for work, so I can't test yours right now. I'll take a look when I get home but until then you could check out the tutorial I made.
https://forums.bistudio.com/topic/189494-gui-tutorial-and-simple-vehicle-selector-release/
You'll see that I do it a different way. In the dialog.hpp, I define the backgrounds, controls, and objects by their names first and then the have the controls with size, type etc after.
Check out the tut and send me a pm with any questions you have, and I'll read them later.
Thanks a lot for the video, it has all I need, I will check it out fully tomorrow (since my brain is overheated and tired atm). :D
-
Anyone? :/
Delete object without ID
in ARMA 3 - MISSION EDITING & SCRIPTING
Posted
So, it's late and my brain isn't working properly sadly. I was wondering if anyone knows how to delete an object without it having a variable name? It calls a function so i tried "deleteVehicle (_this select 0);" but arma 3 gave me hell for that so i haven't consider trying it again. I appriciate all the help I can get, and for anyone who's curious, it's food items, something of a project i'm working on, this is just a part of it :)