Jump to content
Sign in to follow this  
RS30002

Hunting task issues!

Recommended Posts

Why doesn't this work? the add action bit after the kill.

 

Also, im noob so i just wrote the Meatharvested variable as true, but in reality, i'd like the player to shoot several goats, farm them for meat and only then the quest completes.

So instead of that variable there should be some couunter "meat +1" and then some value somewhere that says when meat reaches 7 pieces  {Meatharvested == true}  fires off.

 

Ty in advance for any assistance

//[this] execVM "scripts\GoatHunting.sqf";


goatgroup = createGroup Civilian;  
goat1 = goatgroup createUnit ["Goat_random_F", [10786,12410.4,0],[],0,"NONE"];
sleep 1;
waitUntil{sleep 1;!(alive goat1)};
sleep 4;
cutText ["<t color='#01B933' size='1.7'>Villager:</t> <t color='#D3D7BD' size='1.5'>Take the meat from the goat</t>      <br/><t color='#D3D7BD' size='1.5'>***********</t>", "PLAIN DOWN", -1, true, true];

[ 
 goat1,               
 "Take the meat",              
"\a3\ui_f\data\igui\cfg\actions\take_ca.paa",  
"\a3\ui_f\data\igui\cfg\actions\take_ca.paa",
"_this distance _target < 3 AND {!(alive goat1)}",          
"_caller distance _target < 3 AND {!(alive goat1)}",         
 {},                 
 {},                 
 { Meatharvested = true },        
 {},                 
 [],                
 7,                 
 1,                
 true,                
 false                
] remoteExec ["BIS_fnc_holdActionAdd", 0, goat1];

 

Share this post


Link to post
Share on other sites

I'm picking up two invisible characters in the last line of your code. Impossible for me to say if they are being created when I copy, or if they are in your code already. 

 

These characters seem to pop up most when I copy/paste from the Biki - which makes a lot of code found on the forums suspect. Always check via a code block here, or in your editor. In a forum code block, they appear as red dots. In Notepad++, check View > Show Symbol > Show Non-Printing Characters.

 

NCbuEIZ.png

  • Like 2

Share this post


Link to post
Share on other sites
On 3/5/2024 at 2:10 AM, Harzach said:

I'm picking up two invisible characters in the last line of your code. Impossible for me to say if they are being created when I copy, or if they are in your code already. 

 

These characters seem to pop up most when I copy/paste from the Biki - which makes a lot of code found on the forums suspect. Always check via a code block here, or in your editor. In a forum code block, they appear as red dots. In Notepad++, check View > Show Symbol > Show Non-Printing Characters.

 

NCbuEIZ.png

 

 

it's something with the goat. if i put a normal civilian i get the action to take the meat.....but i need it to work on an animal lol

Share this post


Link to post
Share on other sites
On 3/9/2024 at 12:56 PM, RS30002 said:

it's something with the goat. if i put a normal civilian i get the action to take the meat.....but i need it to work on an animal lol

 

Animals are agents (simpler version of units) and cannot be the target of an action.

 

Best bet is to put the action on the player and in the condition check cursorObject is the required thing.

Share this post


Link to post
Share on other sites
4 hours ago, mrcurry said:

 

Animals are agents (simpler version of units) and cannot be the target of an action.

 

Best bet is to put the action on the player and in the condition check cursorObject is the required thing.

 

 

hmmm...that could be a perspective solution indeed.

So far i got around it by using edaly_boar which comes as a "civilian" straight in the mod and there's the action after i shoot it. It's kinda anemic tho...needs the module behavior of wandering around to make it look legit, got around it by using a search ad destroy wp on the boar with some radius and it kinda runs around for a while after spawning and then stops.

 

How can i put the waypoint in a loop? 

 

//[this] execVM "scripts\BoarHunting.sqf";


boargroup = createGroup Civilian;  
boar1 = boargroup createUnit ["Edaly_Boar", [10786,12410.4,0],[],0,"NONE"];
sleep 1;

_wpboar1 = boargroup addWaypoint [[10786,12410.4,0], 100];
_wpboar1 setWaypointType "SAD";
//_wpboar1 setWaypointLoiterRadius 100;
_wpboar1 setWaypointSpeed "LIMITED";



waitUntil{sleep 1;!(alive boar1)};
sleep 4;
cutText ["<t color='#01B933' size='1.7'>Villager:</t> <t color='#D3D7BD' size='1.5'>Take the meat from the boar.</t> <br/><t color='#D3D7BD' size='1.5'>***********</t>", "PLAIN DOWN", -1, true, true];

[ 
 boar1,               
 "Take the meat",              
"\a3\ui_f\data\igui\cfg\actions\take_ca.paa",  
"\a3\ui_f\data\igui\cfg\actions\take_ca.paa",
"_this distance _target < 3 AND {!(alive boar1)}",          
"_caller distance _target < 3 AND {!(alive boar1)}",         
 {},                 
 {},                 
 { Meatharvested = true },        
 {},                 
 [],                
 7,                 
 1,                
 true,                
 false                
] remoteExec ["BIS_fnc_holdActionAdd", 0, boar1];

 

Share this post


Link to post
Share on other sites
On 3/11/2024 at 7:29 AM, RS30002 said:

How can i put the waypoint in a loop? 

 

Give it a second waypoint, type "CYCLE." It will return to its start position then move to the SAD waypoint, ad infinitum.

 

Speaking of which, setWaypointLoiterRadius is only relevant to the "LOITER" waypoint type, which is itself only relevant to aircraft.

  • Like 1

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  

×