Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Sebastian
1
Bugs and Crashes / [not-a-bug] 2 custom generic.txd instead of one
« on April 11th, 02:57 PM »
This is not a bug, but it worths a mention.


So, if we want to use a custom generic.txd instead of VC's default, we can just place our "generic.txd" inside /store/maps/
But, if we gonna load custom objects which use generic.txd as a texture pack, we must place another copy of it inside /store/, so we end up having 2 exact same files, but in different locations... so more data to download.

It would be better to have it only once, and do both jobs.

PS: I also suggest a way for our /store/objects/.xmls to be able to load the default generic.txd, if there is no custom one, so custom objects will fit perfectly no matter what textures a player uses.
2
That was quick
3
@Leviosa did a custom radar, so maybe he can help.


I assume you want a custom map like the one you access through Main Menu -> Map.
4
10/10, and then I've seen this comment :(

and he is totally right.
5
Vehicle Showroom / [cuban] Re: Drifting Handling
« on March 15th, 09:01 AM »
UPDATE

The following settings will turn every car into a drifting car:
Code: [Select]
vehicle.SetHandlingData( 6, 0 ); // centre of mass Y
vehicle.SetHandlingData( 7, -0.2 ); // centre of mass Z
vehicle.SetHandlingData( 9, 0.5 ); // Traction Multiplier
vehicle.SetHandlingData( 11, 0.6 ); // Traction Bias
vehicle.SetHandlingData( 15, 52 ); // Drive Type = 4 wheels driving
vehicle.SetHandlingData( 14, 30 ); // Acceleration
vehicle.SetHandlingData( 17, 40 ); // Brake Deceleration
vehicle.SetHandlingData( 19, 40 ); // Steering Lock

Please, keep in mind that every car will mostly have it's own unique behaviour.
If you want it to behave exactly like the Cuban, then just import Cuban's handling and that's it.
(but not all cars look good with that handling, so that's why I shared the above settings)


Happy Drifting!
6
Client Scripting / About compiled scripts
« on March 15th, 01:17 AM »
Everything you need to know about compiled client-side scripts!


It is posible since rel004 2017-05-24 Update
Quote from Stormeus
Added support for loading precompiled client-side scripts (i.e. .cnut files). These must be compiled on a 32-bit Squirrel instance.


In order to make it work, you have 2 options:
(click to show/hide)
1. Multiple scriptfiles - you must give up on calling constants/enums from other files except the ones they are used in.

You are declaring const MAX_PLAYERS=50; in main.cnut and then later trying to call it from utils.cnut. The constant MAX_PLAYERS won't be recognized, and that's why it will throw the following error:
Code: [Select]
AN ERROR HAS OCCURRED [the index '<constant name>' does not exist]
Also, don't forget to use :: prefix when you call global variables from different scriptfiles.
(click to show/hide)
2. One BIG main file - merge all scriptfiles into one

Doing this way, you won't be needed to avoid constants/enums.
But, be aware of dofile/include functions. They will still call the files they are supposed to.
So I suggest you to create your own function, like I did, and just change a constant:

Code: [Select]
const wayLoadScripts = 0;
function include2( path )
{
          if( wayLoadScripts == 0 ) return 0;
          else include( path );
}

@DizzasTeR 's worthy mention:


Tools:
to compile .nut into compiled .cnut (or whatever format you like)

Note:
When you use compiled scripts, you may notice the following warnings and error in debuglog.txt:
Code: [Select]
MSG: <filename> line = (1) column = (1) : error expression expected
Warning in CScriptFunctions::DoFile: (script/<filename>.cnut) expression expected
Warning in CScriptFunctions::DoFile: Attempting bytecode read of file.
Don't worry, it is not a problem. The client just tries to read the file as uncompiled first.

MSG: Scripts initialised.
7
Videos & Screenshots / The Last Station
« on March 12th, 02:02 AM »
8
Community Plugins / Re: create bots with this plugin
« on March 12th, 12:34 AM »
Yeah, indeed.
Also, meanwhile, @SLC enumerated few reasons why a file size can be different, even if with the almost same code:


Don't take it personally, but it was too strange for me :)
9
Community Plugins / Re: create bots with this plugin
« on March 11th, 11:00 PM »
Quote from SexAppeal on March 5th, 08:14 AM
A recommendation from me would be to add a condition when the player executes a plugin command, I have tested these commands on my server and I realized that they were available to all players who were not developers or administrators, so I modified the plugin so that only administrators can use it, to test use the function VCMP-> IsPlayerAdmin (playerid), in the game it would be a question of putting player.Admin = true;
If you added just a checker, why is your file's size so different than @habi 's ?!

10
Videos & Screenshots / Re: Ctb X Scam 1992 Montage
« on March 11th, 06:29 PM »
I can see the effort there.
You did the job - it was entertaining to watch ;)

Good luck !

PS: What video editor did you use ?
11
Off-Topic General / Re: TCP Gaming Forum
« on March 11th, 10:15 AM »
12
Vehicle Showroom / [.xml] Re: Tricks, Discoveries and Joy
« on March 8th, 01:11 PM »
just reminded 5.this here too, because is the right place too.
13
Tutorials / [work-around fix] Custom Vehicles return no handling
« on March 8th, 12:59 PM »
If you have ever added a custom vehicle in your server, and later tried to edit it's handling, you know for sure that
Custom Vehicles return no handling data

This happens because server is not taking the info out of yourcars.7z, so it will always return 0 when tring to read some handling rule/data.
If you played long enough with handlings, you could notice that once you vehicle.SetHandlingData, then vehicle.GetHandlingData will return the value you just setted earlier.

So what this means? We must load the handling everytime we create a new vehicle, no ?
No.

There is SetHandlingRule which sets the handling of the model and not the vehicle instance!
"Yeah, but we knew this already. What's the thing with it?!"
Well, here comes the magic. If you set it once, then all the vehicles with that model will get the wanted handling, and return the correct values whenever using GetHandlingRule( model, rule ) or vehicle.GetHandlingData( rule ).

(the work-around) Personally, I'm setting all the Handling Rules when server stars. This way, no matter when I want to create a new vehicle during the gameplay, it will get the presetted handlings by "default", and I will be able to play with it's handling data however I want.
Even vehicle.ResetHandlingData( rule ) will return back to the value you setted through SetHandlingRule( model, rule, val ), so it is a very safe alternative.

Here is a function example of how it should work:
Code: [Select]
function RegisterHandling( model, path )
{
    print( "Registering handling " + model + " from " + path );

        local file = ReadTextFromFile( path );
       
        local   bias = GetBetweenEvery( file, "<bias>", "</bias>" ),
                x = GetBetweenEvery( file, "<x>", "</x>" ),
                y = GetBetweenEvery( file, "<y>", "</y>" ),
                z = GetBetweenEvery( file, "<z>", "</z>" ),
                drivetype = GetBetween( file, "<drivetype>", "</drivetype>" ),
                enginetype = GetBetween( file, "<enginetype>", "</enginetype>" );

        if( drivetype == "4" ) drivetype = 52;
        else if( drivetype == "F" ) drivetype = 70;
        else if( drivetype == "R" ) drivetype = 82;

        if( enginetype == "P" ) enginetype = 80;
        else if( enginetype == "D" ) enginetype = 68;
        else if( enginetype == "E" ) enginetype = 69;
       
        SetHandlingRule( model, 1, GetBetween( file, "<mass>", "</mass>" ).tofloat() );
        if( x.len() == 2 )
        {
            // dimensions
            SetHandlingRule( model, 2, x[0].tofloat() );
            SetHandlingRule( model, 3, y[0].tofloat() );
            SetHandlingRule( model, 4, z[0].tofloat() );

            // centre of mass
            SetHandlingRule( model, 5, x[1].tofloat() );
            SetHandlingRule( model, 6, y[1].tofloat() );
            SetHandlingRule( model, 7, z[1].tofloat() );
        }
        else
        {
            SetHandlingRule( model, 5, x[0].tofloat() );
            SetHandlingRule( model, 6, y[0].tofloat() );
            SetHandlingRule( model, 7, z[0].tofloat() );
        }
        // SetHandlingRule( model, 8, GetBetween( file, "<percentsubmerged>", "</percentsubmerged>" ).tofloat() ); // at the moment, it is buggy to set this value. (vehicles will teleport when touching water)
        SetHandlingRule( model, 9, GetBetween( file, "<multiplier>", "</multiplier>" ).tofloat() );
        SetHandlingRule( model, 10, GetBetween( file, "<loss>", "</loss>" ).tofloat() );
        SetHandlingRule( model, 11, bias[0].tofloat() );
        SetHandlingRule( model, 12, GetBetween( file, "<numofgears>", "</numofgears>" ).tofloat() );
        SetHandlingRule( model, 13, GetBetween( file, "<maxspeed>", "</maxspeed>" ).tofloat() );
        SetHandlingRule( model, 14, GetBetween( file, "<acceleration>", "</acceleration>" ).tofloat() );
        SetHandlingRule( model, 15, drivetype.tofloat() );
        SetHandlingRule( model, 16, enginetype.tofloat() );
        SetHandlingRule( model, 17, GetBetween( file, "<deceleration>", "</deceleration>" ).tofloat() );
        SetHandlingRule( model, 18, bias[1].tofloat() );
        SetHandlingRule( model, 19, GetBetween( file, "<steeringlock>", "</steeringlock>" ).tofloat() ); // "<abs>", "</abs>" ).tofloat() );
        SetHandlingRule( model, 20, GetBetween( file, "<forcelevel>", "</forcelevel>" ).tofloat() );
        SetHandlingRule( model, 21, GetBetween( file, "<dampening>", "</dampening>" ).tofloat() );
        SetHandlingRule( model, 22, GetBetween( file, "<seatoffset>", "</seatoffset>" ).tofloat() );
        SetHandlingRule( model, 23, GetBetween( file, "<damagemultiplier>", "</damagemultiplier>" ).tofloat() );
        SetHandlingRule( model, 24, GetBetween( file, "<upperlimit>", "</upperlimit>" ).tofloat() );
        SetHandlingRule( model, 25, GetBetween( file, "<lowerlimit>", "</lowerlimit>" ).tofloat() );
        SetHandlingRule( model, 26, bias[2].tofloat() );
        SetHandlingRule( model, 27, GetBetween( file, "<antidive>", "</antidive>" ).tofloat() );
        SetHandlingRule( model, 28, ("0x" + GetBetween( file, "<flags>", "</flags>" )).tofloat() );
        SetHandlingRule( model, 29, GetBetween( file, "<front>", "</front>" ).tofloat() );
        SetHandlingRule( model, 30, GetBetween( file, "<rear>", "</rear>" ).tofloat() );
        SetHandlingRule( model, 31, 0.0 );
        SetHandlingRule( model, 32, 0.0 );
        SetHandlingRule( model, 33, 0.0 );
        print( ". Loaded handling for " + model );
}

Example: RegisterHandling( 6400, "/XMLs/mycar.xml" );
I/O Functionality thanks to @SLC !

So, you must have your XMLs extracted out of the .7z archives, somewhere (e.g: server/XMLs/here) in your server files, for the server to access them.
Unfortunately, I don't know how to open an archive through script, to load them directly from inside. If you know how to, land a hand ;p

PS: The only thing you should not do is using ResetHandlingRule( model, rule ), because it will return to the 'default' value: 0
PS2: SetHandlingRule( model, 8, .. ) was commented due to a weird behaviour of the game.
( no matter what value you set it, the vehicle will get teleported to Vector(0,0,0) when touching th water )
(( in order to recover things back, just use ResetHandlingData/Rule( 8 ) ))


14
Servers / Re: Pure DM
« on March 5th, 06:45 PM »
Quote from gta5 on March 5th, 05:27 PM
03/03 - VPS failed
03/04 - Re-scripted 80%+ of the server


https://youtu.be/RJsGEiee-Ks
Oh boy,  I enjoyed the video so much!
Wish players would do more crazy videos like this
15
Vehicle Showroom / Bobster
« on March 3rd, 10:38 PM »
Took a look in some OLD files, since when @maxorator was just spoiling the custom vehicles' feature
AND FOUND THIS!
BOBSTER
(click to show/hide)


CREDITS: me