Particle System scripting

Users who are viewing this thread

ThaneWulfgharn

Master Knight
Hi,I was trying this script:
["teleport", "Teleport", [("crossbow_c",0)], itp_type_crossbow |itp_merchandise|itp_primary|itp_two_handed|itp_cant_reload_on_horseback ,itcf_shoot_crossbow|itcf_carry_crossbow_back,
683 , weight(3.75)|difficulty(10)|spd_rtng(37) | shoot_speed(70) | thrust_damage(63 ,pierce)|max_ammo(100000),imodbits_crossbow,
  [(ti_on_weapon_attack, [(assign,":distance",99999),(try_for_agents,":agent"),
                              (agent_is_alive,":agent"),
                              (agent_is_human,":agent"),
                              (agent_get_look_position, pos2, ":agent"),
                              (get_distance_between_positions,":dist",pos1,pos2),
                              (lt,":dist",":distance"),
                              (assign,":chosen",":agent"),
                              (assign,":distance",":dist"),
                            (end_try),
                              (agent_get_look_position, pos2, ":chosen"),
                              (particle_system_burst, "psys_white_orbs_1", pos2, 5000),
                              (particle_system_burst, "psys_orbing_glow_1", pos2, 5000),
                              (position_move_y,pos2,5000),
                              (position_set_z_to_ground_level, pos2),
                              (particle_system_burst, "psys_white_orbs_1", pos2, 5000),
                              (particle_system_burst, "psys_orbing_glow_1", pos2, 5000),
                              (agent_set_position,":chosen",pos2),],)]],
but I noticed some issues I need help fixing:
1st: psys_white_orbs_1 spawns in the place where the player is teleported,but on a very narrow area(in 1 single point).How do I largen this area?
2nd:psys_orbing_glow_1 wont burst up in the air and fade like it should but remains binded on 1 point on the ground.
3rd:How to make the player teleport not in the indicated distance,but on the place where a random bolt falls?
 
Particles always spawn from a single point. You can enlarge the mesh used or add multiple spawn points. The problem with the orbing_glow_1 not working must be from how the particle system is defined. Could you show the particle system code?
 
in module_particle_systems increase the emit box size and adjust the emit velocity. (0, 0, 2), will shoot the particles straight up

Use very small amounts of emit dir randomness to spread the particles out

Here's a simple teleport script. Use it for the crossbow bolts
    [(ti_on_missile_hit,
    [
#pos1 - Missile hit position
#param_1 - Shooter agent

(store_trigger_param_1,":shooter"),
(copy_position, pos63, pos1),
(position_set_y, pos63, 0),
#set agent position
(agent_set_position,":shooter",pos1),
                                              ]),
  ]],
 
ithilienranger said:
Particles always spawn from a single point. You can enlarge the mesh used or add multiple spawn points. The problem with the orbing_glow_1 not working must be from how the particle system is defined. Could you show the particle system code?

    ("orbing_glow_1", psf_billboard_3d|psf_global_emit_dir, "prt_mesh_fire_2",
    4, 100.0, 0.2, 0.0, 10.0, 0.0,    #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
    (-0.01, 1.0), (1, 1.0),          #alpha keys
    (0.0, 0.9), (1, 0.9),      #red keys
    (0.0, 1.1),(1, 1.1),      #green keys
    (0.0, 1.4), (1, 1.4),      #blue keys
    (0, 2),  (1.0, 2),        #scale keys
    (0.0, 0.0, 0.0),          #emit box size
    (0, 0, 0),                #emit velocity
    0.0,                      #emit dir randomness
    0,
    0
    ),

Edit:How to add multiple spawn points in your script?
 
Changing the emit box size is more efficient. Otherwise you need to create a loop to randomize the position and then emit the particles.

Try changing the emit box size to (1,1,0) so that particles should spawn in a 1 by 1 meter square. Then change the emit velocity to (0,0,1) so that it will move according to the global z-axis. You may need to experiment some but by changing these two fields you will get the desired result.
 
Back
Top Bottom