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

Updated to v. 2.8.7 alpha
http://www.mediafire.com/file/8eu7d6cy6pybx8b/mrp-missions-2.8.7.zip/file

Changes:
–Fix added for pickup funkiness. Pickups should get cleaned up properly now. Thanks to scanner and his RottenV mod which helped me understand pickups a little better. Mission Pickups will be checked every 5 seconds if collected and cleaned up on the client if so. Better cleanup code for reward pickups and mission pickups at mission end.
–Enemy Peds will now stay in vehicles, they will also attack with a melee weapon. New ‘wanderinarea’ attribute that makes an NPC wander within the area. ‘wander’ makes the NPC wander to wherever. New ''drivingtocoord" attribute that makes NPC in vehicle drive there (see missions.lua). ‘drive’ makes the driver wander. If you specify a zombie model for the ped, it will take on zombie like attributes (thanks again to scanner). You can override this with ‘notzed=true’
–Turrets. If you add a vehicle with a turret, the turret seats will be auto-filled by NPCs. See missions.lua for the config.
–New setting: Config.HostageRescue: If you set this true, in Assassinate missions if a player kills a friendly/hostage, the mission will fail and the offending player will get the money penalty for killing a friendly.
–Cleanup of markers and props so they now are at ground level (thanks to sixsens)
–Other code fixes and tweaks, like cowering hostages/friendlies, mission ending messages are more descriptive
–Removed the old buggy Mission10 and and added a new one, along with a new mission Mission11
Random Mission Generator
Mission12 is a random mission in missions.lua. You could take out all the missions in missions.lua and make it Mission1, the only mission, and you would have random Objective and Assassinate missions all over the map. You make a mission random, by giving it IsRandom flag.
There are a host of Config.RandomMission<***> settings to generate random missions. Like most other settings in missions.lua, you can override the global setting, by defining the setting per Mission. So you can have different types of random missions.

The current selection of default random locations and the default settings of the generator are still in testing. I am forcing vehicles and sometimes many NPCs into tight areas and varying landscapes to see what happens. Spent some time trying to get this work, I ended up having to use raytracing (StartShapeTestRay and GetShapeTestResult), to worldprobe the area to not have NPCs spawn hidden inside buildings (Kudos to Vechro and his Crates Drop script). It works well. Thing is when I updated my resource manifest to be able to use the functions, my props via CreateObject stopped spawning. Its so odd. I get 0 back from it. Tried different arguments, looked at Fivem_Cops way and havent figured it out yet. So I ended up backing down my resource manifest and using a NativeInvoke for StartShapeTestRay but for GetShapeTestResult, they had a GetRaytraceResult alias which was usable. It must be a timing problem with CreateObject, may have to put in a wait or something.

1 Like

On testing.

I found this in mission 1
MissionSpaceTime = 10000,

What about this?

You’ve really developed this resouce in great directions. The random mission generator seems really cool and has incredible potential.

I’m not sure if I missed this in your above descriptions but is there now or in the future the possibility of continuous random missions/callouts, using some kind of min/max timer? I see the variable getMissionSpaceTime but not sure what it does yet.

Thanks.

yeah MissionSpaceTime is the time after mission is over to wait for the next mission to start. So you could have it a long time, for people to do something like collect pickups, or have it short, like to quickly set up the next mission in a sequence say.

Its sort of pseudo-continuous at the moment, as long as the person who completed the mission is connected between missions.
But, yes, I will probably add a mission timer from the server which will both add mission timeouts and send out missions as well as keep the mission loop going.

1 Like

Been playing though a lot of the new random locations (on invincible of course ;P), and the long distance wierdness comes into play. I will set tasks for NPCs at spawn, but they dont hold if they spawn on the other side of the map to the player, not too surprised there. Also NPCs will spawn away from the site, like on the nearest road, and some will be at some negative z position (based on the blip) before dropping in when the player gets near. Its funny, they literally fall in and fall down look dizzy then finally get up to fight., right where their red blip is. They are not invisible at least.
This would probably be helped if I were spawning less NPCs. Open area locations like the desert airstrip seem to work much better with the amount of vehicles and NPCs Im spawning in at a time.

EDIT: Also, delete Mission13 in missions.lua, if its causing problems its not meant to be in there, its a test mission.

EDIT2: Ok, I can see that in the non-random regular missions, I can spawn NPCs far away, and when I get closer, they resume their assigned tasks. I can see that this is due to the script keeping a reference to the Ped/Vehicle, whereas in my random missions I am using a local variable that gets discarded.

Props doesnt show

	Props = {
		{ id=1, realId=1, Name = "hei_prop_heist_ammo_box", Position = { x = 28.91, y = -2719.5, z = 12.52, heading = 0.0 }},
		{ id=2, realId=2, Name = "hei_prop_heist_ammo_box", Position = { x = 40.11, y = -2719.85, z = 12.52, heading = 0.0 }},
		{ id=3, realId=3, Name = "prop_box_ammo01a", Position = { x = 19.2, y = -2664.93, z = 8.76, heading = 0.0 }},
		{ id=4, realId=4, Name = "prop_box_ammo01a", Position = { x = 28.03, y = -2682.12, z = 11.24, heading = 0.0 }},
	
    },

from my mission1 same that i copy /paste from all previous version
seems to be the case on all missions…

NEVERMIND… just found out that i dont need to do minus 1 to my coords… and prop where on the ground…

no worry just found out
sorry

Normal props should show, mine show fine for me.Just checked Mission8
I did make smalle change to normal prop spawning…In the SpawnProps function was add a -1.0 to z coordinate when it spawns, to save me doing it everytime I place a prop.
I also commented out:
PlaceObjectOnGroundProperly(Config.Missions[input].Props[i].id)

I can re-add that when I get time, So un-comment that line and remove the ‘-1.0’ here:
…Config.Missions[input].Props[i].Position.z -1.0, true, true, true)

NEVERMIND… just found out that i dont need to do minus 1 to my coords… and prop where on the ground…

no worry just found out
sorry

If i deactivate mission 12 the script doesnt work anymore.
Seem that Client looking for it

Is there someowhere i can activate or deactivate Ramdom Mission

Also mission 12…
tried twice…
one was Capture the flag… no NPC and countdown on marker didnt start. Couldn finish mission.

Second try
An Assasinate one… Many NPC … Kill them all. Mission Didnt finish.

**Ok i get it i set to false IsRamdom then the mission will start normally **
So mission 12 is an Option for ramdom mission.

Il come with some more info later or tomorrow, dont have any player online.

You are definitely getting different results than me. Never had a mission not finish. Was this happening while playing with other players online as well?

For a better/simpler test of Mission12, just enable only the { x = 1074.41, y = 3072.94, z = 40.82}, --desert airstrip location. And let me know how it goes. This is a flat open space.

I may have an update too later today, to fix random mission funkiness when NPCs spawn far away. This might fix the problems you are seeing as well. Eitherway, for now, just use the desert airstrip location for Mission12

sounds good.
didnt have any players yesterday night… as i have finish install and set everything its was to late.

ill do some more test tonight.
Im impress by you and your work.

One if not the one, of the best resource ive seen so far.

Did not have time either to test vehicule coords either…

Hostage when kill stop the mission… that is great
test and workingwould like to have same option for objective mission…
i tried to do it yesterday but the script doesnt work this way…

I still have a lot to test… be back tonight.
thx

Thanks. I have put a lot of time and energy recently into developing this, so glad you are enjoying it. Its good to have it thoroughly tested too, so I appreciate that.

With the random missions not working, double check that you did not create any errors from editing the files, but if the regular missions were still working at the same time… it might be something else.

yes ill double check everything again and ill look for error that i maybe did… by copy/pasting.
But as you said all other mission goes ok.

Its maybe something like bug if ressource is restart or /stop then… ect…
only test 2 time… soo…

As i create mission of type … Objective… and use it sometime like… go save 2 fisherman on an island… without any ennemy … it would be cool for objective mission to be able to use the hostage must be alive option… or objective failed too.

I love this new implantation as variety of possible mission making grow…

Also for Npc that attack with melle weapon.
didnt test it yet. But soo awesome…

Same for drivecoords… cohld have time but another implantation that multiple mission possibility.

all those with an eventual timer would get to another level…
exemple…
go desarming a bomb in the building before timer goes to 0… Possible mission without any npc involve…

An infinite kind of mission bing bang in my head.

Ill use random mission for simple mission task this way involving less npc as possible.

Good Job
thx

Ok, learned something new with painful trial and error. If you do a GetGroundZFor_3dCoord() on a location that you have not visited yet on the map… it will always return 0. If you go there, and call the function it works… if you then teleport to the other side of the map and call it again for the original location it will work. This was a bug I in my new random generator. Had nothing to do with variable scope.
I can probably make due without it, and use the center position of the spawn area elevation.
This what was causing my problems, which of course makes sense in hindsight, since that part of the map didnt exist then :stuck_out_tongue_winking_eye:

edit: of course the raytrace does not work either in this situation. I can see what Loque was talking about re: RequestCollisionAtCoord … Seems like there might be some tricks out there…
using that function. https://github.com/crosire/scripthookvdotnet/wiki/Code-Snippets

1 Like

Yes, I wonder if it might help to look at what others have encountered in similar situations. It strikes that the standard teleport to waypoint function of your average trainer script must have faced similar problem, at least with the ground check.

From what I have seen in these scripts when dealing with distant, unexplored locations, they sometimes use the RequestCollisionAtCoord, presumably to load some map data+ at those specified coordinates, and then use techniques to find groundZ by probing different ground heights. I’m not sure why this is necessary.




https://gist.github.com/speedium666/f707fb00a47371f4293ddcdd90bdafbd

2 Likes
    Peds = {
        {id = 1, modelHash = "S_F_Y_Stripper_02", x = -556.18, y = 297.73, z = 83.09, heading = 5.98, armor=5, friendly=true},

    },

    Vehicles = {
      -- ID: id of NPC | name: Name of Blip | BlipID: Icone of Blip | VoiceName: NPC Talk When near it | Ambiance: Ambiance of Shop | Weapon: Hash of Weapon | modelHash: Model | X: Position x | Y: Position Y | Z: Position Z | heading: Where Npc look
      {id = 1, id2 = 1, Weapon= 0x84bd7bfd, Vehicle = "nsx4", modelHash = "IG_TomEpsilon",ExtraPeds={{id=1,seatid=0}}, x = -549.84, y = 305.2, z = 82.46, heading = 263.03, drivingtocoord={ x = -1147.86, y = 4926.78, z = 220.52},driving=true,target=true},
    }
  },

Not sure why. He doesnt go to Destination Coords
First try of drivingtocoord and driving true.

remove the driving=true attribute. That makes the NPC driver drive randomly. See if that works.

good… thx.
ill do that after work.

lets say that my driver have a melee weapon… and is driving=true
Will he drive around looking for player to kill.

cause with the code i send ya… he is driving ramdomly but as soon as there is a player around he try to carkill… as he cant shoot us… and funny thing when close to a player… he do the middle finger…
This is epic…

200 post… :nerd_face:

1 Like