Jump to content
Sign in to follow this  
Quack O'Neill

Using CfgSound class name as trigger condition ?

Recommended Posts

Im trying to make it so that when the player uses an addAction that a trigger goes off

 

init opfor unit op1 

this addAction ['Show Papers','op1 Say2D "paperRustle"','player addRating +10'];


Trigger Condition

paperRustle;

so every time this sound is played the trigger goes off then that same trigger do all the gave papers passed task states

Share this post


Link to post
Share on other sites

Your addAction executes code, why not set a boolean? Or better, skip the trigger and set your task states directly?

Share this post


Link to post
Share on other sites

thanks for the reply harzach but im struggling with it.

so i have an PapersPassed.sqf now with this inside it

op1 Say2D "paperRustle";
player addRating +10;
hint "papers passed";


unit init

this addAction ['Show Papers','PapersPassed.sqf','deleteVehicle papers1'];


trigger condition

!alive papers1


How do i say to my PapersPassed.sqf theres an object in world called papers1 delete that... cause that will work like when a leaflet is deleted. its not working now, i guess because the deleteVehicle papers1 is in another objects init
how do i point that at the leaflet thats under the curb ?

iv tried a few other ways for a while now but i cant figure it out even though i feel like i have the answer in the mission somewhere somehow. i cant see what it is that im missing because all of this works in someway in the mission already. 


 

Share this post


Link to post
Share on other sites

Your syntax is incorrect.

this addAction 
[
	"Show Papers",
	{
		params ["_target", "_caller", "_actionId", "_arguments"];
		_caller execVM "PapersPassed.sqf"; 
	}
];

 

PapersPassed.sqf:

params ["_caller"];

op1 Say2D "paperRustle";
_caller addRating +10;
hint "papers passed";
deleteVehicle papers1;

Share this post


Link to post
Share on other sites

its not giving me any errors but its not deleting papers1 either do i need to put something in papers1 init ?

Share this post


Link to post
Share on other sites

Works fine here, something is wrong on your end. Make sure the object "papers1" has actually been given the variable name "papers1."

 

 

Share this post


Link to post
Share on other sites

i restarted arma and iv noticed that the script must be being triggered on start because the hint pops up and the leaflet is being deleted because i moved it ontop of the road so i can see it and its not there. so the problem is all that stuff in the script is happening without using the addaction.

Share this post


Link to post
Share on other sites

That makes no sense. See my previous post.

Share this post


Link to post
Share on other sites

The whole file, not just the .sqm.

Share this post


Link to post
Share on other sites

That's not your whole mission file, but whatever.

 

What you sent works fine for me.

Share this post


Link to post
Share on other sites

you mean because i forgot to put the init.sqf in the folder ? or its not the whole project file that this part is from ? the mission folder is full of music files and voices files and images that havnt been optimised and lots of it is questionable / personal lol 

so the papers1 leaflet dosnt delete its self at the start for you? it only disappears when you use the addAction ? 

Share this post


Link to post
Share on other sites

lol i just sat there for ages cleaning out old images and stuff hahah then i decided to try and remove this deleteVehicle papers1; from the script.sqf and add it to the addaction on the unit and it works lol 🙂 I dont get why it wont work that way tho.

Thanks for all your help today Harzach. Really appreciate it.

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  

×