Stormeus

  • VC:MP Developer
  • oh god how did i get here im not good w computer
  • Posts: 1,128
Client Update for 0.4 Released (2017-05-24)
« on May 24th, 2017, 05:42 PM »Last edited on May 25th, 2017, 05:18 AM
A client update has been released for 04rel004.

Addendum
This update was reissued on 2017-05-25 in order to fix a regression where the GUI system would fail to initialize on some systems, causing a crash.
  • Added custom font loading. Windows font files can be placed in a new directory on the server, store/fonts/, and can then be used in GUIs.
  • Added ability to hide and show HUD elements. New client-side scripting elements have been added:
    • Hud.AddFlags(flags) — a function that enables a HUD element or multiple elements
    • Hud.RemoveFlags(flags) — a function that disables a HUD element or multiple elements
    • Hud.Flags — an integer representing the HUD elements enabled
    • Several constants:
      • HUD_FLAG_CASH
      • HUD_FLAG_CLOCK
      • HUD_FLAG_HEALTH
      • HUD_FLAG_WEAPON
      • HUD_FLAG_WANTED
      • HUD_FLAG_RADAR

    Examples
    • Hud.AddFlags(HUD_FLAG_CASH) — shows the cash HUD element
    • Hud.RemoveFlags(HUD_FLAG_CLOCK | HUD_FLAG_WEAPON | HUD_FLAG_RADAR) — hides the clock, weapon icon and radar all at once
    • if (Hud.Flags & HUD_FLAG_HEALTH) { /* ... */ } — runs code if the health HUD element is on screen
  • Added support for loading precompiled client-side scripts (i.e. .cnut files). These must be compiled on a 32-bit Squirrel instance.
  • Prepared to fix vehicle locking. This fix requires a companion server update which will be released in the coming days.
  • Fixed not being able to remove custom weapons from a player.
  • Fixed SMGs turning invisible when entering and exiting vehicles on servers with driveby disabled.
  • Fixed grenades disappearing from the player's hand after throwing one.
  • Fixed players with prostitute skins (24, 43, 70) uncontrollably trying to enter cars when other players entered or drove cars near them.
  • Fixed GUI elements being draggable after disabling the GUI_FLAG_DRAGGABLE flag.
  • Fixed the client crashing when picking an excessively long nickname in the browser.
  • Fixed player getting stuck in an attack loop when using some melee weapons while walking.
  • Fixed passengers being unable to dive out of fast-moving vehicles.
  • Fixed Listbox.RemoveItem hanging the game.
  • Fixed objects such as barrels at Vercetti's mansion being rendered like pickups.
  • Fixed remote players turning invisible and desynced after diving out of a moving vehicle that appears to explode for others.
  • Fixed the client crashing on disconnect if GUI listboxes are present.
  • Fixed /infgetmodelname and /infgetvehicleid showing incorrect results.
This update will take effect upon reloading the browser.

Doom_Kill3R

  • VC:MP Beta Tester
  • Infinite loops defy infinity by overflowing memory
  • Posts: 1,107

krystianoo

  • Jr. Member
  • STORMUS FIX LAG AND VEHICLE WEAPONS
  • Posts: 85

EK.IceFlake

  • Hero Member
  • "We are the champions my fellahs" - Sufyan/VK.SuFy
  • Posts: 1,761

Stormeus

  • VC:MP Developer
  • oh god how did i get here im not good w computer
  • Posts: 1,128
Re: Client Update for 0.4 Released (2017-05-24)
« Reply #4, on May 24th, 2017, 05:52 PM »
Quote from EK.IceFlake on May 24th, 2017, 05:50 PM
Quote from Stormeus on May 24th, 2017, 05:42 PM
  • Added support for loading precompiled client-side scripts (i.e. .cnut files). These must be compiled on a 32-bit Squirrel instance.
Screw you.
This is a technical limitation of the fact that the Squirrel runtime on the client, the client itself, and the game are all 32-bit applications. Running a 32-bit server (even if you're on a 64-bit system) and compiling from there works fine in my testing experience.

Anik

  • Sr. Member
  • Posts: 355

Casper

  • Jr. Member
  • Active Member
  • Posts: 85

Athanatos

  • Hero Member
  • Romania Cops N Robbers Lead Developer
  • Posts: 812

Xmair

  • Wiki Contributor
  • Posts: 880
VU Full Member | VCCNR Developer | KTB Developer | EAD Ex-Scripter

KAKAN

  • Wiki Contributor
  • Posts: 3,346
You can contact me using Discord, at Developers.CPP( check off-board to find the invite link )
Github: https://github.com/theKAKAN

EK.IceFlake

  • Hero Member
  • "We are the champions my fellahs" - Sufyan/VK.SuFy
  • Posts: 1,761
Re: Client Update for 0.4 Released (2017-05-24)
« Reply #10, on May 24th, 2017, 06:18 PM »Last edited on May 24th, 2017, 06:20 PM
Quote from Stormeus on May 24th, 2017, 05:52 PM
Quote from EK.IceFlake on May 24th, 2017, 05:50 PM
Quote from Stormeus on May 24th, 2017, 05:42 PM
  • Added support for loading precompiled client-side scripts (i.e. .cnut files). These must be compiled on a 32-bit Squirrel instance.
Screw you.
This is a technical limitation of the fact that the Squirrel runtime on the client, the client itself, and the game are all 32-bit applications. Running a 32-bit server (even if you're on a 64-bit system) and compiling from there works fine in my testing experience.
That was not what I meant.
Now I'll have to reverse engineer Squirrel and I already have so many projects on my stack that I'll have to wait quite a few months before I can sneak on any scripts again.

I copied my store folder over and now I have some scripts for hostage :D (no, I'm not about to leak them. that was a joke (the hostage part, the fact that I have them is real)).

Casper

  • Jr. Member
  • Active Member
  • Posts: 85

Cool

  • Hero Member
  • Posts: 719

.

  • VC:MP Beta Tester
  • .
  • Posts: 1,804
Re: Client Update for 0.4 Released (2017-05-24)
« Reply #13, on May 24th, 2017, 06:41 PM »Last edited on May 24th, 2017, 06:43 PM
Quote from Stormeus on May 24th, 2017, 05:42 PM
  • Added support for loading precompiled client-side scripts (i.e. .cnut files). These must be compiled on a 32-bit Squirrel instance.
There's just one question about that. How are we (excluding me since I can hijack the VM and perform an indirect save of the compiled closures) going to save the byte-code? Because I believe you have to be able to do that from the client itself. Probably an example is worth a thousand words:

Code: [Select]
Hud.AddFlags(HUD_FLAG_CASH)

In this case, `HUD_FLAG_CASH` is a constant. That means it must be available at compile time. And the way you describe the process is that we can compile scripts with the regular Squirrel compiler and simply instruct it to save the byte-code.

The issue here is that any other application that embeds the Squirrel language will be missing the these constants and the client API. So you'll be getting a bunch of "index XYZ doesn't exist" when you try to compile it on anything other than the client.

In this case there are two choices that I foresee. First, implement a function like the `Include()` one (or add an optional boolean parameter) that after compiling and loading a certain script, it'll save the resulted byte-code into a similarly named file, except with the letter `c` prefixed to whatever extension the initial script name had. Would avoid hard-coding the extension as .cnut in case some people (don't underestimate some people!) use the extension .cnut on the actual script.

The second one. Is to create a standalone compiler that mimics the client API. Which to be honest, seems like an undesired overhead on further development and an easy way to introduce bugs and outdated/mismatching API.

hashtag @Stormeus :P
.

SpitFire

  • Newbie
  • Posts: 5