Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: [GoD]sinner on Jul 02, 2015, 05:35 AM

Title: same as privious topic about syncing
Post by: [GoD]sinner on Jul 02, 2015, 05:35 AM
Example: - Beach ball in a swimming pool in starfish island. If a person moves the ball from initial position to final position, he see's it in final position, but for other persons it appears in initial position.(It is not synced)

So i tried to create the ball with following command.

CreateObject(256,player.World,player.Pos.x+1,player.Pos.y,player.Pos.z,255);

The object created succesfully. But it is static and not moving at all. It is like a immovable rock.

Any ideas creating a ball in vcmp please

Regards,
[GoD]sinner


Title: Re: same as privious topic about syncing
Post by: DizzasTeR on Jul 02, 2015, 07:54 AM
I'm already working on it to make it alive using onObjectBump, the only other way is if vcmp gets the ability to create non-static maps which are synched and can be moved (eg. Objects like this ball )
Title: Re: same as privious topic about syncing
Post by: [GoD]sinner on Jul 02, 2015, 09:21 AM
Thank You For your reply Doom_killer
I Think if we get the id of the default object ball, and simply change its position on script load it will sync i think.
or
Is there any function like cloning the default object ball?
Title: Re: same as privious topic about syncing
Post by: DizzasTeR on Jul 02, 2015, 09:57 AM
Not exactly cloning, as I've said, currently the default game objects (like that ball ) are not synched between players which is why when you disturb the ball in your screen it remains the same for anyone else.

We will have to wait till VCMP gets support for such type of objects which  are synched and can be moved by touching them.

Otherwise you will have to give the ball motion indirectly by creating the ball using CreateObject then allow it to track bumps and using onObjectBump you code its motion.
Title: Re: same as privious topic about syncing
Post by: Sebastian on Jul 02, 2015, 04:04 PM
To create (workable) featured objects, even if some are not synced, you should use .xml .
(for objects like glass, beachball, boxes, etc)
Title: Re: same as privious topic about syncing
Post by: [GoD]sinner on Jul 03, 2015, 04:49 PM
Hey Guys,
I extracted beachball.txd and beachball.diff using gta med.
but i couldn't find the .col file.
i created beachball_unp.7z using only beachball.txd and beachall.diff.
and created Objects.xml
but on doing CreateObject (6000,0,FindPlayer(0).Pos,255);
nothing happened no object no errors.
but i crated beach ball using this:
CreateObject(526,0,FindPlayer.Pos,255);
Object created but cannot move it is like a rock.
Can some one tell me how to get the id of my created object.
so that i can do OnObjectBump command.
I mean i'm, stuck with how to find the object id.
Title: Re: same as privious topic about syncing
Post by: MacTavish on Jul 03, 2015, 05:52 PM
if (cmd == "cbb")
{
Bball <- CreateObject(526,0,player.Pos,255);
Bball.TrackingBumps = true;
}

In main.nut

function onObjectBump( object, player )
{
if ( object == Bball ) Bball.MoveTo(Vector(player.Pos.x, player.Pos.y+2,player.Pos.z),500);
}


I havent tried yet take a try

Edited
Title: Re: same as privious topic about syncing
Post by: DizzasTeR on Jul 03, 2015, 06:42 PM
MoveTo is not the function to use for this purpose., it will just move it upward, you need to use velocity.
Title: Re: same as privious topic about syncing
Post by: [GoD]sinner on Jul 04, 2015, 04:33 AM
Thanks for the Reply Guys,

I think the best way is to create ball in 3ds Max and add it to the game.
Title: Re: same as privious topic about syncing
Post by: Murdock on Jul 04, 2015, 04:15 PM
It would indeed be nice if objects marked with a object.Synced flag could be synced like vehicles, mainly dynamic objects like the beachball. However I think this has low priority for now, I do wish there were object attachment functions though
Title: Re: same as privious topic about syncing
Post by: DizzasTeR on Jul 04, 2015, 08:30 PM
Quote from: Murdock on Jul 04, 2015, 04:15 PMI do wish there were object attachment functions though

You're not alone with this wish, some day VCMP Santas will drop these presents for us, lets wait!
Title: Re: same as privious topic about syncing
Post by: [GoD]sinner on Jul 08, 2015, 05:14 AM
Guys Thank You for all your replies.

I tried modelling a ball with gmax, using max script downloaded from gtagarage to export.
but i get following error.

---------------------------
MAXScript Rollout Handler Exception
---------------------------
-- Runtime error: Feature not available: "fopen write mode"
---------------------------
OK   
---------------------------
Title: Re: same as privious topic about syncing
Post by: Thijn on Jul 08, 2015, 06:00 AM
Why would you make another ball when there's already a ball in the game? It just isn't synced at this time.
Title: Re: same as privious topic about syncing
Post by: [GoD]sinner on Jul 11, 2015, 01:03 PM
Thank You For your reply Thijn,
can please tell me how to sync the ball.
Title: Re: same as privious topic about syncing
Post by: DeViL_JiN on Jul 11, 2015, 04:53 PM
Quote from: [GoD]sinner on Jul 08, 2015, 05:14 AMGuys Thank You for all your replies.

I tried modelling a ball with gmax, using max script downloaded from gtagarage to export.
but i get following error.

---------------------------
MAXScript Rollout Handler Exception
---------------------------
-- Runtime error: Feature not available: "fopen write mode"
---------------------------
OK   
---------------------------

you need another executable called "GTAmax" to export the models, it comes with latest Kam's script , Goto Gmax Script folder and then move to "GTA_TOOLS" you will see a file called "GTAmax" run it and it will automatically launch GMAX, happy exporting and if you don't have "GTAMax" then search for it on google.