[REQ] Particle Effects Help

All development of pixel art, maps and other graphics.


Post Reply
User avatar
yourmistakes
Knight
Knight
Posts: 695
Joined: 05 Dec 2009, 06:08
Location: North Korea
Contact:

[REQ] Particle Effects Help

Post by yourmistakes »

asking for help with particle effects from anyone who knows how to handle them on tA. time is of the essence here since it's for an event scheduled to start very soon. we're looking for a number of unique and graphically unintensive effects. these effects should be called on the usage of an item.
nmaligec
Warrior
Warrior
Posts: 253
Joined: 08 Apr 2010, 01:55

Re: [REQ] Particle Effects Help

Post by nmaligec »

I'm not too knowledgeable in the area of item commands, but you said time is important and there are still no replies.

First thing, do you know how to add an effect to an item? As I said I don't know much about items, so when I first saw this post I thought maybe there might have been an xml attribute that could be set in the items.xml file. After looking around a bit I did not find anything like this. My second thought was to use the misceffect or specialeffect2 script command inside the UseScript section of the item_db.txt file. Neither misceffect (with and without specifying the player name) nor specialeffect2 (which automatically should work on the invoking player) displayed the effect.

If someone knows how to get around this then doing the particles is easy and even I can help you with that.
User avatar
Bertram
Manasource
Manasource
Posts: 1026
Joined: 07 Sep 2004, 14:55
Location: France

Re: [REQ] Particle Effects Help

Post by Bertram »

Hi,

I can give a hand on the client part, which is described here if you want to have your own tries:

http://doc.manasource.org/particle_system
http://doc.manasource.org/sprite_system
http://doc.manasource.org/items.xml

The core XML node to add is this one:
<particlefx>graphics/particles/my.particle.xml</particlefx>

Example (taken from an actual case in items.xml):

Code: Select all

<item id="1244"
        image="generic-iten.png"
        name="Dark Talisman"
        description="A small cube. It radiates unimaginable power, and is quite dizzying to look at."
        effect="Unimaginable powers to a successful wielder."
        type="equip-torso"
        >
        <sprite>equipment/override/skeleton.xml</sprite>
        <particlefx>graphics/particles/wisp.particle.xml</particlefx>
</item>
Good luck into adding this!

Best regards.
User avatar
Freeyorp101
Archivist Prime
Archivist Prime
Posts: 765
Joined: 04 Nov 2008, 09:17
Location: New Zealand

Re: [REQ] Particle Effects Help

Post by Freeyorp101 »

While this probably isn't relevant anymore judging from IRC backlogs, I'll archive this here for future reference.

Persistent particle effects defined client side through setting block-id in status-effects. The block-id, refers to the bits within each of the option variables stored server side (excepting opt3) and transmitted to all clients whenever they enter visible range of a given entity. While most often done with status effects (see poison effect, iron potion effect, concentration potion effect etc), these bits can be set elsewhere, for instance various hackery to display the heal effect, and another bit is set aside for the dark aura effect used by the dark talisman. The latter seems closer to what you appear to be wanting, but there are unfortunate limitations (as there is no unequip script to run, the effect persists even after the dark talisman is unequipped (though logging in and out again clears such non persistent (eg. not an option state, such as hide or invisible) states)). It is advisable to use opt2 (opt3 is not broadcast and is also not easy to debug due to limitations of @commands for this state) for this, unless you are well aware of the side effects of using opt1, or have a pressing need for the persistent storage provided by the limited option field.

Non persistent particle effects are trivial to do in any script - just use misceffect to broadcast to the effect id to everyone in sight range at that instant.


---Freeyorp
(09:58:17) < tux9th> Freeyorp: your sig on the forums is kind of outdated
nmaligec
Warrior
Warrior
Posts: 253
Joined: 08 Apr 2010, 01:55

Re: [REQ] Particle Effects Help

Post by nmaligec »

yourmistakes wrote:these effects should be called on the usage of an item.
I guess first I should ask for clarification on what type of item you want to add effects to. If its a one time use item or an equip item.

If it is an equip item, it is as easy as they said above. The only thing will be to settle on exactly what type of effect you want. Note, as stated above, the problem of the particles staying even after unequip.

For useable items, I cannot get them to display any effects by calling misceffect from inside the UseScript. I modified a LargeHealingPotion (and a few other items of type 0 and 3) by adding one of:
misceffect sfx_magic_life;
misceffect sfx_magic_life, strcharinfo(0);
I noticed that nothing seemed to have an affect inside the healing potion's script, even deleting the itemheal command didn't stop it from healing like it normally does! I could never use any type 3 item, even if I changed its type. All other modifications, at least to weapons, that I was making worked fine when I tested them. I don't have a clue as to whats up. So if someone else can test out a misceffect from inside UseScript or can attest 100% FOR SURE that it works, it would be very helpful.

edit:
Freyorp's post was very informative! I was wondering what was going on with some of the talisman's equip script.
Post Reply