The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Are Beam FX Possible?
Author Message
Nachtmusique
Journeyman
*

Posts: 89
Likes Given: 0
Likes Received: 6 in 6 posts
Joined: Mar 2012
Reputation: 0



Post: #1
Are Beam FX Possible?
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=...2616356119

or

Collision-based flame throwers...
https://www.google.com/url?sa=i&rct=j&q=...2882419487

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?
(This post was last modified: 06-09-2016 03:24 AM by Nachtmusique.)
06-09-2016 03:24 AM
Find all posts by this user Like Post Quote this message in a reply
rastrero
Master
**

Posts: 250
Likes Given: 41
Likes Received: 28 in 24 posts
Joined: Jan 2016
Reputation: 3



Post: #2
RE: Are Beam FX Possible?
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.
06-22-2016 11:28 PM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #3
RE: Are Beam FX Possible?
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
06-23-2016 02:40 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 4 Guest(s)