[Release] [ALPHA] "Arma III" Styled Missions

Thanks for yesterday night…
Pretty cool that you were there to test with me.
This way i think we saved a lot of time and misunderstanding.
I think you are close to a stable version.

And for people reading this, ddraigcymraeg is an awesome dev… This is close to be a game mode.
Im proud to be part of this project.

I did change icon blip to my own… Love it…
ill show you tonight.
Cheers my dude

2 Likes

little idea…
is it possible to make ennemy want to kill
friendly npc…
exemple:
President inside limo… have to go to a destination… but some ennemie are hiding on is way to kill the president before he reach destination…

A mission were we have to protect a friendly npc on is way to a destination…
and if he reach destination… Mission done
if he die… mission failed

2nd idea
ennemy npc… dontmove=true
for sniper enemy

3rd idea
ennemy npc sleeping=true
doesnt see or react if you pass
but woke up if hit… or ear fire shoot…
or simple like doesnt react if not in a 5 meter area

4th idea
A npc (friendly/ennemy) with a destination will wait til a player get close to… 10 meter area…
then i start is way to destination…
a kind of waitaplayer=true
exemple…

cheers

Interesting – I like in particular the broad category of VIP escort and its opposite (variants of assassination or apprehension involving escorted target). It seems these are feasible with natives like TaskVehicleEscort, TaskVehicleFollow, TaskVehicleChase, and ped relationship groups.

Of course I don’t know how difficult these would be to implement, and I’m not the one doing the work here, and such great work it is!

These links may or may not be of any use should development go in this direction:

2 Likes

Thanks Loque,
Will check those out. Very interesting.
sixsens has been helping a lot with testing on his server. We fixed a problem due to my code not taking account of decor values not syncing to all players from NPCs since the NPCs were probably not loaded for all players… and were returning 0 for those clients.

I have random missions at predefined locations as well as now completely random location missions working, where anywhere on a map a random mission can spawn, and if on water peds with boats will spawn. For completely random location missions, you can define the x range and y range on the map where missions can spawn.

We found some limitations, that non-host players will only see NPC blips when they get close enough… around 500m (sometimes less) close to the NPCs, even wen blip range is to be long range. It makes sense no,since the NPCs and their decor does not exist yet for the other clients who have not come within range With setting them to be mission entities (I think), the blips seem to stay across the map, once you have gotten close enough to load the NPCs. So I am working on adding an extra optional mission blip for certain types of missions, like IsDefend that will show start point as well as end point for NPCs, since non-host clients may not see the NPC blips right away.

I have 2.9.1 alpha out now also has mission counter/timeouts…
http://www.mediafire.com/file/4c4773157881074/mrp-missions-2.9.1.zip/file

You will notice a ‘Time Left’ counter now.

There are 2 settings,
first in missions.lua:
Config.MissionLengthMinutes = 10

You can set MissionLengthMinutes per mission as well which overrides the global value.

Second in server.lua:
–This is in minutes. How long to wait, when there are players online
–for the server to find the host and trigger a new mission
local ExtraTimeToWaitToStartNextMission = 5

So a mission will by default timeout in 10 minutes.
Then there is the Config.MissionSpaceTime =10000 (which is in milliseconds). which can also be set per mission, which is the space between the current mission ending (where reward pickups spawn and then should disappear) and the next mission starting.

So what happens is that the players can complete a mission, it can timeout etc… and now the client that competed the mission will tell the server to find the host and the server will/should have the host spawn the next mission, rather than the client who completed it. Same with timeouts.

The server will run in a loop and keep track of the time the last mission would timeout/end + spacetime. If there has not been mission activity since the last mission would of ended, it will wait an extra ExtraTimeToWaitToStartNextMission minutes past that time before checking the clients for the host and getting the host to spawn the next mission. If that makes sense.
This value is set to 5 minutes by default.

sixsens is going to do some more testing

1 Like

Great work on the updates and testing.

Your story of decorators not getting recognized brings back some bad memories. I remember similar issues with decorators and networking on the heli spotlight mod I did some time ago. It might have been different in my case of decorators on vehicles, which sometimes a remote client needed to read but other times it needed to change. My memory is fuzzy but I think I recall, at least with changing a decorator on a remote client using the FiveM netcode that existed pre March 2018, I had to create function for the remote client to first (with repeated attempts) NetworkRequestControlOfEntity until it had control. Your situation of course sounds different but network control certainly was and maybe still is an issue for many instances where one client wants to effect a ped/prop/vehicle created by another client.

If your case of blips not networking if an NPC has not loaded on a remote client, it’s probably no big deal because it sounds like everything could still work perfectly well, but I’m curious if you tried either passing the NPC coords to the remote client for it to RequestCollisionAtCoord? Or even simpler if it worked the FiveM element’s solution from that blip thread, which if I understand would be something like… have the originating client apply to the NPC SetEntityAsMissionEntity + NetworkRegisterEntityAsNetworked + PedToNet + the previously unheard of SetNetworkIdSyncToPlayer to force sync the netID on all clients? Ha ha, that actually doesn’t sound that simple after all. Ignore me as I’m mostly just curious to unearth all that can be unearthed about the current netcode and syncing.

All the best as you continue to work on this!

1 Like

I just noticed this other blip thread which is very on point (blips & distance) but I’m not sure the conclusion. An element again suggests SetNetworkIdSyncToPlayer but creator of the thread concludes a blip needs to be on a player to defy the blip distance limit (but it’s not clear he tried the element’s solution - I think I will ask him).

1 Like

this is the case here…
sometime when the npc get far from me the blip disapear… but get back if i found him back.

Somtime i dont lost even coast ti coast…
Soo its seem that depend who host the mission.
Host see all
client see when close.

Does it make sense? How to change distance var to make them stay on map coast to coast…

Oh I see. That’s even more confusing if a blip on a mission ped first appears, then disappears and even reappears again, on the remote clients. Meaning initial network sync does happen but something goes wrong after.

In the blip thread I last posted above it is suggested that this blip distance effect is a consistent ~500-600 units, at least with respect to vehicles. @dragonkyn says a blip on a player ped can defy this limit, presumably even for a remote client, but it’s not clear from his results whether he found a way for a blip on an NCP ped to defy this limit. I messaged him.

The two theories raised in the thread seem to be: (1) the element’s theory that maybe the blip disappears because the entity disappears - is no longer cloned/synced, and therefore SetNetworkIdSyncToPlayer could be a solution because it forces sync/existence of the entity on the problem client. (2) possibly the distance limit is simply built into the blip function on remote clients (but why only remote clients?) which would mean the actual entity still persists, at least after initial sync/load on the remote client, and this would also mean the above native would probably not help.

Your experimenation may support the second theory. There could be issues of initial network sync of the entity but obviously those eventually get resolved once you first see the blip on the remote client. I wonder if periodically checking a combination of DoesEntityExist and blip = GetBlipFromEntity(ped) / DoesBlipExist(blip) would track down the source of the problem? Again, this may be low priority in the grand scheme of things.

I will say that if the issue is a hard limit built into the blip function (at least of non-hosting clients), then I’m surprised this not come up much more in the forums. And doesn’t GTA Online allows blips across great distances for multiple players (co-op missions & jobs)? Or maybe that is different for some reason.

only the blip (target disapear)…
lets say its a ped in a car driving away from you…
When he reach a certain distance. If not the host blip will gone… but if i drive in the direction he went and get closer the blip appear …

Oh that is clearer. I’m assuming this means there is (probably) no issue of the underlying entity getting de-synced, just the blip disappearing due to distance.

I admit I haven’t looked at this part of the code. But after the blip first appears on remote clients, is the script continuously re-checking whether it exists? I’m assuming that when the blip disappears at distance that DoesBlipExist would return false. And an attempt to forcibly re-set/re-create the blip would still fail to make it appear due to distance? Otherwise it would be too simple a solution I guess.

So strange.

1 Like

To answer my own question (partially), I snooped around more in the latest version. The check for blForceCheckForBlips is commented out but if that code is running then it is pretty much doing exactly what I asked about above. I guess that settles the matter that you can’t simply re-check and re-create the blip because on a remote client the distance continues to suppresses it?

I found the native SetAiBlipMaxDistance but I guess AI blips are completely different. Why didn’t they give a corresponding native for non-AI blips? This blip distance thing remains a mystery!

I see how you have creatively avoided (so far!) having to mess with entityIDs <-> netIDs with the use of decorators and the entity enumerator – which is so handy. Tricky!

1 Like

Hi Loque,

Yes, it is doing a re-check to re-create blips if necessary, as you saw in the code.
yeah, thats basically the rationale, when NPCs and their decor values come back into ‘reality’ for the client, that code will be ready to re-add blips.

Your ideas for request collision are cool, I wonder if that would make a difference. sixsens is testing more with multiple clients than me and I believe the blips can/will fade out when you move away from them, even with set mission entity as true… . On sixsens server I saw the blip move on a long way away from us in a speeding vehicle and did not fade for me… but we caught up to the NPC eventually as well.

Yeah, I avoided the netid stuff when I saw that there still seemed to be some limitations with what I was trying to do even using that. That the netID can be used, only if the the entity is on the clients machine and you can never assume it will be. I will check more with those network methods too, but will probably wait until another version after this one is finished and more maturity with the tech before getting into that.
The setAIBlip is interesting, I remember not using probably because it did not seem to apply… but again, maybe that might work…

Thanks for your guidance and help too, I would not have gotten the random missions done otherwise.

2 Likes

I was never able to over come the client limitation for NPC/Vehicle blips. I had to create a work around that involved player ped blips instead as there is no distance limitation for rendering on the map. 0.60mi (500 units) was the lucky number when it came to NPC/Vehicle blips. After that it’d disappear and when brought back in range would still remain invisible.

Best of luck in your quest folks - hopefully you will succeed where I failed. :slight_smile:

3 Likes

Have 2.9.2 Alpha…

http://www.mediafire.com/file/psg9hh5lc35a7ec/mrp-missions-2.9.2.zip/file

New stuff:
–Improvements to the mission timer added in 2.9.1. Better GUI for the time, based on sixsens recommendation.
–You can now place up to 2 blips for a mission. Like a start and end for IsDefend missions, to help with players not always seeing enemy blips across the whole map.
–Other fixes
Mission ‘Safehouses’. These will be around the map and will be the place to go to get health, armor and supplies/weaponry/weapon components for a mission at both a time and optional $ cost.
When you use a safehouse it will by default shut down for a period of time, before being able to be accessed again by the player. It will be the big green dot with a roof on it.

Admins can configure what gets given at a safe house per mission, including weapon components. How much using a safehouse costs etc… Players will automatically get health and armor restored as well. Many other configurable options as well.

Random Mission Generator
2.9.1 added random missions anywhere on the map to the random mission generator added in 2.9.0(?)
You can set a mission to use the random mission generator by adding an IsRandom=true, to it. Mission12 has this as an example
This will look at locations on the map you give it. You can override random mission generator settings per mission as well.
If you also add to an IsRandom=true mission, the flag: IsRandomSpawnAnywhere = true, it will spawn a mission anywhere on the map within the range you give it:
i.e. IsRandomSpawnAnywhereCoordRange = {xrange={-3500,4200},yrange={-3700,7700}},
Default is around the whole map and will spawn boats if it finds water.

You can add safehouse information and other attributes to the locations you add to the random generator, similar to the way regular missions are defined. Or you can set a flag that makes random missions use an array of safe house locations you give it, which it will randomly pick from for each random mission.

There is a ton of configurability built in. Not to be confused with Config.RandomMissions, which will randomly pick missions in the mission list, regardless of regular or IsRandom missions.

3 Likes

Wow, you guys are moving on this. I am still curiuos as to the how the cash for completed missions work. It was originally ESX cash or GTA cash?, is it possible to make the pay in dirty_money? so people get them to their inventories after completed missions in vrp? cause some devs run one kind of banking script and others run another. Dirty_money or whatever people call their rewards for bankrobs/storerobs would be pretty cool to have as an option - just my two cents, else great work on the whole mission setup! :smiley:

1 Like

it work both way… gta money or esx money
i can modify the esx version to let you gain dirty money… give me time.

It would be nice to get dirty money in the vRP version :slight_smile: I don’t use esx :frowning:

sorry then i work with esx only

noooh :slight_smile: please make it so dirty_money drop :slight_smile: I’ll try to figure it out then :slight_smile:

Put Fivem and GTA V on my laptop as well to finish working on synch issues so I could have 2 clients to dev with. My desktop runs the server and client (typically host) and connects localhost, my laptop will connect via wifi to the desktop server on the local network as the other client.

sixsens did some testing with the previous build and found some performance issues. So I put in some optimizations that will hopefully fix that.

Interestingly unlike on sixsens server on a previous build, I noticed that BOTH clients for me could see NPC blips from across the map, all the time. Also, there was a problem with decor variables being set for an NPC on a non-host client… they did not get carried to the host player. The other way, setting the decor value on the NPC on the host did get propagated to the non-host client. I had to fix this by calling the server and letting all clients know (particularly the host) to change the decor value on the NPC and that worked. This fixed a problem with hostages that are rescued not being tag as so, so multiple players could rescue the same hostage.

Have 2.9.3 alpha:
https://www.mediafire.com/file/g912qafjfz3ge5h/mrp-missions-2.9.3.zip/file

–Fixes problems and errors with the non-host client, including the decor value problem mentioned above, other tweaks.
–Besides the ‘safehouse’ where you go to get mission equipment for the mission at an optional $ price, there are now safehouse vehicle and boat zones that can spawn, which will be shown as a blue tank and blue boat icons. Players can go there and grab a vehicle for the mission. They will be charged $ similar to using the safe zone, when they hop in a vehicle, which they claim. (prices are shown in the in-game map per blip information). A player can claim only so many vehicles per mission (configurable like all other settings), which can stop griefing. If a player hops in a mission vehicle driver seat already claimed, their ped will immediately get out and the player will see a notice. They can hop in as a passenger of an already claimed vehicle though.
–‘Crackdown’ mode, when turned on, after the player visits the safehouse and pays for the health/armor/equipment for the mission, they will also get ‘cybernetically upgraded’ with superjump, super run and superswim as well.
–Safehouses and safehouse vehicle/boat zones can all be easily turned off as well now.
–For regular missions, from previous builds you can define vehicles without an NPC in it (no ‘id2’ attribute), and it can be used as a player vehicle. Now you can add isboat=true attribute and they will be anchored and not float away.
That all I can think of atm.

EDIT: There was also another odd problem a simple triggerevent being called on the non-host client to display a message. It was being called but no text on screen displayed. I was able to do a workaround for now using chat messages.

The last few things I want to add for alpha are:
– a variant of IsDefend missions. Where instead of players stopping the NPC getting to a marker zone, they must stop the NPCs killing a target.
–IsDefend support added to random mission generator
–Scoreboard that shows total mission cash earned by players over a session, or some type of mission stats. Like cash earned per mission.

I see $ stat as GTA’s score, so the safe zones are ways to sacrifice score to buy something that can potentially give greater score, so perhaps there is some strategy there.

Other than that some extra gravy like before spawning a mission, checking there are no players too close say, as well as performance tweaks.

2 Likes