Sign in to follow this  
Followers 0
John

Simple task script assistance

4 posts in this topic

Hi Guys,

Im working on a simple task system for my server, basically when a player joins the game or respawns they have two scroll wheel options, doing this in single player is easy but in a multiplayer environment im a bit iffy.. the code currently won't handle respawning, im not really sure how to make it do so, its not a huge issue either its more of a "when you join the game option"

To be honest, there is probably alot wrong with this that I dont realize.. apologize in advance if its retarded..

Basically gives new players a bit of an exploring guide to look at key places on the map, gives a sense of something to do , etc. 

Enable PVE Quests

Disable PVE Quests

Here is my code, im doing this from work so I have no idea if it'll work, looking for some early assistance =)

Expected outcome - Tasks are local only to the player, I think this does this?

init.sqf - I "think" this enables the "player" object to be used in MP?

waitUntil {!isNull player};

player addAction ["Enable PVE Quests","quests.sqf"];
player addAction ["Disable PVE Quests","disablePVE.sqf"];

quests.sqf - Only has one task currently, but you get the idea.

/*Optional PVE Tasks for players*/

waitUntil {!isNull player};

_taskOnePos = getMarkerPos "task1";
_taskTwoPos = getMarkerPos "task2";
[player,_tsk1,["Investigate the abandoned quarry","Abandoned Quarry",""],_taskOnePos,2,2,true] call BIS_fnc_taskCreate;

_meters = player distance _taskOnePos;

if _meters < 25 then 
	{
	_tsk1 setTaskState "Succeded";
	[player,_tsk2,["Go here and look at this","Interesting place",""],_taskTwoPos,2,3,true] call BIS_fnc_taskCreate;
	};

And finally

disablePVE.sqf - This if selected will remove all the actions on the player

waitUntil {!isNull player};

removeAllActions player;

 

Edited by John

Share this post


Link to post
Share on other sites

I think this might be better for the "quests.sqf" ??

/*Optional PVE Tasks for players*/

waitUntil {!isNull player};

_taskOnePos = getMarkerPos "task1";
[player,_tsk1,["Investigate the abandoned quarry","Abandoned Quarry",""],_taskOnePos,2,2,true] call BIS_fnc_taskCreate;

_meters = player distance _taskOnePos;

waitUntil {_meters < 25}; 
	
	_tsk1 setTaskState "Succeded";
	uiSleep 5;
	
_taskTwoPos = getMarkerPos "task2";
[player,_tsk2,["Go here and look at this","Interesting place",""],_taskTwoPos,2,3,true] call BIS_fnc_taskCreate;
	
_meters2 = player distance _taskTwoPos;

waitUntil {_meters2 < 25};
	
	_tsk2 setTaskState "Succeded";
	uiSleep 5;

_taskThreePos = getMarkerPos "task3";	
[player,_tsk3,["Go here and look at this other place"," Anoother interesting place",""],_taskTwoPos,2,4,true] call BIS_fnc_taskCreate;

_meters3 = player distance _taskThreePos;

waitUntil {_meters3 < 25};
	
	_tsk3 setTaskState "Succeded";
	uiSleep 5;
hint "All tasks completed, go forth and be merry";

 

Share this post


Link to post
Share on other sites
Advertisement

why dont use the Task System from a Arma and sync that tasks with players?

there are different way to give players on respawn a task

1. onPlayerRespawn.sqf

2. Event handlers

3.exile respwaning(not sure right now which files this is)

Share this post


Link to post
Share on other sites

Ill look into the respawn thing

In the meantime, im more interested in getting it to work simplistically for players joining.

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.