Jump to content
Sign in to follow this  
Mynock

Having trouble hiding a waypoint, need a plain english explanation please.

Recommended Posts

Hello, I am new to ARMA so please take it easy on me. I am doing everything I can to learn on my own and not ask questions because I know how much veterans of games hate stupid questions, but after 3 hours of trying to get this to work I need help because I do not understand what I'm doing. I have done a lot of searching, but most of it leads me to threads on various forums where people ask how to do it, someone provides them the code, and they say thanks. I need a little more explanation because of my ignorance and inability for complex thought.

I am attempting to hide a GET IN waypoint so it does not appear on the screen the entire mission while the player(s) go about his/her/their objectives. I have found the script for setWaypointVisible located at this link. My issue is I simply do not understand what I'm looking at here and how to modify it to work. If I copy and paste directly from the wiki page, I get an error when I click OK for the waypoint in the game where I'm placing the code. I have tried everything I can think of to make it work, but it returns an error every time.

[grp, 2] setWaypointVisible false;

[group player, currentWaypoint (group player)] setWaypointVisible false;

I do not understand what these mean. I understand false means it will hide it, but I do not understand what I am supposed to replace the words "grp, 2" or "group player" with. I tried with my player's name, I tried with all of the names of the units in the group, I tried changing the number, but I continue to get errors and frustration.

1) Where does this code go? I have been trying to put it in the condition box of the waypoint because I thought that was correct. Does it go in each playable units condition?

2) What do I need to change the words and numbers to in order to make this work? It is the only waypoint for the entire group, do I need an initial waypoint because you perhaps can't hide the first waypoint?

Once again I'm very sorry for having to ask this question and clog up forum space with what is likely an incredibly stupid question most people could figure out easily.

Share this post


Link to post
Share on other sites

Don't worry about asking questions on these sorts of things, everyone's gotta start somewhere.

I'll try to explain this as simply as I can.

What you're looking at from the wiki is SQF code. SQF is the scripting language used for altering the game / mission. The code on the wiki is not generally used directly inside the mission editor. Instead code is put into .sqf files which can then be executed (run) by either the client (player on the mission) or the server (computer hosting the mission).

There are some guides out there to help you understand the basics of SQF scripting and how to properly integrate it with your missions. Here's one I just found from a quick Google search: http://www.armaholic.com/page.php?id=9220

Your problem with the waypoints though seems to be solvable through only SQF scripting as I do not see an option in the waypoints to turn off the text. For an in-editor alternative, look at the task modules under (F7) Modules > Intel.

Here's an example init.sqf file which you would place inside your mission directory with the mission.sqm. The init.sqf is executed for each player every time they join. I've commented the code so you can see what each line does. In this file is where you could place the waypoint code from the wiki, however for large scale missions, breaking your code up into separate files and folders is best practice.

init.sqf

if (isServer || isDedicated) then { // This top line is an IF statement. It reads like English that if the computer executing this file (init.sqf) is either a server or is dedicated, then run the code below.
// Server Code
// This is where you place code only the server should execute
// Use this bit for spawning enemies, objects etc.
} else { // This is the else part of the IF statement, again it reads like English so you should be able to get the idea.
// This part of the code is only run on client machines (people actually playing the mission)

waitUntil {!isNull player}; // This will wait until the player is actually spawned in
waitUntil {time > 0}; // This will wait until the time is greater than 0 - used for making sure the player is spawned and is visible

// Now onto the waypoints
// _waypoint is a local variable (only usable in this script/scope (Google what a scope is, it's kinda simple))
// "leader group player" is a collection of commands written by BIS. "leader" returns the leader of the group. "group player" return the group the player is assigned to.
// "getMarkerPos" will return the position of the marker. The "waypoint1" is the name of your marker. The brackets ( ) are used just like in BIDMAS (Maths).
_waypoint = leader group player addWaypoint [(getMarkerPos "waypoint1"), 0]; // The 0 at the end is the index. This essentially says which order is this waypoint in. 0 is first, 1 is second etc.

// The rest is just code from the wiki related to waypoints. _waypoint holds the object (newly created waypoint) and it then uses the command in the middle to set whatever the command is to the value to the right.
[group player, 0] setWaypointVisible false;
_waypoint setWaypointBehaviour "CARELESS";
_waypoint setWaypointCombatMode "RED";
_waypoint setWaypointCompletionRadius 0;
_waypoint setWaypointFormation "NO CHANGE";
_waypoint setWaypointSpeed "FULL";
_waypoint setwaypointType "MOVE";

// You'd then copy and paste that waypoint code again but instead of puting 0 in the addWaypoint line, you'd increment it.
};

Note that I haven't actually tested the above code so if it doesn't work don't worry, just tell me what happens/doesn't happen and I'll amend it. I do recommend you read up on SQF scripting and then see if you understand the code inside the file better however. I often find if you just Google "arma 3 ...." the .... being the command name or function you're trying to make work, it will give you a good description of it, what data is returns, what arguments you need etc.

Edited by Kingsley1997

Share this post


Link to post
Share on other sites

Thank you for providing the script Kingsley1997, but it has crashed my game since I tried to place it in the mission folder and I can no longer get into ARMA 3. I'm not sure why.

Thank you R3vo for the link. I have actually read that several times now and reference it when I run into trouble, but it's not helping me in this particular situation unfortunately.

I think unfortunately I will not be able to implement a realistic extract to this mission without that waypoint constantly showing which is annoying and unrealistic, so I'll have to scrap it and move onto another project.

Edited by Mynock

Share this post


Link to post
Share on other sites
Thank you for providing the script Kingsley1997, but it has crashed my game since I tried to place it in the mission folder and I can no longer get into ARMA 3. I'm not sure why.

Thank you R3vo for the link. I have actually read that several times now and reference it when I run into trouble, but it's not helping me in this particular situation unfortunately.

I think unfortunately I will not be able to implement a realistic extract to this mission without that waypoint constantly showing which is annoying and unrealistic, so I'll have to scrap it and move onto another project.

There is no way that script would crash your game. How have you implemented it? Your mission folder should look something like this:

GuU524m.png

Share this post


Link to post
Share on other sites
There is no way that script would crash your game. How have you implemented it? Your mission folder should look something like this:

http://i.imgur.com/GuU524m.png

It would freeze the game if that's the structure, crashing may be possible.

You shouldn't use context freezing commands in the init without spawning the code or execVM'ing from another file, and it is not recommended.

[] spawn {
if (isServer || isDedicated) then { // This top line is an IF statement. It reads like English that if the computer executing this file (init.sqf) is either a server or is dedicated, then run the code below.
	// Server Code
	// This is where you place code only the server should execute
	// Use this bit for spawning enemies, objects etc.
} else { // This is the else part of the IF statement, again it reads like English so you should be able to get the idea.
	// This part of the code is only run on client machines (people actually playing the mission)

	waitUntil {!isNull player}; // This will wait until the player is actually spawned in
	waitUntil {time > 0}; // This will wait until the time is greater than 0 - used for making sure the player is spawned and is visible

	// Now onto the waypoints
	// _waypoint is a local variable (only usable in this script/scope (Google what a scope is, it's kinda simple))
	// "leader group player" is a collection of commands written by BIS. "leader" returns the leader of the group. "group player" return the group the player is assigned to.
	// "getMarkerPos" will return the position of the marker. The "waypoint1" is the name of your marker. The brackets ( ) are used just like in BIDMAS (Maths).
	_waypoint = leader group player addWaypoint [(getMarkerPos "waypoint1"), 0]; // The 0 at the end is the index. This essentially says which order is this waypoint in. 0 is first, 1 is second etc.

	// The rest is just code from the wiki related to waypoints. _waypoint holds the object (newly created waypoint) and it then uses the command in the middle to set whatever the command is to the value to the right.
	[group player, 0] setWaypointVisible false;
	_waypoint setWaypointBehaviour "CARELESS";
	_waypoint setWaypointCombatMode "RED";
	_waypoint setWaypointCompletionRadius 0;
	_waypoint setWaypointFormation "NO CHANGE";
	_waypoint setWaypointSpeed "FULL";
	_waypoint setwaypointType "MOVE";

	// You'd then copy and paste that waypoint code again but instead of puting 0 in the addWaypoint line, you'd increment it.
};
};

Edited by ColinM9991

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  

×