Jump to content
Sign in to follow this  
bspendlove

Drawing a circle checkpoint...

Recommended Posts

yet another EDIT...

 

 

OK so, I have got the createVehicle Sign_Circle_F for a little pilot course similar to the original Time Trials but I want to try another:

 

 

I want to create the next marker as soon as the player enters a radius near the current one (preferably, 2meters)... 

 

something in plain English (not code):

 

player distance > 2 _marker1 then create another marker....

Share this post


Link to post
Share on other sites

Sorry, should of been more clear...

 

Is this for drawing markers on the map?

 

I want the Sign_Arrow_Large_F to be drawn somewhere on the airfield...

Share this post


Link to post
Share on other sites

Is this for drawing markers on the map?

 

I want the Sign_Arrow_Large_F to be drawn somewhere on the airfield...

No, createVehicle is used to create objects in the worldspace. Use createMarker to add markers to the map through script

Share this post


Link to post
Share on other sites

No, createVehicle is used to create objects in the worldspace. Use createMarker to add markers to the map through script

 

Ahh, I see. I didn't want to create a marker on the map but now I know that :) Thank you

 

I have figured out to get the Sign_Circle_F so I can fly through it with a helicopter. but I now need to figure out how to play a sound when entering, deleting it and creating the next one in another position (or moving it)

 

Also, sorry again, I should of made myself more clear. I created the Sign_Circle_F in the worldspace

 

Is their a way possibly to create an object in the world space with this: https://upload.wikimedia.org/wikipedia/commons/thumb/6/6b/Red_circle_50%25.svg/2000px-Red_circle_50%25.svg.png

 

so I can use it similar to the Sign_Circle_F? Or at least change the colour of the default one?

Share this post


Link to post
Share on other sites

player distance > 2 _marker1 then create another marker....

 

That's almost correct.

(player distance (getMarkerPos _marker1)) <= 2
  • Like 1

Share this post


Link to post
Share on other sites

 

player distance > 2 _marker1 then create another marker....

 

That's almost correct.

(player distance (getMarkerPos _marker1)) <= 2

So for my object I could do (I'll code it later xD): (marker1 will be changed, because it now represents an object in worldspace)

 

So to get Position from an object would I have to use getPos as shown merely below?

(player distance (getPos _marker1)) <= 2
{
   (not code format, but this is my idea...)
   play sound...
   sleep 1;
   setPos of _marker1 to another position....

}

Share this post


Link to post
Share on other sites

This is basically correct ;)

 

Only thing is, I would call those "markers" checkpoints, since markers usually refer to mapmarkers. It makes it easier to read later.

Share this post


Link to post
Share on other sites

This is basically correct ;)

 

Only thing is, I would call those "markers" checkpoints, since markers usually refer to mapmarkers. It makes it easier to read later.

 

Ah yes! My brain was half asleep!

 

 

So I managed to make a small course, but I feel I am approaching the code not very neat..

 

example:

_noeStart = notice_student;

fnc_create_noe = {

	{ deleteVehicle _x; } forEach nearestObjects [position player,["Sign_Circle_F"], -1];
	titlecut ["Helicopter Checkpoint Training","BLACK IN",10];
	titlecut ["","BLACK out",3];
	spawnStudentHelicopter = createVehicle ["B_Heli_Light_01_F", getMarkerPos "course_01_spawn",[],0,"FLY"];
	spawnStudentHelicopter setDir 123;
	player moveInDriver spawnStudentHelicopter;
	titlecut ["Helicopter Checkpoint Training","BLACK IN",10];
	sleep 0.6;
	//Checkpoints
	checkpoint1 = createVehicle ["Sign_Circle_F",[2903.08,6022.17,6.77022],[],0,"CAN_COLLIDE"];
	checkpoint = createVehicle ["Sign_Circle_F",[3025.04,5973.28,10.5211],[],0,"CAN_COLLIDE"];
	checkpoint1 setDir 122;
	checkpoint2 setDir 107;

	sleep 2;

};

fnc_clean = {
  sleep 1;
  { deleteVehicle _x; } forEach nearestObjects [position player,["Sign_Circle_F"], -1];
  this removeAction action_clean;
};

_noeStart addaction ["<t color='#00FFFF'>Start NOE Test</t>",{call fnc_create_noe;}];

Must be a cleaner way, instead of keep creating checkpoints. Maybe I will use the:

(player distance (getPos checkpoint1)) <= 2

To move the current checkpoint to the next location?

Share this post


Link to post
Share on other sites

:D

 

I finally got the chance to go ahead and try as I've been extremely busy with other stuff.

 

Got it working with:

	while {true} do
		{
			if ((player distance (getPos checkpoint1)) <= 8) exitWith
			{
				deleteVehicle checkpoint1;
				_cPass = _cP +1;
				hint format["%1 / 8 Checkpoints",_cPass];
				sleep 3;
				hint "";
			};

		};

Although I may take a different approach (and much neater when I figure it out!)

	checkpoint1 = createVehicle ["Sign_Circle_F",[2903.08,6022.17,6.77022],[],0,"CAN_COLLIDE"];
	checkpoint2 = createVehicle ["Sign_Circle_F",[3025.04,5973.28,10.5211],[],0,"CAN_COLLIDE"];
	checkpoint1 setDir 122;
	checkpoint2 setDir 107;
	sleep 2;

	while {true} do
		{
			if ((player distance (getPos checkpoint1)) <= 8) exitWith
			{
				deleteVehicle checkpoint1;
				_cPass = _cP +1;
				hint format["%1 / 8 Checkpoints",_cPass];
				sleep 3;
				hint "";
			};

		};

Could I create something like... (How would I approach something like this below... It wouldn't work of course! xD but it may give an idea what I want to do)

checkpoints = [checkpoint1, checkpoint2, checkpoint3, checkpoint4]

^^ These will be the Checkpoint locations?

Then something like...

(player distance (getPos checkpoints)) <= 8


^^ Instead of selecting each checkpoint, how could create this IF statement to effect ALL the checkpoints?

Share this post


Link to post
Share on other sites

Ok, I sort of got what I wanted :D

while {true} do
	{
		_countCheckpoints = count nearestObjects [player, ["Sign_Circle_F"], 18];

		if (_countCheckpoints > 0) then
		{
			cP = cP + 1;
			{ deleteVehicle _x; } forEach nearestObjects [player ,["Sign_Circle_F"], 35];
			hint format["%1 / 8 Checkpoints", cP];
			sleep 1.6;
			hint "";
		};

	};

So this effectively deletes the Checkpoints for my Helicopter Course... How about:

 

Show checkpoint 1 (no others)... Once I have entered Checkpoint 1, show checkpoint 2... etc......?

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  

×