SphereCommunity
Are Beam FX Possible? - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Are Beam FX Possible? (/Thread-Are-Beam-FX-Possible)



Are Beam FX Possible? - Nachtmusique - 06-09-2016 03:24 AM

I know the normal effect command only does flying projectiles, but I'm wondering if anyone has been able to simulate beam type effect through sendpacket. Some examples of what I mean might be:

Character to Character lightning...
https://www.google.com/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=&url=http%3A%2F%2Fwww.confidentgamers.com%2Fumbra-is-funded-now-the-stretching-begins%2F&psig=AFQjCNENNmkGaOZSIPdUyMElJluOFczP3g&ust=1465492616356119

or

Collision-based flame throwers...
https://www.google.com/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=&url=http%3A%2F%2Fwww.gamewatcher.com%2Freviews%2Fmagicka-review%2F9407&bvm=bv.124088155,d.dmo&psig=AFQjCNGBjDM2zx83a5NXQd7eUVe7yvjrIQ&ust=1465492882419487

I know there was a Sphere shard a while back (back in the 55R days) that demoed a d&d style color spray that seemed to detect collision and fanned out in an arch, but I have no idea how they did it.

Any ideas on these types of character to character horizontal non-projectile effects? Would they be possible?


RE: Are Beam FX Possible? - rastrero - 06-22-2016 11:28 PM

I dont know how to do lightining player to player.I have been thinking about it for long time, but I dont find a good method.


Yes, You can do flame thrower though sendpacket, sending 4 o 5 explosions moving from src to a tile.

You cant do a real colision system through sendpacket, but you can check through sphere who is or will be in the respective tiles and damage them.
for example, if the flamethrower throw flames 3 tiles or 4 tiles away, just check the tiles 1 or 0,5 second after flame effect start.

I have to make a flamethrower.
If you make the sendpacket effect, I can do the colisión effect.


RE: Are Beam FX Possible? - Coruja - 06-23-2016 02:40 PM

you can't create an 100% custom effect, but you can play with current effects to simulate new styles, like this: https://www.youtube.com/watch?v=PrEZZ9EPhMM

as you can see on the video, these effects are the same single effect but sent hundred times on different positions. I highly doesn't recommend try the same of this video, because if you send an effect for every tile in an area of 20tiles² this will cost 400 packets just to play an single effect. This last fire effect on the video also cover an 40tiles² area, which is 1600 tiles = 1600 packets (!!!!)

and that's not all, it's 1600 packets for every player on the screen. If you have 10 players around, the server will send 1600 packets to each one of these players, and this will cost 16.000 packets. Just imagine how laggy this thing could be

of course if you send just a few 4~5 packets this won't cause too many lag and won't stress your server CPU/network. Still not recommended, but in this case that's ok. To make things simple, try use an single function that sends many packets 0c0 (graphical effect) based on custom args, like this:
FireEffect [effectType], [effectID], [color], [...]

Code:
[FUNCTION FireEffect]
FORCLIENTS 18
  SENDPACKET 0c0 B<ARGV[0]> D<ARGV[1]> D<ARGV[2]> W<ARGV[3]> ...
  SENDPACKET 0c0 B<ARGV[0]> D<ARGV[1]> D<ARGV[2]> W<ARGV[3]> ...
  SENDPACKET 0c0 B<ARGV[0]> D<ARGV[1]> D<ARGV[2]> W<ARGV[3]> ...
ENDFOR

you will also need to follow these rules to build the packet 0c0
http://docs.polserver.com/packets/index.php?Packet=0xC0

packets are very sensitive and a single wrong byte can make your client freeze/crash, so you must use B (byte) / W (word) / D (dword) sizes correctly:
-BYTE = 1 byte
-WORD = 2 bytes
-DWORD = 4 bytes