16.09: Development Report

      16.09: Development Report


      Hi there! It has been mentioned that it is important for us to keep the community in touch with the latest changes we make. Here's a small peek of what has been implemented since the previous announcement!

      Shared peds have been added. This implementation lets you make your client-sided peds globally visible (as long as players can see the owner of the ped) and will be synchronised without any additional work. Being a basic version, this feature got a few limitations such as a lack of control server-side (as this implementation is based on the existing client-side mp.peds, however, scripters can wrap it into a server-side dummy entity).

      While you surely can use this to "make the traffic dream come true" (thanks to unoccupied vehicles synchronization introduced in 0.4 earlier, peds even can drive vehicles!), this implementation is purposed at making proper PvE game modes with AI involved (scripted missions? competitive game modes with enemy AI?). Shared peds API is pretty simple and does include only a few changes to mp.Ped class properties:

      • Added: boolean: ped.isShared (read-only for non-owners)
      • Added: boolean: ped.isOwned (read-only)
      • Added: mp.Player: ped.owner (read-only)
      • Added: number: ped.sharedId (read-only) (note that shared peds id system works per player so different peds owned by different players aren't supposed to have unique shared ids)
      • Added: Array: player.peds

      Here's a quick code example:

      mp.peds.new('mp_m_freemode_01', mp.players.local.position, 0, (ped) =>
      	// make it shared on stream in, you can't make a ped global if it's not physically created on our side yet
      	ped.isShared = true;
      	// apply some trivial scripting tasks, run animations or something similar
      	const targetPos = mp.players.local.position;
      	ped.taskGoStraightToCoord(targetPos.x + 10, targetPos.y + 10, targetPos.z, 1, 10000, 0.0, 0.5);
      	setTimeout(() =>
      		ped.taskHandsUp(5000, 0, 0xFFFF, true);
      	}, 10000);    

      ...and a video showing how it looks in the game for a local and remote player:

      Scripting (examples given in JavaScript, but changes applicable for other runtimes too)

      • Added: mp.events.addCommand, it works just like the server-sided one, but without player argument (local player should be considered instead, obviously) [client-side]
      • Updated: mp.game.invoke/player.invoke now supports 64-bit unsigned BigInt native identifiers (String ones are still supported too): [shared]
      player.invoke(0xB96B00E976BE977Fn); // New syntax (BigInt)
      player.invoke("0xB96B00E976BE977F"); // Legacy syntax (String)

      • Updated: client-side entity.model setter supports String value too (like server-side does)
      • Updated: 64-bit integer (BigInt) support has been added to local/remote events mechanism/shared variables
      • Added: rage::ILocalEventHandler introduced earlier got implemented for scripting VMs, adding next APIs: mp.events.addLocal, mp.events. callLocal (don't confuse with mp.events.call which triggers local events too, but only ones inside the local JS runtime):
      mp.events.addLocal("trigger_my_js_stuff_plox", (arg1, arg2) =>
          return new mp.Vector3(1, 1, 1);

      • JS runtime is now disabled when the server doesn't use any JS package (as people tend to forget to configure it)
      • JS runtime increasing the usage of newest V8 Engine features to avoid deprecated APIs


      • A deeper game clean-up with major game resources reloading on reconnect
      • New server config option: "instant-connections". It lets you, for example, join faster to your test server without the deep clean-up ("true" means 0.3 reconnect clean-up behavior)
      • New game load and resources download UI with server customization support to be added by next development progress report

      • Peds aren't invincible or frozen by default anymore
      • CEF dependency update: 3.3497 (Chromium 69)
      • NodeJS dependency update: 10.10.0