How do I add particle effect to sword?

正在查看此主题的用户

Soleiraus

Regular
I'm not using the module system. How do I go about editing the particle systems txt file and adding the particle effect to a two handed sword? I want a flaming effect attadhed to a sword.
 
Well this can only be done with the module system.Then you got to download Mirathei's mod source code which helps very much.The file you are editing is module_items.py.You just  have to find the item you want and then paste the script under it.But I don't suggest the fire sword because people tried this before and it had awful results.
Hope this helps...
 
foxyman 说:
1011 does not support particle system on weapons.

It does, I tried it before.

Everytime the sword I chose was equipped, a fire particle covered it in flames. However, the game crashes when viewing the inventory. The game can't use particles in the inventory, while it is requested to do so. I've tried disabling the effect when "I" is pressed, but that still doesn't work when being forced to view it because of talking to a merchant. Pressing "I" while you can't view the inventory also screws up the whole "I" idea.

By the way, editing text files won't work. You'll need to edit scripts and add a trigger to a weapon.

Mirathei's mod source

That mod uses a trigger that triggers when an item fires (ti_on_weapon_attack),. There's also the (ti_on_item_equip), trigger which triggers when an item is equipped. The latter one is the one which you're going to need. Too bad it also triggers in the inventory making the game crash when using particles.

If you can get rid of it triggering in no go areas for particles, you got yourself a perfect possibilty to make a fire sword.
 
I have tried the native torch which was left from 808 but it is just a normal club holding in hand. Dunno how you get it work?
 
interesting, I also didn't think particle effects worked on melee weapons anymore in 1.x...  For the inventory issue, couldn't we just have a global variable $melee_particle_effect with a 0 or 1 value if it was enabled?  Then you'd just set it to active in the scenes you wanted it to work in?
 
In Expanded Gameplay III, when you die you get a "spirit mask" that burns... so I think it's possible, but I don't know how.
 
I think EGIII just attached the particle system to the agent, not to any equipment.
 
Adding it to equipment works fine too, just add it to the trigger of any weapon:

(damn, don't have the modsys here)

插入代码块:
*weapon*,
[(ti_on_init_item),
(try_begin),
    (troop_has_item_equipped,"trp_player","itm_youritem"),
    (get_player_agent_no,":player"),
    (agent_get_position,pos1,":player"),
    (try_for_range,reg999,0,500),
        (particle_system_burst,"psys_torch_fire",pos1,100),
    (try_end),
(try_end),
])]

This should work. What it does is setting the player on fire when 'youritem' is equipped.

Analysis:

- When this item initialises (is used in any window or scene), "(ti_on_init_item)" triggers.
- Script continues when "trp_player" has "itm_youritem" equipped. That should keep the script from making the game crash when a merchant's got it in his shop and you decide to click the trade button. We don't want particles in our inventory/trade window.
- Store the player in ":player".
- Store ":player" position in "pos1".
- Burst a torch fire 500 times at the players' position. (I just used a 'burst', an 'emit' should make it last)

EDIT: Torch fire is invisble because it's too small (it stays inside the player). Try using something bigger like psys_game_blood.
 
Torch flame is different from the script you gave, killkhergit. What we are talking about (I think at least me and HokieBT) is to burst the particles from the item, not the player. What you did is like what EGIII did. But you can never use this to make a flaming sword or a torch (What? A torch with its flame on your head?).
 
Why not alter fire position a bit before bursting, depending on direction the agent is moving?
Then you can still use small torch fire and make it appear not inside player but near the head, or even somewhere above right shoulder, where a torch should be placed
 
GetAssista 说:
Why not alter fire position a bit before bursting, depending on direction the agent is moving?
Then you can still use small torch fire and make it appear not inside player but near the head, or even somewhere above right shoulder, where a torch should be placed

As long as the agent or player is wielding the stick, your flame will look like floating.
 
I'll need particle effects for my mod too, but I can use the EG3 way of handling it. (fire elemental, locust swarm)
 
That's pretty much all there is to it.

You can manually change the position to the players' gloves, but it won't interract with movement.

If only there was a predefined position at the point where an agent wields his item...
 
Well, theoretically you can script fire position movement fitting currently playing animation :grin: Not worth the hassle ofc, I know.
On the other hand, if you make specific wielding animation for the torch, so that its tip stays fixed relative to player position... One does not usually swing torches, but carries them carefully and stable
 
I just wish we could do multi-mesh weapons like we used to do in previous versions..... It was so easy to make a glowing sword by just having two mesh's with different materials, shaders, textures, etc.
 
后退
顶部 底部