kennedyarz

  • Sr. Member
  • Making American Great Again
  • Posts: 334

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 #16, on May 24th, 2017, 07:07 PM »
Quote from . on May 24th, 2017, 06:41 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
Which means we're safe for the time being.
:)

KAKAN

  • Wiki Contributor
  • Posts: 3,346
Re: Client Update for 0.4 Released (2017-05-24)
« Reply #17, on May 24th, 2017, 07:43 PM »Last edited on May 24th, 2017, 07:45 PM
print the string, it'll be saved in the server logs :D
:edit: Oh, I guess VCMP won't recognize those characters and won't save it :P
The other way is to somehow save it to the debuglog file, which might store those characters. But, then,. TXT, notepad might remove it :P
You can contact me using Discord, at Developers.CPP( check off-board to find the invite link )
Github: https://github.com/theKAKAN

luchgox

  • Full Member
  • Posts: 146
Strength does not come from wining.Your struggles develop your strengths.

PunkNoodle

  • Full Member
  • Posts: 158
Re: Client Update for 0.4 Released (2017-05-24)
« Reply #19, on May 24th, 2017, 07:55 PM »
Code: [Select]

 __           __  _   _  ___   ___  ____      _ __   ___  __           __
 \ \   ___   / / | | | |/ _ \ / _ \|  _ \    / \\ \ / / | \ \   ___   / /
  \ \ / _ \ / /  | |_| | | | | | | | |_) |  / _ \\ V /| |  \ \ / _ \ / /
   \ \ (_) / /   |  _  | |_| | |_| |  _ <  / ___ \| | |_|   \ \ (_) / / 
    \_\___/_/    |_| |_|\___/ \___/|_| \_\/_/   \_\_| (_)    \_\___/_/   
                                                                         

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 #20, on May 24th, 2017, 08:02 PM »
Quote from KAKAN on May 24th, 2017, 07:43 PM
print the string, it'll be saved in the server logs :D
:edit: Oh, I guess VCMP won't recognize those characters and won't save it :P
The other way is to somehow save it to the debuglog file, which might store those characters. But, then,. TXT, notepad might remove it :P
Which string?

Zeeshan.Bhatti

  • Full Member
  • Posts: 213

MatheuS

  • Wiki Contributor
  • LBR | Co-Leader & Brasil Real RPG | Developer
  • Posts: 450
Re: Client Update for 0.4 Released (2017-05-24)
« Reply #22, on May 24th, 2017, 08:40 PM »
Quote from PunkNoodle on May 24th, 2017, 07:55 PM
Code: [Select]

 __           __  _   _  ___   ___  ____      _ __   ___  __           __
 \ \   ___   / / | | | |/ _ \ / _ \|  _ \    / \\ \ / / | \ \   ___   / /
  \ \ / _ \ / /  | |_| | | | | | | | |_) |  / _ \\ V /| |  \ \ / _ \ / /
   \ \ (_) / /   |  _  | |_| | |_| |  _ <  / ___ \| | |_|   \ \ (_) / / 
    \_\___/_/    |_| |_|\___/ \___/|_| \_\/_/   \_\_| (_)    \_\___/_/   
                                                                         
Code: [Select]
if( !sucess ) tryAgain();

Zurix

  • Sr. Member
  • Grand Theft Co-op Developer
  • Posts: 270

Castagna

  • VC:MP Beta Tester
  • Posts: 40

jUan*

  • New Member
  • Posts: 2

Radon

  • Full Member
  • Posts: 165

aXXo

  • Full Member
  • Posts: 164
Re: Client Update for 0.4 Released (2017-05-24)
« Reply #27, on May 24th, 2017, 10:56 PM »
Quote from jUan* on May 24th, 2017, 09:41 PM
cool and mind fixing ghost shots so they're able to be made as they were back in the older versions? :D
you mean breaking?
Ghost shooting was a game breaking bug, which ruined game modes where ammo is limited. I'm glad it is hard to pull off in 0.4

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 #28, on May 24th, 2017, 11:20 PM »
Quote from . on May 24th, 2017, 06:41 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:

<snip>
The Squirrel bytecode compiler does a bit less work than you think. compilestring/writeclosuretofile work fine when compiling client-side scripts on a server or even a generic compiler like squirrel's sq program. The reason for that is when compiling the program, Squirrel is only checking for syntactic correctness, and will not try to resolve or execute any constants or functions until the compiled bytecode is actually run.

Sebastian

  • VC:MP Beta Tester
  • Something like this: hga hga hga
  • Posts: 951
Re: Client Update for 0.4 Released (2017-05-24)
« Reply #29, on May 25th, 2017, 08:44 AM »
Quote from Stormeus
    Prepared to fix vehicle locking. This fix requires a companion server update which will be released in the coming days.
Ugh, I will need to update the blank server...

(click to show/hide)
BUT I'm totally ok with it ! :D
Welcome back, and thanks for the update !

I have some wonders though: will setting custom vehicles' handling be posible with this next server update ?