1

Topic: gsEffect for location instead of entity

gsEffect1 requires an entity id to render an effect on a player/monster location. It would be helpful if there was a way to render the effect at specified coordinates instead. This would allow for more varied effects, like replicating things like burning rain spell.

For implementation something similar to how sets of projectiles are fired.

Pseudo code:

gsEffectBegin(mapid);
gsEffectAdd(x1, y1, z, art);
gsEffectAdd(x2, y2, z, art);
gsEffectAdd(x3, y3, z, art);
gsEffectEnd();

2

Re: gsEffect for location instead of entity

This would be a good step forward for extensibility. I think the packet that handled spell effects would need to be restructured though to include X,Y data. Good idea is good.

Re: gsEffect for location instead of entity

Out of curiosity, which effects are you wanting to use?
fwiw, to do Burning Rain I'd need to add a number of other calls as well, such as 'is reachable' and 'can damage'. Normally there needs to be pathfinding between the caster and the target to do damage, for example.

4

Re: gsEffect for location instead of entity

I mostly wanted to just use this to create visual effects. Like in a fiery dungeon there could be trickles of burning rain falling, and Haggy could throw rocks (meteors) at players.

Ideally also something similar for creating a firewall tile, but that is done through some flags.

But yes, if I'm going to add/simulate spells through scripts then ways to validate the target would be really useful.

5

Re: gsEffect for location instead of entity

OK. After this week's server update,

gsMapEffect(map, x, y, z, effect, delay = 0) will be callable with 'effect' being the same as gsEffect1.

As to the effect numbers, they are the Art ID minus 30000.
So for example, fish jumping is effect 250, snowflakes are 213, blizzard is 200, etc.
The reason to restrict them at all (instead of using Art ID directly) is that the state graph of most pieces of art doesn't work for effects anyway.

The delay is optional and in milliseconds, for timing multiple effects against each other. No guarantee the packets won't get sent at different times, so it's somewhat imperfect for now.

6

Re: gsEffect for location instead of entity

gsMapEffect works pretty well. Will be great for atmospheric effects etc.
(I tried it with a few hundred effects at once and it did all right. Would cause lag if done too often, but it's fun to play with.)
(Just don't do effects like shield. They don't actually terminate, lol. Oops...)
I made an example script james1 if you want to exec and try it.

7

Re: gsEffect for location instead of entity

Great, I'll go play with it.

8

Re: gsEffect for location instead of entity

Nice!

Can this utilize some of the unused animations like the holy strike art, smoke puff, arrow overlays (for small projectile, shrapnel, etc. uses). Or, does it have to be an animation that is also a spell ?

9

Re: gsEffect for location instead of entity

Yes for the smoke puff (try exec spy124). We can pretty much use anything that is considered an effect. The delay feature is also pretty neat for creating visual effects.

The arrow overlays are bit different, they have no real end to their animation so they just stay there on screen forever. Can't use them as regular projectiles either.

10

Re: gsEffect for location instead of entity

lol, spy124 is awesome! I like how it will path find around corners to hit your target. This is similar to how I imagined those short range directional spells would work (the sith lightning thing we spoke about) but more limited range. Though, that is quite a different effect than anything we have.

It would be nice to have it as a particle effect integrated into scripting, because you could add in even more visuals. Maybe particles already is part of scripting, but I doubt it can handle directional projectiles?

In any case, those arrow overlay effects could be really versatile even not as overlays to arrows if we could incorporate projectiles somehow as an effect.

11

Re: gsEffect for location instead of entity

We do have particle support in scripts, gsParticle(mapid, x, y, z, pnum, time). Not too sure if the client actually supports them. They are fixed to a location though, currently no way to have particles follow a projectile for example. Would be a neat thing to have.

If Zer could add those overlays for projectiles as well then we could use them as such.