Jump to content
Sign in to follow this  
sebbedelius

Arma 2/ OA food

Recommended Posts

Hello,

I made a mission that I called "Hunger Games".

Can you spawn food in regular ArmA 2 or OA? I have searched for

scripts on google but the classnames only seems to work on DayZ.

I opened the DayZ singleplayer editor and spawned "foodcanpasta" and

then saved it as multiplayer mission. But you can't right click it

and choose eat. I also want the food to be in for example an ammo

crate, so the players have to find the food to survive.

I have a script that makes your character take damage when the hunger

is over 10. That's why I need food.

Eat:

if (not((_this select 1)==player)) exitwith {}; //this checks if the

player has activated this actionentry. Otherwise a player will be

able to command the AI to eat for him^^

hunger=hunger-5;if (hunger<0) then {hunger=0;};

Hunger:

player hasweapon "blah";player hasmagazine "blah";if(not((_this select

0)==player) exitwith {}; //this is for checking if unit is player,

this makes the loop local on a client

hunger=0;

while {alive player} do {

hunger=hunger+1;

if (hunger>10) then {player setdammage (getdammage player) +

hunger/100;};sleep 10;};

Is there a better script? I also want to see how much hunger you have left, like a hud.

I hope someone can help me :)

Edited by sebbedelius

Share this post


Link to post
Share on other sites

No, you would use wild animals, addactions and variables to simulate scavenging and/or food consumption. Or find/make an addon pertaining to food. ie; the dayz mod has an actual model for food?? (or maybe not idk)

Share this post


Link to post
Share on other sites

DayZ includes a huge amount of custom-made icons and actual 3D models which are not available for ArmA2 at all. You'll have to make your own 3D Model and Icon for food. A very simple way to display your hunger is simply pass on the hunger variable to a hint with this way:

hint format ["Hunger:%1", hunger];

I have no idea on how to create a HUD like DayZ has, but this requires custom addons.

//Edit

Ninja'd by Riouken, yeah, forgot about the RPG mod. It has alot, but not everything (last I heard was it misses some crucial RPG items, but I'm not very up-to-date on that stuff)

Share this post


Link to post
Share on other sites

I have been looking for a drop in script to handle food and water for mission makers. Haven't found anything yet, but I have seen missions that have it, wasteland survival for example has food and water and is purely mission based requiring no addons. Hopefully this can be extracted somehow and reused elsewhere.

Share this post


Link to post
Share on other sites
Yea, there are no food items in regular arma OA but here is a simple RPG item mod.

http://forums.bistudio.com/showthread.php?142673-Arma-Role-Playing-Items-ARP-Mod

I installed it and i got it working!

But, you can't eat the snicker for example. Can you add something to script so that if you click on the snicker the hunger will go down?

Share this post


Link to post
Share on other sites
I installed it and i got it working!

But, you can't eat the snicker for example. Can you add something to script so that if you click on the snicker the hunger will go down?

you could add more conditions to your script to see if item is in inventory then have an addaction to eatfood if it is, then delete item from in script.

Share this post


Link to post
Share on other sites

There is no description. Should I put it in my mission folder and then in the init line of the character type dumvar = [this] execVM "check.sqf"; dumvar = [this] execVM "eat.sqf"; dumvar = [this] execVM "init.sqf"; ?

edit:It worked, I'm gonna see if I can edit the script now so that he eats the snicker instead :)

edit 2: That worked too :D, the only problem now is that my character deosn't take damage after a while. I tried both with and without the first eat and hunger scripts.

Edited by sebbedelius

Share this post


Link to post
Share on other sites
Here's a very basic example which you can build on. In Your action menu you have a action to eat.... well eat your map :p

http://www.filedropper.com/eatutes

Thanks for this. Do you know if it's possible to have scripted items, say for example to just add the snickers image and item to your mission without addons, or is it only possible via pbo addon? Basically the aim is to have a purely scripted version so it can be dropped into any mission. If it's only possible via addon then I guess it will have to be done without the graphics and items and just via actions.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×