Help on VCMP Scripting Limitations

Started by GangstaRas, Jul 30, 2017, 12:00 AM

Previous topic - Next topic

GangstaRas

I wanted some advice on this from the more experienced scripters of the community cuz I have many ideas but not much practical knowledge in the field. I don't want to waste time on a project that's virtually impossible. As such, I would like to know how possible these ideas are from any perspective (i.e. possible through scripting or some custom dll, a 3D model that I'll have to make or idk, forgive my ignorance). Also, please think very cleverly before saying any idea is impossible.

So how possible is it to:

  • Have an animated force field of sorts like a shockwave that can affect other players
  • Have a camera with a set angle range of view per axis (like being unable to look up in the sky but still free to rotate all around you)
  • Free view in a vehicle similar to spectating
  • Snap objects perfectly together when mapping (for like roads for example)
  • Have a custom hitmarker or dummy or whatever it is you would use to register that you're pointing at something that can be shot at
  • Making my own custom distortion effects (like the effect on screen when sending Phil to the hospital)
  • Have a compass of sorts pointing to a checkpoint
  • Make a player and vehicle intangible and/or invisible


Your postive feedback is greatly appreciated.

EK.IceFlake

Quote from: GangstaRas on Jul 30, 2017, 12:00 AMYour postive feedback is greatly appreciated.
This isn't eBay mate.

GangstaRas

Quote from: EK.IceFlake on Jul 30, 2017, 06:57 AM
Quote from: GangstaRas on Jul 30, 2017, 12:00 AMYour postive feedback is greatly appreciated.
This isn't eBay mate.
The question I pose is serious, so I'd ask kindly to keep it serious mate

Sebastian

99% of them are not posible, at least for now.
Rest is depending on vcmp devs, if they wanna make a function for turning free camera on.

Xmair

8- A vehicle can't be invisible but intangible.vehicle.IsGhost = true;A player can't be intangible but immortal and invisible.player.Immunity = 31;
player.SetAlpha( 0, 0 );

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

GangstaRas

Quote from: Sebastian on Jul 30, 2017, 05:17 PMRest is depending on vcmp devs, if they wanna make a function for turning free camera on.

I see. Thanks for this, but then now that makes me ask how do they make these functions that are available to us in the first place? Like a general idea of the process

Quote from: Xmair on Jul 30, 2017, 05:35 PM8- A vehicle can't be invisible but intangible.vehicle.IsGhost = true;A player can't be intangible but immortal and invisible.player.Immunity = 31;
player.SetAlpha( 0, 0 );

Good looking out Xmair, this is exactly what I needed. I appreciate it

Sebastian

Quote from: GangstaRas on Jul 30, 2017, 06:30 PMI see. Thanks for this, but then now that makes me ask how do they make these functions that are available to us in the first place? Like a general idea of the process

If I'm not wrong, in SP's Replay System you are able to rotate camera around, like we do in VC:MP in Spectate Mode.
So I assume they are just calling that function.

Too bad we don't have access to it.

Shadow

#7
Quote from: Sebastian on Jul 30, 2017, 05:17 PM99% of them are not posible, at least for now.
Rest is depending on vcmp devs, if they wanna make a function for turning free camera on.

Wrong.

1- Can be achieved using mathematical calculation (calculate number players within the radius of a circle center, apply a force or smth equal to a given calculation)
2- http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Functions/Player.CameraLocked , http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Functions/Player.SetCameraPos , do mathematics to control the camera according to your needs
3- similar to previous, may not be smooth due to the fact that you cannot extrapolate, smoothing algorithms are not efficient since it's a server function
4- keep an array of objects, calculate direction of movement and velocity of movement over time, snap according to a given threshold
5- create an object, track it's shots
6- doable with GUI, perhaps create random black squares/circles continously on the screen at random positions, have a function determine when to start and when to stop, it uses client scripting so it would not hinder server performance
7- make a GUI, unfortunately you cannot rotate 2D sprites/make a set of checkpoints to point you into the right direction



See how the pickups point to a certain direction
8- achievable through many means, .SetImmunity and change handling values for vehicles
QuotePS:is trash is ur home language??

Sebastian

#8
Hm, I've understood something else from his words, that's why my conclusion was so tragic.

this is what I understood:
1. I thought he needed some earthquake, so there was a need for ShakeCamera function
2. free camera to look around ped/car/pos just like in spectate mode, but unable to look above.
3. function used in spectating, but not left for us to use. (so devs need to port it)
4. this should be possible
5. "to register that you're pointing at something that can be shot at" so detecting if something is hittable without actual hitting it
6. he used the word "distortion" which is more than sprites. It's about playing with the visual by making areas on screen bigger/smaller/wider/thiner/how ever you want just to hurt/confuse your eyes
7. if I'm not wrong, devs added the ability to rotate sprites. If not, rotating text is possible so there should be a way.
8. XMair's work around


funniest
funny

GangstaRas

Quote from: Shadow on Jul 30, 2017, 08:16 PM1- Can be achieved using mathematical calculation (calculate number players within the radius of a circle center, apply a force or smth equal to a given calculation)
2- http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Functions/Player.CameraLocked , http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Functions/Player.SetCameraPos , do mathematics to control the camera according to your needs
3- similar to previous, may not be smooth due to the fact that you cannot extrapolate, smoothing algorithms are not efficient since it's a server function
4- keep an array of objects, calculate direction of movement and velocity of movement over time, snap according to a given threshold
5- create an object, track it's shots
6- doable with GUI, perhaps create random black squares/circles continously on the screen at random positions, have a function determine when to start and when to stop, it uses client scripting so it would not hinder server performance
7- make a GUI, unfortunately you cannot rotate 2D sprites/make a set of checkpoints to point you into the right direction



See how the pickups point to a certain direction
8- achievable through many means, .SetImmunity and change handling values for vehicles

Impressive, for the most part this has satisfied me well on what approaches to take but I'll need some clarification on some points:

1 - after the effect of the force is calculated, I'm having trouble picturing how to apply that back to an object in-game. Is there like a force function to feed all the data to or I'd have to just cleverly consider and manipulate an object's rotation and position properties? Also in your opinion would these force calculations cause issues to server performance if say it was a run under the chaos of 30+ players?

6 - this one is as Sebastian says. I'm more looking to have an effect that warps the screen as a means of confusion, not necessarily have spawning sprites blocking a view if I'm understanding you well

Shadow

#10
In response to above comment.

#1 - player.Speed is a member of the Player class. It takes a Vector and would work something like player.Speed = Vector( X, Y, Z );

I believe that the speed is manipulated by the client in the sense of deceleration (game processes friction and gravity client-side and sends the update to the server, correct me if I'm wrong) so you would have to fiddle with it until you get the desired result

If it does not fit your needs and you need something that only you can modify, you'd have to fiddle with onPlayerMove and create a vector like velocity or speed that permanently gets added to the position of the player and you'd have to manually process the deceleration every now and then when you want to. This introduces overhead, and, although feasible, it'd look like a major desync for even few players with pings over 30.

#6 - That, as you have said, exists in the game and you can achieve with setting the camera's rotation to tilt on a given axis (X for example) in an interval you might define as [min, max] and you make sure to clamp the rotation within these values. But as concerned, this would look sloppy because it's done server-side. I have yet to think of a solution to smoothen something like that and I am not sure that it's even feasible to do so.

In regard to your question. The server handles the updates of every player in packets of bytes per frame. That is a lot of stress and you don't have performance drops. As long as you code everything properly, things should work as intended. Just make sure your memory is fine (i.e: you incorporate good coding habits into your code)
QuotePS:is trash is ur home language??

EK.IceFlake

Quote from: Shadow on Jul 30, 2017, 10:47 PMIn response to above comment.

#1 - player.Speed is a member of the Player class. It takes a Vector and would work something like player.Speed = Vector( X, Y, Z );

I believe that the speed is manipulated by the client in the sense of deceleration (game processes friction and gravity client-side and sends the update to the server, correct me if I'm wrong) so you would have to fiddle with it until you get the desired result

If it does not fit your needs and you need something that only you can modify, you'd have to fiddle with onPlayerMove and create a vector like velocity or speed that permanently gets added to the position of the player and you'd have to manually process the deceleration every now and then when you want to. This introduces overhead, and, although feasible, it'd look like a major desync for even few players with pings over 30.
You can set the position of your own player with client-side scripts.

Xmair

player.Speed only works with Z axis

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

EK.IceFlake

Quote from: Xmair on Jul 31, 2017, 07:13 AMplayer.Speed only works with Z axis
It works with X and Y too once you are in mid-air.

GangstaRas

Another question that I have (I'm assuming this one is very possible based on what I'm seeing). I would like to also have the ability to tilt vehicles along each axis (x axis rotation would lean the front/back of vehicle up or down, y axis rotation would perform like a barrel roll, z axis is your typical north south east west compass rotation).

This tilt function would operate ONLY if the vehicle is in mid-air. This would be binded to key combinations. There's a way to detect if something is not in contact to the ground correct?