Jump to content
Sign in to follow this  
hridaysabz

Global Hint

Recommended Posts

Hey guys I was wondering why my hint doesn't execute? Everything on that trigger activates except this hint. I'm on a multiplayer server and i'm a complete noob at scripting so if anyone would care to help it would be greatly appreciated!

Share this post


Link to post
Share on other sites

On Act:

hint parseText "<t color='#00a693'>We have located a mortar position around your position. It has been marked on the map.</t> <img image='mortar.png'/><br/> <t color='#da9100'>Destroy it before they rain hell on you. Beware, they will be defended heavily.";

Condition: Opfor, Not present, Once

Share this post


Link to post
Share on other sites

Try changing your image to a .paa or jpg and see if that works.

/*Update*\

Try it this way.

_textOne = "<t color='#00a693'>We have located a mortar position around your position. It has been marked on the map.</t>" ;
_textTwo = "<img image='mortar.jpg'/>";
_textThree = "<br/> <t color='#da9100'>Destroy it before they rain hell on you. Beware, they will be defended heavily.</t>"; 
hint parseText (_textOne + _textTwo + _textThree);

Also you didn't close out your last text.

Edited by Johnson11B2P
update

Share this post


Link to post
Share on other sites

Well first change the file type of the image to a .jpg or and .paa. Then close that last text.

If that doesn't work you could try it this way. Just remove the underscore from the variable names.

Share this post


Link to post
Share on other sites

I had a similar problem like this where the hint did not show on a dedicated server... This may help you. Good luck!

Dirty Haz

Share this post


Link to post
Share on other sites

If he needs to spawn the hint globally then put all the code here

[[{"Your Code"}],"BIS_fnc_Spawn",true] call BIS_fnc_MP;

Share this post


Link to post
Share on other sites
If he needs to spawn the hint globally then put all the code here
[[{"Your Code"}],"BIS_fnc_Spawn",true] call BIS_fnc_MP;

When a trigger is activated it's onAct field is executed on all clients and server. There's no need to use fnc_mp. Not only that, sending code this way is bad practice.

Share this post


Link to post
Share on other sites

Triggers are created / executed locally. But, what he's saying is that in most cases, the condition will return true for all clients, at the same time in any case, thus hinting to everyone. Appearing to have a global effect.. Such as the OP's condition "opfor not present" - will return true for all clients triggers at once. Thus firing all of them at the same time.

So all's you should need in that trigger is a simple hint "message". Also, the "bad practice" he was talking about... I think he was referring to the code space. IE;Writing your whole code in the code space, rather than calling a function from there that contains said code. I could be waaaaaay wrong though. :p

Edited by Iceman77

Share this post


Link to post
Share on other sites

Hey guys, I'm firing it from a trigger using EXECVM(Script) but it doesn't show up. Ideas?

Share this post


Link to post
Share on other sites

Please post your exact trigger and your exact script. That way, we (together as a loving community) can make some head way on your problem. Also, please use code tags or php tags to post the code. :)

Edited by Iceman77

Share this post


Link to post
Share on other sites

Trigger Parameters:

Opfor

Not Present

Once

Activation:

_nul = [] execVM "briefing.sqf";'

Briefing.sqf:

_textOne = "<t color='#00a693'>We have located a mortar position around your position. It has been marked on the map.</t>" ;
_textTwo = "Remember the ROE and Hit hard.";
_textThree = "<br/> <t color='#da9100'>Destroy it before they rain hell on you. Beware, they will be defended heavily.</t>"; 
hint parseText (_textOne + _textTwo + _textThree);

Share this post


Link to post
Share on other sites

I tested what you posted and it worked fine. Only thing I can think of, is your condition box. Make sure the condition is this

note: assuming the ' after the semicolon is a typo

Share this post


Link to post
Share on other sites

==========Edit============

Works now,

I feel so dumb.

Huge thanks to everyone here for helping me out!

Share this post


Link to post
Share on other sites

hint is a client side function, to display your hint on each client you can use BIS_fnc_MP:

if !(isServer) exitWith {}; // run this script on server side only
["your message", "BIS_fnc_hint", true] spawn BIS_fnc_MP;

Edited by Zigomarvin

Share this post


Link to post
Share on other sites
hint is a client side function, to display your hint on each client you can use BIS_fnc_MP:

He doesn't need to use bis_fnc_mp, as he's using a trigger. Triggers are created and executed locally for each client and since most times (like his opfor no present trigger) the condition will return true for each client at the same time in any case, thus hinting for each client (giving the illusion of a global effect). No broadcasting is needed here. Only a simple hint "message";

Edited by Iceman77

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  

×