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.

Topics - Sebastian
1
Client Scripting / [Beta] Realistic Bullet Holes
« on October 16th, 2020, 03:30 PM »

https://www.youtube.com/watch?v=WixAU9OWt8w

Sorry for being late, but I've faced a surprise which is just amazing!
The Bullet Holes I told you about, won't be just local, but synced on everybody's screen !!
What ?? Yes!  And all just by client-side. (no data is sent to server)

(onPlayerShoot is called for everybody, not just for the local player)

I've set a limit for bullet holes, as we don't want to use too many resources.
(even if I'm not sure how hard will this hit some low-end pc)
So, if you face lag when playing alongside other players, reply to this post with your pc details, and according to the replies I get, I will try to find a way around to fix it.



How does it work ?
Well, it creates a sprite on the hit position, in client side.
With help from habi, sprites are rotated to be facing the player in the moment of shooting, so they won't look like ugly dots around.
Every player has a limit of 10 bullet holes that can create, so once the limit is touched, the first one created will be removed, and so on.

Sprites won't be removed, because:
Quote from MEGAMIND on October 14th, 2020, 07:24 AM
Suggestion : Donot let the holes fade away, it will bring more realism,  if anyone passes by he/she may see that someone here fought here before
But, as I said, if some players will start facing lag using this script, then I will rethink it and solve it out.
Meanwhile, big thanks goes to @habi for his math skills which I Iack alot !



That's all I guess, so I will just post the code which you need to use CLIENT-SIDE
Also, better save the "hole.png" and place it in server/store/sprites


TOP
Code: [Select]
const MAX_PLAYERS = 100;
llplayer <- World.FindLocalPlayer();

/* per player */
const MAX_HOLES = 10; // -1 for never removing holes, 0 for turning off the effect

local bulletTable = array( MAX_PLAYERS ),
holes = array( MAX_PLAYERS ),
last_hole_picked = array( MAX_PLAYERS );

bulletTable[ llplayer.ID ] = {};
holes[ llplayer.ID ] = 0;
last_hole_picked[ llplayer.ID ] = 0;

class leHole
{
    inst = null;
    ID = null;
}

Code: [Select]
function Player::PlayerShoot( player, weapon, hitEntity, hitPosition )
{
    if( hitEntity && hitEntity.Type == OBJ_BUILDING )
    {
CreateBulletHole( player, hitPosition );
    }
}

Code: [Select]
function CreateBulletHole( player, pos )
{
local ppos = player.Position;
if( MAX_HOLES == 0 ) return 0;
else if( !bulletTable[ player.ID ] )
{
// this means the 'player' was not registered by this client, yet
bulletTable[ player.ID ] = null;
bulletTable[ player.ID ] = {};
holes[ player.ID ] = 0;
last_hole_picked[ player.ID ] = 0;
}

local   hole,
id = holes[ player.ID ],
angle = atan2( pos.X - ppos.X, pos.Y - ppos.Y );

if( MAX_HOLES != -1 && holes[ player.ID ] == MAX_HOLES )
{
if( bulletTable[ player.ID ].rawin( last_hole_picked[ player.ID ] ) )
{
id = last_hole_picked[ player.ID ];
local lhp = id + 1;

hole = bulletTable[ player.ID ].rawget( id );
hole.inst = null;
bulletTable[ player.ID ].rawdelete( id );
holes[ player.ID ]--;

if( last_hole_picked[ player.ID ] == MAX_HOLES-1 ) lhp = 0;

last_hole_picked[ player.ID ] = lhp;
}
}

bulletTable[ player.ID ].rawset( id, leHole() );
hole = bulletTable[ player.ID ].rawget( id );
hole.ID = id;

hole.inst = GUISprite( "hole.png", VectorScreen( 0, 0 ) );
hole.inst.Alpha = 90;

hole.inst.AddFlags( GUI_FLAG_3D_ENTITY );
hole.inst.Set3DTransform( Vector( pos.X, pos.Y, pos.Z ),  Vector( -PI/2, 0, -angle ), Vector( 0.35, 0.35, 0.0 ) );
fixsprite( hole.inst );
centersprite( hole.inst );
holes[ player.ID ]++;
}

@habi 's magic
Code: [Select]
// habi's magic
function move( pos, distance, angle )
{
local newx = pos.X - sin( angle ) * distance,
newy = pos.Y + cos( angle ) * distance;
return Vector( newx, newy, pos.Z ); //assuming z more or less same.
}

function move2( pos, pangle, dis, angle )
{
return move( pos, dis, pangle + angle )
}
function fixsprite( sp )
{
local x = sp.Position3D,
rot = sp.Rotation3D,
size = sp.Size3D, //(pos,pangle,dis,angle)
newPos = move2( x, rot.Z, 1, PI );

sp.Position3D = newPos;
}
function centersprite( sp )
{
local x = sp.Position3D,
rot = sp.Rotation3D,
size = sp.Size3D, //(pos,pangle,dis,angle)
newPos = move2( x, rot.Z, size.X / 2, PI / 2 );

newPos.Z += 1.15;
sp.Position3D = newPos;
}

PS: If you find bugs, let me know!
2
Videos & Screenshots / Realistic Bullet Holes (prototype)
« on October 13th, 2020, 02:41 PM »

https://www.youtube.com/watch?v=DrgxRjJoHBo


https://www.youtube.com/watch?v=WixAU9OWt8w

Will definetely improve it and then release it for public.
4
Tutorials / [Blender] Lighting up buildings' windows
« on July 19th, 2020, 08:52 AM »

Just like R* did ?!
(click to show/hide)

Lately, I've been spending my time lighting up buildings for my server's map, because it was too dark.
(check the last seconds of the video to see what I'm talking about)

I recorded a video tutorial about it, maybe it will help some of you.

(click to show/hide)
Editing the textures in order to keep the windows only, and remove everything else, was cut from the full video.
It is something you can achieve through other softwares too - but I shown you the very basic way instead.


(click to show/hide)
Editing the textures is up to you and your skills.

Im gonna use a way that's basic and everyone can do.
For this, we gonna need TXD Workshop and  TXD Magic we already have.

This 222.txd is mine for such things. As you can see, this is howfinal products should look.
(so we remove everything and leave just what we wanna see lighted up in the darkness)

So, first, I'm gonna light up the textures.
I'm using PHOTOSCAPE because it is an easy software.

Now, here comes the "trick". We must create a copy of those textures, and edit them.
(but before, add "_lighted" sufix to your textures' names, so they don't conflict with the originals)

We gonna use the "alpha way". So, in the copies we created, we gonna paint with white everything we wanna keep visible in-game, and with black everything we wanna hide.

In order to make it look realistic, we should hide one/two windows, as rarely buildings have all lights opened.
(better to start with that idea - I just remembered now to tell you)

Ok, so we have done the first one; we move to the second one.

Also finished the second one. As I said, we make white just what we want to keep visible.

OH! totally forgot.
The black'n'white textures must be in .BMP format.
(we don't need .png for them anymore, so we delete them)

Now, comes the TXD Workshop trick. That software allows us to set an alpha variant for our texture.
( TXD Magic doesn't )

As you can see, both images mixed into one, and only the white part was kept visible.
So, we just open it now with TXD Magic. It reads it as a .png with transparency.
That's what we need.

So, all that matters is the result:
texture with transparency!


https://youtu.be/GQ-BZW1rE-M


https://youtu.be/6lZpSma5zlc

(click to show/hide)
Hello there!

Today I will show you my way of lighting up
buildings' windows !


--------------------
LONG STORY-SHORT
--------------------

In order to light them up, we will edit the original
object and remove everything else except windows.
Then, move the windows out of the building a bit, so
they won't interfere with each other. (nor with the LOD)
3rd step is to light them up through Blender.

--------------------
EXAMPLE
--------------------


Used:     MEd ( to export the object )
   Blender ( to edit the object ) with I/O DFF plugin!
   .TXD Magic ( to deal with .txd files )
   7zip ( to archive in .7z the files for vcmp )

__1st STEP_____________
We are going to export the object we wanna light up.
(using MEd)

__2nd STEP_____________
Once we got the .dff and .txd files, we can export the
needed textures out of the .txd (as .PNG)
(as I said, we need only the windows, so we will get rid of
the rest of the object, later)

The easiest and fastest way is to guess what textures
you need, by looking at the object itself and the .txd file.
(so you extract the textures you see)

__3rd STEP_____________
We take every texture apart and edit it.
(lighting up, cutting)
All we care about are the windows, so that's all we gonna
keep.
Ok, I did that in the pause, so here is the result.
(but I also kept the lighted up .png textures, because
Blender won't load textures with transparency)
((renamed the .dff and .txd as we don't need conflicts))

__4th STEP_____________
Load the object in Blender.
((
as we can see, there is no texture loaded.
Why ? because we also renamed the original textured.
We added the sufix "_lighted" so the model can't recognize it

We must set them, so we gonna look in the list of textures of
the model, and find our textures' names.

We found them, so now we have to remove everything else.
))

Now we need to select the faces we want to keep (windows part)
(( we select them with right-click and do multiple selection
by keeping SHIFT pressed down ))

Then separate them from the rest which we will delete later.
(( press 'space' key and write 'separate'.
Now, we have 2 objects. We can remove the other one
and keep the one we just created.
We can also remove anything else like collisions.
Those faces are all that matter ))

After that, we move the faces a bit.
(since we gonna spawn the new object in the same position
as our target object, we don't want them to interfere.
Just like R* did - see the image >no image< )


When we done with that, we must replace the textures with
the ones with more light on.
^ we already did that, earlier.

((
We must now paint the 'Vertex' of the object in bright white
otherwise, the object won't be bright.
they are lighted windows afterall; they must be as visible
as posible.
))

Then, we export the .dff
(( if you get such error, then there are some textures
registered but not used, with no textures, or something like
that. We just remove them ))


Done. The export gave no errors anymore.

__5th STEP_____________
We archive the .dff and .txd into an .7z with sufix "_unp"
(like "myname_unp.7z") and place it inside store directory.
Then we register the object inside store/objects/...here
(( use flag 8 for objects with transparency ))
And create a static object inside store/maps/...here

Now, since we did everything, we can join the server and
see our work ;p

Registering the object in store/objects/...here
Code: [Select]
<object id="0">
<flags value="8"/>
<collision type="none"/>
<texture path="night_windows.txd"/>
<model path="wshbuildws20_nt.dff" distance="1000" />
<time on="20" off="5"/>
</object>

Spawning the object as a static one, via .xml, in store/maps/...here
Code: [Select]
<item model="6000" name="wshbuildws20_nt">
<position x="-39.41270447" y="-1106.622192" z="14.09233856" />
<rotation format="axisangle" x="0" y="0" z="0.7071067691" angle="0.7071067691" />
</item>

5
Bugs and Crashes / [Bug/Crash] /recordkey crashing - no logs
« on May 24th, 2020, 02:52 PM »
As the title say, /recordkey seems to crash once you press a button.
@Xmair confirmed that it is not working in rel004 either.
6
Videos & Screenshots / Developer Preview Program v1.3
« on May 8th, 2020, 12:44 AM »

https://youtu.be/Amp7FejuxPo

Follow the instructions on the video!
7
Bugs and Crashes / [Bug] Checkpoints don't update properly
« on May 6th, 2020, 12:07 PM »

https://youtu.be/SkmpHU2mqfg

We need to change world. iD for them to update
9
Videos & Screenshots / in-game model editor
« on April 6th, 2020, 04:11 PM »
10
Support / Can't Join - Update Fail- Crash - Wiki Down
« on March 31st, 2020, 04:07 PM »
u04.vc-mp.org was fixed once and forever !
You can start using it again if you want.

Meanwhile, wiki is still down, so keep using: AdTec wiki (current) or Thijn wiki (outdated)







Tried to join a server from the list, but game didn't launch?

(click to show/hide)

Your Vice City is clean, Single Player works, but cannot join to any server?
Then your gta_vc.exe must be the wrong version!
You should use Version 1.0 .

If you have it, but it still not works, try this:
Try this patch: https://www.moddb.com/addons/gta-vice-city-patch-for-no-cd-v10

Credits for the fix find: @Rahil



Browser CRASH after UPDATE fail ?!

(click to show/hide)





https://www.youtube.com/watch?v=1HCpXuxa2ss

Getting CRASH after VC:MP updater fails ? SEE THIS!

I think the problem is the updater link only, so we need a working one: Thijn's !
But, in order to change it, we need to open browser, which we can't.
This being said, you can change Settings.uft file with mine, which have fixed update link.

https://www.mediafire.com/file/ae6urefhiuk25oc/Browser_Fix.7z/file

1.Go to %LOCALAPPDATA%\Vice City Multiplayer\browser
2.Replace Settings.uft with the one in archive!


After this change, you must set your Nickname and VC's path again.



Facing this error?
or
Cannot access the masterlist ?




The Update URL Link is down, for some reason, and will be back up when developers are back.
Until then, we are using a mirror link.
Go to Tools->Settings and change that Updater URL with: http://u04.thijn.ovh

Also the Masterlist URL has a mirror: http://master.thijn.ovh
BUT default Masterlist is working now, so you should stick to http://master.vc-mp.org !

All of this, thanks to @Thijn





PS:  Thijn also has a mirror for the wiki:    http://wiki.thijn.ovh



And here is the complete backup of wiki,  by AdTec!
http://wiki.adtec.ovh/

11
Videos & Screenshots / [dRiFt] Sebastian x Megamind
« on October 6th, 2019, 12:30 AM »
12
Tutorials / Record cool frames, all alone!
« on October 3rd, 2019, 11:58 AM »
Here is a short tutorial where I show and explain how you can record yourself,
from different angle, like somebody else is recording you !

There is no big deal, actually, but you can take one of the best frames. ;)
Keep Drifting! video was recorded just like that.

Long story, short ?
Just run 2 instances of VC:MP, in windowed mode, and start (fraps?) recording from the one with different angle.
Then return to your first screen where you have full control, and do your magic


https://youtu.be/U7pJ_pPAIVc (Embedding disabled, limit reached)
13
Vehicle Showroom / [cuban] Drifting Handling
« on October 3rd, 2019, 11:02 AM »

While I was working on the Hydraulics' Alternative, I've found some handling settings that improve Cuban's Drifting ability.
In the past, I've used only downloaded handling - but now, I got my own.

Why is mine better than others' ? Because mine can be used in any type of server. (even RPG)
It's not based on increasing speed to the vehicle, so it will not look out of space.
It fits any background!

(click to show/hide)
Code: [Select]
<?xml version="1.0" encoding="ASCII"?>
<vehicle>
<basic>
<type>car</type>
<name>Cuban Hermes</name>
<anims>null</anims>
<comprules>0</comprules>
<extraflags>0010</extraflags>
<wheelmodel>253</wheelmodel>
<wheelscale>0.700000</wheelscale>
<immunity>0</immunity>
</basic>

<aidata>
<class>ignore</class>
<freq>10</freq>
<level>7</level>
</aidata>

<colors>
<carcol>1,1</carcol>
</colors>

<audio>
<enginefarsample>273</enginefarsample>
<enginenearsample>9</enginenearsample>
<hornsample>0</hornsample>
<hornfreq>25400</hornfreq>
<sirensample>0</sirensample>
<sirenfreq>9800</sirenfreq>
<doorsounds>0</doorsounds>
</audio>

<handling>
<mass>2150.000000</mass>
<percentsubmerged>75</percentsubmerged>
<steeringlock>40.000000</steeringlock>
<seatoffset>0.260000</seatoffset>
<damagemultiplier>0.550000</damagemultiplier>
<value>10000</value>
<flags>00000102</flags>

<dimensions>
<x>2.100000</x>
<y>5.000000</y>
<z>2.200000</z>
</dimensions>

<centreofmass>
<x>0.000000</x>
<y>0.000000</y>
<z>0.200000</z>
</centreofmass>

<traction>
<multiplier>0.750000</multiplier>
<loss>0.750000</loss>
<bias>0.530000</bias>
</traction>

<transmission>
<numofgears>5</numofgears>
<maxspeed>160.000000</maxspeed>
<acceleration>25.000000</acceleration>
<drivetype>4</drivetype>
<enginetype>P</enginetype>
</transmission>

<brakes>
<deceleration>6.000000</deceleration>
<bias>0.540000</bias>
<abs>0</abs>
</brakes>

<suspension>
<forcelevel>0.800000</forcelevel>
<dampening>0.080000</dampening>
<upperlimit>0.250000</upperlimit>
<lowerlimit>-0.260000</lowerlimit>
<bias>0.500000</bias>
<antidive>0.450000</antidive>
</suspension>

<lights>
<front>1</front>
<rear>1</rear>
</lights>
</handling>

</vehicle>

+

Code: [Select]
vehicle.SetHandlingData( 9, 0.5 ); // Traction Multiplier
vehicle.SetHandlingData( 11, 0.6 ); // Traction Bias
vehicle.SetHandlingData( 14, 30 ); // Acceleration
vehicle.SetHandlingData( 17, 40 ); // Brake Deceleration

PS: For the bridge neons, credits go to @PerikiyoXD !
14
Videos & Screenshots / (shorter) Your turn! Keep drifting!
« on October 2nd, 2019, 01:37 PM »
REUPLOADED! jump to min1 - boring introduction

Playing with handlings, I got some good drifting one and started to play.
Wanted to check other players' videos about drifting, but guess what !?
There are not many, and not even that watchable.

What about provoking you guys to showoff your skills in drifting ?
@Hanney , you are not too old for this sh*t! Show us what you have got!

https://youtu.be/J8DJLu429Xs (Embedding disabled, limit reached)

PS: Waiting reply, Honney!
PS2: Will upload the handling later today.
15
Snippet Showroom / [finally] Hydraulics' Alternative ! v1.1
« on September 25th, 2019, 11:20 PM »
CREDITS:


Hydraulics' Alternative
"  I'm presenting you the future  "

Synced, enabled by a command, actioned by keys
Best alternative to Voodoo's Hydraulics, inspired by SA*
Customizable anti-spam is implemented, to avoid chaos-makers (or not :P )
NUMPAD 8, 5, 4 and 6 are used for Front, Rear, Left and Right leans.
Shift is used to increase vehicle's height.*

https://youtu.be/v8A8f9OCEe4 (Embedding disabled, limit reached)

(click to show/hide)
1.Registering locals, usually in the top of the script
Code: [Select]
local shift = BindKey( true, 0x10, 0, 0 );
local num8 = BindKey( true, 0x68, 0, 0 );
local num4 = BindKey( true, 0x64, 0, 0 );
local num6 = BindKey( true, 0x66, 0, 0 );
local num5 = BindKey( true, 0x65, 0, 0 );


/*     Hydraulics System done by Sebastian!     */
/*     Don't change the settings - too risky       */

local hyd_top = 2.4, // high level - actioned when pressing SHIFT - set 0 to remove the uppering (safer gameplay)
hyd_z = -0.1, // Centre of Mass Z
hyd_zl = 0.7, // Upper Limit variation -
hyd_lean = 1.4, // front lean
hyd_oplean = -1.4, // rear lean
hyd_side = 0.5, // right lean
hyd_opside = -0.5, // left lean
hyd_mark = -0.001, // trick
hyd_25 = array( 1000, 0 ), // had to do with the UpperLimit variation
hyd_ticks = array( 100, 0 ), // anti-spam of everyplayer
hyd_tickslimit = 600; // interval of time a player can bounce again (in miliseconds)

2. This goes under onPlayerJoin( player ) to reset player's ticks count
Code: [Select]
function onPlayerJoin( player )
{
hyd_ticks[ player.ID ] = 0;
}

3. This goes under onPlayerCommand( player, cmd, text )
Code: [Select]
switch( cmd )
{
case "hydraulics":
{
if( player.Vehicle ) return MessagePlayer( "[#00AAAA]Error - You must be driving a car!", player );
else if( player.VehicleSlot != 0 ) return MessagePlayer( "[#00AAAA]Error - Only the driver can action the hydraulics!", player );

local veh = player.Vehicle,
z = veh.GetHandlingData( 7 );

if( z != hyd_z )
{
veh.ResetHandlingData( 20 );
hyd_25[ veh.ID ] = hyd_zl;
veh.SetHandlingData( 20, hyd_25[ veh.ID ] );
veh.SetHandlingData( 7, hyd_z );

MessagePlayer( "[#00FFFF]Hydraulics were enabled !", player );
}
else
{
hyd_25[ veh.ID ] = 0;
veh.ResetHandlingData( 20 );
veh.ResetHandlingData( 7 );
MessagePlayer( "[#00AAAA]Hydraulics were disabled !", player );
}

veh.AddSpeed( Vector( 0, 0, 0 ) ); // used for the handling rule 24 to take effect
}
break;
}

4. Telling buttons what to do 8) via onKeyDown( player, key )
Code: [Select]
switch( key )
{
case shift:
case num8:
case num5:
case num4:
case num6:
{
if( !player.Vehicle ) return 0;
else if( player.VehicleSlot != 0 ) return 0;
else if( hyd_25[ player.Vehicle.ID ] == 0 ) return 0;
else if( ( GetTickCount() - hyd_ticks[ player.ID ] ) < hyd_tickslimit ) return 0;

local veh = player.Vehicle,
low = veh.GetHandlingData( 20 ),
val6 = veh.GetHandlingData( 6 ),
val5 = veh.GetHandlingData( 5 );

hyd_ticks[ player.ID ] = GetTickCount();
PlaySound( veh.World, 336, veh.Pos );

switch( key )
{
case shift:
{
if( low < hyd_top ) veh.SetHandlingData( 20, hyd_top );
else veh.SetHandlingData( 20, hyd_25[ veh.ID ] );

veh.AddSpeed( Vector( 0, 0, 0 ) );
}
break;

case num8: // front
case num5: // rear
{
if( low < hyd_top )
{
if( key == num8 ) return veh.SetHandlingData( 6, val6 + hyd_oplean );
else return veh.SetHandlingData( 6, val6 + hyd_lean );
}
else
{
veh.SetHandlingData( 20, hyd_25[ veh.ID ] + hyd_mark );
veh.AddSpeed( Vector( 0, 0, 0 ) );
if( key == num8 ) return veh.SetHandlingData( 6, val6 + hyd_lean );
else return veh.SetHandlingData( 6, val6 + hyd_oplean );
}
}
break;

case num4: // left
case num6: // right
{
if( low < hyd_top )
{
if( key == num4 ) return veh.SetHandlingData( 5, val5 + hyd_side );
else return veh.SetHandlingData( 5, val5 + hyd_opside );
}
else
{
veh.SetHandlingData( 20, hyd_25[ veh.ID ] + hyd_mark );
veh.AddSpeed( Vector( 0, 0, 0 ) );
if( key == num4 ) return veh.SetHandlingData( 5, val5 + hyd_opside );
else return veh.SetHandlingData( 5, val5 + hyd_side );
}
}
break;
}
}
break;
}

5. Last step takes us to onKeyUp( player, key )
Code: [Select]
switch( key )
{
case num8: // front
case num5: // rear
case num4: // left
  case num6: // right
{
if( !player.Vehicle ) return 0;
else if( player.VehicleSlot != 0 ) return 0;
else if( hyd_25[ player.Vehicle.ID ] == 0 ) return 0;

local veh = player.Vehicle,
low = veh.GetHandlingData( 20 ),
deflow = hyd_25[ veh.ID ];

if( low == ( deflow + hyd_mark ) )
{
veh.SetHandlingData( 20, hyd_top );
if( key == num8 || key == num5 ) return veh.ResetHandlingData( 6 );
else return veh.ResetHandlingData( 5 );
}
else
{
if( key == num8 || key == num5 ) return veh.ResetHandlingData( 6 );
else return veh.ResetHandlingData( 5 );
}
}
break;
}


PS: It could be a lot better/more real, but there is some bug happening due vc:mp or vc engine, so I couldn't use the method I've used in this video.
PS2: Not all vehicles will respond properly to this alternative, so be careful. Will try to find what's bothering other vehicles...
PS3: Because I was forced to use handling rule 24 instead of 25, vehicle can be more sensible when highered (after pressing shift). In order to remove the uppering, set hyd_top to 0 and that's it.