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

I just did some thorough playtesting (yet again) and I have a final update to 2.8.5. This makes enemy NPCs fly planes more aggressively, which means when they see you, they will attack, fixes a bug with rotation of missions not working correctly, and some other tweaks…
http://www.mediafire.com/file/dd7i6v240qscugx/mrp-missions-2.8.5.zip/file

wander = true means an NPC on foot will be given a task to roam around rather than sit like a statue
dead = true, yes dead NPC for scenario
driving=true is the same for a driving NPC, similar to wander for on foot NPC.

pilot=true, you can now ignore that, my update I just posted gets rid of it. just use driving=true and place the plane in the air to help them fly.
dontsetheading=true, you can ignore that. But leave it in for the missions that use it.
drivespeed… yes, thats the speed that the NPC drives at when driving=true (not sure it really works or not).
flee=true This is just for enemy NPCs in vehicles that you want to evade you.

Also can we make a NPC helping us if we give him a weapon?

No, in order to stop hostages/friendlies fleeing, instead of using citizen.wait I now made them friends with player and with NPC enemies. :slight_smile:
before, they would freak out and I would have them in a citizen.wait loop giving them a brief task to stand still … it looked better, but maybe not so good.

need ypur help for this one…

in server.lua

i want to be able to know what mission is active
to set different item reward by mission then i tried…

if MissionName == Mission1 then
local item = defib
end

doesnt work… how can i know from server side what missionname is active?

Yes, it is the ActiveMission variable.
You want to take a look at the ‘sv:done’ event as well, for mission end. you will want to work with ActiveMission there maybe before the event sets it back to N/A, which means there is no mission active (until next one)

i dont want to know if a mission is active… i want to know what mission is active
something like this…
if activemission == Mission1 then

thanks ill take a look at sv:done
ill surely figure it out

Thats MissionName you want.

If MissionName ~=“N/A” and ActiveMission then
–MissionName here has the name of the active mission
end

how can i retrieve if mission1 is the mission name i want
with input and input2 fron sv:one?

after this line:
MissionName=input

If MissionName == “Mission1” then

end

Great … it work.
Thanks

dawm your good dude. i really look noob besides you. :pleading_face:

Presumably 2.8.5 was more stable for you session wise? I haven’t heard anything from you, so I figure it is all well :slight_smile:

I have another big update. This will have various fixes, including setting the armor attribute on a ped should now actually work. Whats cool with the next update is that it will have a random mission generator. A mission like Mission11, can have a setting saying that it is random, and a random Assassinate or Objective mission will be spawned. You specify the min/max peds, min/max vehicles, spawn radius, ped types, prop types,friendly ped types, vehicles types etc… and the generator will spawn a mission using these variables. There is an array of various spawn locations you need to set, which the generator will pick from to spawn the mission. I have set 3 or 4 locations already. So you would go around the map and get coordinates of where these missions can spawn, and add them to the generator.

Like other variables you can define these per Mission, so Mission11 could spawn random large battlefield type missions, whereas Mission12 could be defined to spawn random bank robberies, with a lower spawn radius and less stuff, using spawn locations set at all the stores/banks etc…

The other feature is that now when a vehicle with turrets is spawned, you do not need to use ExtraPeds, it will find the turret and add the extra npc to man it. You can still use ExtraPeds with this though, for passenger seats. There is an array it uses of vehicle hashes with their turret seatids, that you can add more vehicles to.

If you set any up,a random prop from the list will locate at the marker/mission blip. Mission Pickups are not randomized though, since that does not make sense, where would they spawn? So you will need to define locations the old way for the random mission. Saying that, for reward pickups, I suppose I could just have a flag to have them spawn at the mission blip/ marker… but that doesnt make much sense for assassinate missions, where you could end up across the map from the mission marker. So the other option is to set it so that dead enemy peds spawn pickups at the mission end (EnemiesCanSpawnPickups), or define reward pickup locations manually as well.

1 Like

im almost done testing everything…
ill get back to you tonight will all issues.

sorry little late … got a lot a work this week.

Hi

There is everything i found.
Config.EnemiesCanSpawnPickups = false
Enemies still spawn Pickup after mission. Add to disable it myself in code

Mission Pickup
4 players … first 2 players can pick a pickup then it disapear. Mean 1 pickup can be pick 2 times.
And… Same mission same pickup, 1 player deco and reco and for him the pickup appear and can be taken.
all the same for pickup that appear as reward after mission

if a mission is /stop then mission pickup are not cleanup

Also sometime after mission and when a mission is /stop we can still see sometime weapon that have been drop from npc. (not after i stop it in the code)

mission 2 is started
we all get offline and comeback
We still see mission blip and marker (cylender objective) still see mission pickup and or pickup
but no NPC at all and no blip target but as there no NPC can be sure about those target blip. :slight_smile: Was easy finish this mission :wink:

Some bugs where not in 2.8.3

Also i dont use antifloat thing cause i always place my object on the floor myself.
easieast way… when i take coords for a place i want to spawn something… i have for exemple
x = 33.13, y = -2719.28, z = 12.52
easiest to place the prop or npc or anything else on ground its z-1
like this
x = 33.13, y = -2719.28, z = 11.52

12.52 become 11.52 then its on floor each time

i tried everything with those set to false
Config.EnemiesCanSpawnPickups = false not working
Config.SpawnMissionPickupsOnPlayer = false
Config.SpawnRewardPickupsOnPlayer = false
Config.SpawnMissionComponentsOnPlayer = false
Config.SpawnRewardComponentsOnPlayer = false

not using any random spawn either.

Sorry im late i know…

(WAS EDIT AFTER POST):point_down:
Had an Idea or 2

what about a Mission Timer
Config in each mission if True or false
with a config time limit (editable)
This timer could be set in mission scenario that you have to finish before time end or mission failed
if mission failed we go to next mission.
The timer doesnt have to be shown . We can say it on description if so.

Other idea give a destination for driving ennemy
And you have to finish mission before he reach is destination.

Not sure if you add it cause didnt test it but…
Make NPC that have MELEE weapon dont fear us… If possible… cause they dont even try to attack they flee.

Thanks Sixsens,

So session-wise it is stable enough to play with without the players losing session or splitting off into their own session?

which bugs were definitely not in 2.8.3?

I saw that EnemiesCanSpawnPickups was not being enforced in the code, and that is fixed now.

Also, I see where /stop is affecting pickups not being cleaned.

I remember after your testing that I started spawning mission pickups like reward pickups, to be spawned on every client, since they were not being carried across to other clients like NPCs and other entities. This explains why the reco and deco player saw the pickup again. The pickup being picked up twice then disappearing… it sounds like there is some network awareness with pickups, if the other 2 players didnt see it, and

As far as everyone going offline and NPCs disappearing, I guess I am not surprised. At the least I can put in a check in the code to not give a reward if zero NPCs. Though I looked more into what Loque posted re: network aware resource manifest and network settings. I see that Fivem_Cops does an ObjToNet call and some other network related settings when stuff is created, which I will play about with and may add. This may allow the ownership of game objects to migrate properly to other clients if a host/spawner leaves the session. This may actually help with any session related issues that you may be experiencing as well, if you still are. Not sure if it will fix all NPCs disappearing when players disconnect.

It sounds like most of the problems are with pickups for you, not with NPCs,vehicles or plaeceables not showing up… at least when at least one player is connected? My big concern was spawning entities across the other side of the map from a player/players and them (including pickups) not being seen by players. So if all players are on one side of the map, and a mission spawns the complete opposite side, everyone can see blips and NPCs etc…when they get there? Same with players that have connected afterwords during the mission? They can see npcs and their blips ok?

Its possible that setting network ids for pickups (if possible) may help with your pickup problems as well. Thanks for the spawn coords tips as well.

For a test a while back, I updated to the latest resource manifest and spawned a prop in a mission. I had just logged in after starting my client, and teleported into where the object was from about 1/7th to 1/8th of the map away, and it just was not there. Same as if I drove there as well. Whereas if I was nearby it would show up. This might be solved by using ObjToNet and generating netids etc…during creation, though I am not sure. From what I have read, there is no guarantee that entities will persist for all clients at all times. Same with netids, they have finite values and are mutable since so many objects can be created during the session by players, that the game runs out of netids and recycles them. It make sense that GTA works this way, but may be bad news for truly persistent missions. Though, it sounds like your players have not encountered disappearing NPCs vehicles etc… for the missions, which is good news :slight_smile:

Thanks for the suggestions.
RE: Timer, yes, I had a build with a timer, but realized that it needed more work to have the server control mission flow better. Its something that I have thought of. Different missions types like the checkpoint one you mention is cool. RE: Melee weapon, that might be an easier one to add, by setting the ped combat attribute.

if i were you i would go the easy way
exemple… were on mission 2… and everyone goes offline… as it already keep in memory what mission we were at… then just clean the miasion and start it back when players goes from 1 to 0 and then 0 to 1…
its save when goes 1 to 0 and clean and atart back the mission when goes 0 to 1…
or… if server player goea to 0 and 1… just clean mission and start next mission…

this way at least same mission is on…
i thought that was done in the previous version.

Vehicule mission… they disapear the same way as npc… forgot to tell.

for mission pickup and pickup we should use the coords… if a players go on same coords then where mission pickup is then wait 10 milisecond and clean this mission pickup. wait time to be sure its been pick.

If at least one player persist in game… other can goes off and on … mission goes ok.

For ‘pickup’ rewards that appear after mission is complete… same way as mission pickup…
check if mission is done … check if it spawn… check coords of pickup and if a players goes on coorsd … wait 10 milisecond and clean pickup.

https://runtime.fivem.net/doc/natives/#n_OBJECT

see object native there is 2 or more that we can use there…
DOES_PICKUP_EXIST <------maybe
DOES_PICKUP_OBJECT_EXIST
GET_PICKUP_COORDS <------maybe
_GET_PICKUP_HASH
GET_PICKUP_OBJECT
GET_SAFE_PICKUP_COORDS
_GET_WEAPON_HASH_FROM_PICKUP
HAS_PICKUP_BEEN_COLLECTED <-------*****
_IS_PICKUP_WITHIN_RADIUS <------maybe
REMOVE_ALL_PICKUPS_OF_TYPE
REMOVE_PICKUP
SET_TEAM_PICKUP_OBJECT

Not sure but seem mission pickup were acting better in 2.8.3 maybe its only the manifest
i should go back to 2.8.3 for testing purpose. (if i have time tonight)

On a fresh restart server when first player connect… mission autostart… and whatever place we are on map when we get to mission everything is there even if i were on opposite side of map.
Same for new player coming in. Didn notice any misplace or missing thing in mission ever this way.
When server player there and mission on… if then server player goes to 0… then next on coming in will have issues… that is why i recommend a cleanup and a mission restart or pass to next mission if so.

They dont have one already?

MissionPickups = {
{ id=1, Name = "PICKUP_HEALTH_STANDARD", Amount = 1.0, Position = { x = 981.75, y = -2133.14, z = 28.48, heading = 0.0 }},
},

I have to be honest i think i had problem with something else that is not related with your ressource.
Realize only dayz after.
I never see any hitch or problem related yet. Sorry if i mislead you.
if something was there and erased…I think you can put back them…
Sorry about that

Thanks for taking time.
Have a good day.

OK, cool, NPCs, objects, vehicles are showing up across the map for players, thats great news.
I wonder if the problems I read about, are when there are many players on the map perhaps.

Yes, you are right, when there are 0 players, and first player connecting back, it should restart the same mission. This works for me when I disconnect and rejoin my localhost. It sounds like it is partially working for the 0->1 player joining back, since they are seeing the mission blip and marker. When this happens could you have them F8 and check the console for errors. It will happen for me once in a great while… will only see mission blip.

The resource manifest for 2.8.5 is the same as 2.8.3. I only changed it once for myself during some testing.

With pickups. Are you using any other resources that spawn pickups? I found a crate drop script, and that spawns a pickup on the same client, so I imagine, only that client will see it, based on our testing, which is why I have both reward and spawn pickups spawning on all clients now. When pickups spawn and are picked up, does the pickup eventually spawn another item to be picked up? I never noticed in my testing, it sounds like it though. I can add a loop on each client to check HAS_PICKUP_BEEN_COLLECTED for each pickup and delete the pickup, that may help.

i never encounter any trouble avout that.
sometime mission is way back other side of the map and when there everything is there.

when 0 player and 2 or 3 connect at mostly same time… i thinks its was goes wrong. maybe put a citizen wait 1 min before start the mission…

soo its should stop/clean mission when 0 to =<1 happen then wait 30 sec… and start mission.

Yes i know what is cratedrop i actually use it but mod as hell… i change a lot of it…
not sure if the weapon spawn only for one client or for everyone… i know that the crate is see by everyone but the weapon… didnt test with many people… i should test it.

Mission pickup and pickup reward always spawn what it should… same when pick always give what it should.

HAS_PICKUP_BEEN_COLLECTED
sound like its a solution.

Thanks… I respond as soon as i could… at work right now.

Have a good day my dude.

Yeah, when you get a chance, it would be interesting to see if other players who didnt request the crate drop can see the pickup. I would expect them to see the crate.

Thanks, you too man.

i know they see the crate that is for sure.
okay tonight ill test that and get back to ya.
sounds good. (about pickup)

There is 3 crate system around…
the one that i have spawn the weapon only for the client that had make the purchase
other doesnt see it and other cant take it … as its not there for them.

But they see everything else.

Thats all.

Thanks, as I expected. I think I may of fixed the pick up issue. Will upload 2.8.7 soon, it will have other bugs fixes, and enhancements.

2 Likes

cant wait… have a lot of time tonight…
Hope to see that soon :sunglasses: