Agents

Users who are viewing this thread

bjorne.

Sergeant Knight
Well. I have been learning more and more about modding now. And I was once again trying to make a script for a hand grenade. But this time I made it from scratch. The only thing is... How do I made it to know who is who? I mean this is what I got so far.

        (try_for_agents,":agent"),
        (agent_set_hit_points,":agent",":hp",0),
        (deliver_damage_to_agent,":agent", ":agent"),
        (agent_set_animation, ":agent", "anim_fall_body_back"),

don't worry this isn't done yet. But for now. And I mean how should the green and the red lines know who to "engage" on?

Yea that was my question for today. So thanks for reading. And please help me!
 
Well it will try for all agents with the try_for_agents command.  So you have to use the process of elimination to eliminate anyone you don't want affected.  Your script as is right now will kill anyone and anything within the area of effect.  If you wanted to take friendly fire off you could use a command to check which team agents are on. Just make sure they aren't on yours before you kill them. At the very least you should use (agent_is_alive,":agent"),
These are some of the things I use to eliminate potential agents.
        (agent_is_alive,":agent"),
      #(agent_is_human,":agent"),
      (neq,":agent",":player_agent"),
      #(neg|agent_is_ally,":agent"),
The one thing I don't understand is this (deliver_damage_to_agent,":agent", ":agent"),  Who is damaging who here.  Is the agent damaging himself.  The call works but I wonder who gets the xp.

 
well I want everyone in the area to get damaged. Including the player and his allies.

Two questions

      1. How do I determin the effect area, of where the damage will be delt?

      2. You gave me a few code lines there and one of them was thing one.
     
Code:
      (neq,":agent",":player_agent"),
      What does it mean?



And... I don't know who gets the XP that is right  :sad:
 
Berserker Pride said:
Well it will try for all agents with the try_for_agents command.  So you have to use the process of elimination to eliminate anyone you don't want affected.  Your script as is right now will kill anyone and anything within the area of effect.  If you wanted to take friendly fire off you could use a command to check which team agents are on. Just make sure they aren't on yours before you kill them. At the very least you should use (agent_is_alive,":agent"),
These are some of the things I use to eliminate potential agents.
        (agent_is_alive,":agent"),
      #(agent_is_human,":agent"),
      (neq,":agent",":player_agent"),
      #(neg|agent_is_ally,":agent"),
The one thing I don't understand is this (deliver_damage_to_agent,":agent", ":agent"),  Who is damaging who here.  Is the agent damaging himself.  The call works but I wonder who gets the xp.

I'm working on a similar issue right now with a different question. But one thing I'm pretty sure of is that as your deliver_damage_to_agent is written, the agent is delivering the damage to himself. The first :agent is the one who is dealing the damage and the second one is the receiver. These should be able to be different agents. But like I said, I'm stuck around the same line of code myself at the moment.

Here's my thread in case it helps:
http://forums.taleworlds.com/index.php/topic,68897.msg1785605.html#msg1785605
 
Well I saw this part of your code and it attracted me alot.
(try_for_agents,":agent"),

(agent_get_position,pos2,":agent"),
(get_distance_between_positions,":dist",pos3,pos2),
(lt,":dist",325),
(neg|agent_has_item_equipped,":agent",434),
 
 
#delivering damage
(agent_set_hit_points,":agent",0,0), #change to real damage later  
(agent_deliver_damage_to_agent,
":thrower",":agent"),         (try_end)]),

I understand the red part. But the green part confuses me. Aswell as the purple does. So I gonna give you two questions.

1. What exacly does the Green part do?

2. Does the commando ":thrower" mean the one who ejects the projectile?
 
I'm hoping that's what it means, actually.

I used to program in BASIC back in the days when saying that meant something (self-deprecating chuckle) so I'm operating under the hopeful assumption that anything ":designation" can be called whatever we need it to be called. It only makes sense that we can call our :agents different things since otherwise agent_deliver_damage_to_agent wouldn't make any sense except for emo kids.

The green part is where I'm getting the radius of the fire blast, narrowing down targets to those within 325 units of the agent using the weapon. The bottom green line assures that no one equipped with that weapon can be damaged by its blast radius.

It actually functions in most scenarios (even with NPCs). The problem I'm getting to now is trying to find the identity of the agent using the weapon at the time,
#1: So he can get experience for any kills he gets with its area effect
#2: So I can identify what side he's on so he doesn't massacre his allies with friendly fire

If this were BASIC I think I could solve the problem with an "a = b" type expression, but I have yet to find the equivalent in Python. Then again I've only been doing this for a few days.
 
So basicly. By doing this in my code I will get the area damage around the projectile and I will make everyone around the blast to play the "anim_fall_body_back" animation. Is this correct?


Code:
      #Deliver Damage
        (try_for_agents,":agent"),
        (agent_set_hit_points,":agent",0,0),                     
        (agent_deliver_damage_to_agent,":thrower",":agent"),
        (agent_set_animation, ":agent", "anim_fall_body_back"),    
      #Radius
        (agent_get_position,pos2,":agent"),
        (get_distance_between_positions,":dist",pos3,pos2),
        (lt,":dist",325),               
 
Like I said before, I'm still trying to figure out whether or not I can call an agent :thrower. In order for me to be sure, I've got to find a way to narrow it down to the identity of that one specific soldier. This would be easy if it was the player (because there's a command for calling up your own ID), but I'm not making any player-specific weapons.

Also any of the lines with ":thrower" in them were kinky in my code. If you take out that section where I'm trying to ID the thrower and change ":thrower" to ":agent" at the bottom, it works great, only everyone's getting cred for killing themselves. Since that post I've been working with moving around the identification part.

But OK, to what you have there...

      #Deliver Damage
        (try_for_agents,":agent"),
        (agent_set_hit_points,":agent",0,0),                   
        (agent_deliver_damage_to_agent,":thrower",":agent"),
        (agent_set_animation, ":agent", "anim_fall_body_back"), 
      #Radius
        (agent_get_position,pos2,":agent"),
        (get_distance_between_positions,":dist",pos3,pos2),
        (lt,":dist",325),               

First off, things seem just a tad out of order here.
This might work better...

        (try_for_agents,":agent"),
        (agent_get_position,pos2,":agent"),
        (get_distance_between_positions,":dist",pos3,pos2),
        (lt,":dist",325),
        (agent_set_hit_points,":agent",0,0),                   
        (agent_deliver_damage_to_agent,":thrower",":agent"),
        (agent_set_animation, ":agent", "anim_fall_body_back"), 
        (try_end),

I haven't worked with animations yet (though I'm gonna have to to make 'em burn) but assuming animations are to be called after death, this should work fine, as long as we've been able to identify ":thrower" as our agent of destruction. Otherwise it seems to use any other available agent in the scene to do the damage (you have no idea how many times I've seen "Nord Footman killed by Townswoman" trying to figure this out).

Just remember too that this blast radius is going to be around the person throwing the weapon, not the weapon itself when it hits a target. I tried that and couldn't get it to work, so I settled for this "defensive shield" idea instead, hoping I'd be able to come up with a rational explanation for it later, haha

***EDIT***

I forgot to mention, this is suicide code, by the way, if it's put on a weapon!
It'll be perfect for a suicide bomber mod...
 
Well if you look at the Mount&Shotgun mod you will notice their grenades.

Code:
["nades", "Grenades", [("Grenade",0)], itp_type_thrown |itp_merchandise|itp_primary|itp_bonus_against_shield, itcf_carry_pistol_front_left|itcf_shoot_crossbow, 1650 , weight(3.0)|difficulty(0)|spd_rtng(90) | shoot_speed(25) | thrust_damage(10 ,blunt)|max_ammo(5)|accuracy(115),imodbits_none,
 [(ti_on_weapon_attack, [(play_sound,"snd_pistol_shot"),(position_move_x, pos1,27),(position_move_y, pos1,100),
 # (particle_system_burst, "psys_rocket_forward_smoke", pos1, 15),(particle_system_burst, "psys_rocket_backward_smoke", pos1, 15),
 
 
 
 
 #reset positions to 200 and 0
(position_move_x, pos1,173),(position_move_y, pos1,-100),
(position_move_z,pos1,-100),
                          (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),
                          (position_move_y,pos1,200),
                          (assign,":shell_burst",0),
                          (try_for_range,reg5,1,500),
                            (eq,":shell_burst",0),
                            (copy_position,pos2,pos1),
                            (val_mul,reg5,160),
                            (position_move_y,pos2,reg5),
                            (val_div,reg5,160),
                            (val_mul,reg5,reg5),
                            (val_div,reg5,2),
                            (val_mul,reg5,-1),
                            (position_get_z,":z1",pos2),
                            (val_add,":z1",reg5),
                            (position_set_z,pos2,":z1"),
                            (try_for_agents,":agent"),
                               (neq,":chosen",":agent"),
                               (agent_get_position,pos3,":agent"),
                               (get_distance_between_positions,":dist",pos2,pos3),
                               (lt,":dist",200),
                               (agent_set_hit_points,":agent",0,0),
                               (agent_deliver_damage_to_agent,":chosen",":agent"),
                               (position_move_y,pos3,150),
                               (particle_system_burst, "psys_game_blood", pos1, 150),
                            (end_try),
                            (copy_position,pos3,pos2),
                            (position_set_z_to_ground_level, pos3),
                            (position_get_z,":z1",pos2),
                            (position_get_z,":z2",pos3),
                            (le,":z1",":z2"),
                            (particle_system_burst, "psys_rpg_detonation", pos2, 15),
                            (play_sound,"snd_pistol_shot"),
                            (assign,":shell_burst",1),
                            (try_for_agents,":agent"),
                               (agent_get_position,pos3,":agent"),
                               (get_distance_between_positions,":dist",pos2,pos3),
                               (lt,":dist",450),
                               (agent_set_hit_points,":agent",0,0),
                               (agent_deliver_damage_to_agent,":chosen",":agent"),
                            (end_try),
                          (end_try),])]],

And there they called the thrower for ":chosen" maybe that is what you are searching for.

And about this:
Code:
        (try_for_agents,":agent"),
        (agent_get_position,pos2,":agent"),
        (get_distance_between_positions,":dist",pos3,pos2),
        (lt,":dist",325),
        (agent_set_hit_points,":agent",0,0),                     
        (agent_deliver_damage_to_agent,":chosen",":agent"),
        (agent_set_animation, ":agent", "anim_fall_body_back"),  
        (try_end),

It is for a Explosive barrel like a Scene_Prop. So will it still work? I mean for a Scene Prop? and another thing. Is there a way to set a specific amount of damage that the effect deals out?


#############EDIT##############

Aperartly it does. I runned the bad and this jumped up in my face.
Code:
Initializing...
Traceback (most recent call last):
  File "process_global_variables.py", line 11, in <module>
    from process_operations import *
  File "C:\Mount & Blade\Mod Editors\Offical\ModuleSystem\process_operations.py"
, line 24, in <module>
    from module_scene_props import *
  File "C:\Mount & Blade\Mod Editors\Offical\ModuleSystem\module_scene_props.py"
, line 1315, in <module>
    (try_for_agents,":agent"),
TypeError: 'tuple' object is not callable
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Traceback (most recent call last):
  File "process_map_icons.py", line 6, in <module>
    from process_operations import *
  File "C:\Mount & Blade\Mod Editors\Offical\ModuleSystem\process_operations.py"
, line 24, in <module>
    from module_scene_props import *
  File "C:\Mount & Blade\Mod Editors\Offical\ModuleSystem\module_scene_props.py"
, line 1315, in <module>
    (try_for_agents,":agent"),
TypeError: 'tuple' object is not callable
Exporting faction data...
Exporting item data...
Traceback (most recent call last):
  File "process_items.py", line 59, in <module>
    from process_operations import *
  File "C:\Mount & Blade\Mod Editors\Offical\ModuleSystem\process_operations.py"
, line 24, in <module>
    from module_scene_props import *
  File "C:\Mount & Blade\Mod Editors\Offical\ModuleSystem\module_scene_props.py"
, line 1315, in <module>
    (try_for_agents,":agent"),
TypeError: 'tuple' object is not callable
Exporting scene data...
Traceback (most recent call last):
  File "process_scenes.py", line 15, in <module>
    from process_operations import *
  File "C:\Mount & Blade\Mod Editors\Offical\ModuleSystem\process_operations.py"
, line 24, in <module>
    from module_scene_props import *
  File "C:\Mount & Blade\Mod Editors\Offical\ModuleSystem\module_scene_props.py"
, line 1315, in <module>
    (try_for_agents,":agent"),
TypeError: 'tuple' object is not callable
Exporting troops data
Exporting particle data...
Traceback (most recent call last):
  File "process_scene_props.py", line 4, in <module>
    from module_scene_props import *
  File "C:\Mount & Blade\Mod Editors\Offical\ModuleSystem\module_scene_props.py"
, line 1315, in <module>
    (try_for_agents,":agent"),
TypeError: 'tuple' object is not callable
Traceback (most recent call last):
  File "process_tableau_materials.py", line 8, in <module>
    from process_operations import *
  File "C:\Mount & Blade\Mod Editors\Offical\ModuleSystem\process_operations.py"
, line 24, in <module>
    from module_scene_props import *
  File "C:\Mount & Blade\Mod Editors\Offical\ModuleSystem\module_scene_props.py"
, line 1315, in <module>
    (try_for_agents,":agent"),
TypeError: 'tuple' object is not callable
Traceback (most recent call last):
  File "process_presentations.py", line 8, in <module>
    from process_operations import *
  File "C:\Mount & Blade\Mod Editors\Offical\ModuleSystem\process_operations.py"
, line 24, in <module>
    from module_scene_props import *
  File "C:\Mount & Blade\Mod Editors\Offical\ModuleSystem\module_scene_props.py"
, line 1315, in <module>
    (try_for_agents,":agent"),
TypeError: 'tuple' object is not callable
Exporting party_template data...
Traceback (most recent call last):
  File "process_parties.py", line 6, in <module>
    from process_operations import *
  File "C:\Mount & Blade\Mod Editors\Offical\ModuleSystem\process_operations.py"
, line 24, in <module>
    from module_scene_props import *
  File "C:\Mount & Blade\Mod Editors\Offical\ModuleSystem\module_scene_props.py"
, line 1315, in <module>
    (try_for_agents,":agent"),
TypeError: 'tuple' object is not callable
Exporting quest data...
Traceback (most recent call last):
  File "process_scripts.py", line 7, in <module>
    from process_operations import *
  File "C:\Mount & Blade\Mod Editors\Offical\ModuleSystem\process_operations.py"
, line 24, in <module>
    from module_scene_props import *
  File "C:\Mount & Blade\Mod Editors\Offical\ModuleSystem\module_scene_props.py"
, line 1315, in <module>
    (try_for_agents,":agent"),
TypeError: 'tuple' object is not callable
Traceback (most recent call last):
  File "process_mission_tmps.py", line 8, in <module>
    from process_operations import *
  File "C:\Mount & Blade\Mod Editors\Offical\ModuleSystem\process_operations.py"
, line 24, in <module>
    from module_scene_props import *
  File "C:\Mount & Blade\Mod Editors\Offical\ModuleSystem\module_scene_props.py"
, line 1315, in <module>
    (try_for_agents,":agent"),
TypeError: 'tuple' object is not callable
Traceback (most recent call last):
  File "process_game_menus.py", line 8, in <module>
    from process_operations import *
  File "C:\Mount & Blade\Mod Editors\Offical\ModuleSystem\process_operations.py"
, line 24, in <module>
    from module_scene_props import *
  File "C:\Mount & Blade\Mod Editors\Offical\ModuleSystem\module_scene_props.py"
, line 1315, in <module>
    (try_for_agents,":agent"),
TypeError: 'tuple' object is not callable
Traceback (most recent call last):
  File "process_simple_triggers.py", line 5, in <module>
    from process_operations import *
  File "C:\Mount & Blade\Mod Editors\Offical\ModuleSystem\process_operations.py"
, line 24, in <module>
    from module_scene_props import *
  File "C:\Mount & Blade\Mod Editors\Offical\ModuleSystem\module_scene_props.py"
, line 1315, in <module>
    (try_for_agents,":agent"),
TypeError: 'tuple' object is not callable
Traceback (most recent call last):
  File "process_dialogs.py", line 9, in <module>
    from process_operations import *
  File "C:\Mount & Blade\Mod Editors\Offical\ModuleSystem\process_operations.py"
, line 24, in <module>
    from module_scene_props import *
  File "C:\Mount & Blade\Mod Editors\Offical\ModuleSystem\module_scene_props.py"
, line 1315, in <module>
    (try_for_agents,":agent"),
TypeError: 'tuple' object is not callable
Traceback (most recent call last):
  File "process_global_variables_unused.py", line 3, in <module>
    from process_operations import *
  File "C:\Mount & Blade\Mod Editors\Offical\ModuleSystem\process_operations.py"
, line 24, in <module>
    from module_scene_props import *
  File "C:\Mount & Blade\Mod Editors\Offical\ModuleSystem\module_scene_props.py"
, line 1315, in <module>
    (try_for_agents,":agent"),
TypeError: 'tuple' object is not callable

______________________________

Script processing has ended.
Press any key to exit. . .
 
Aha, ASSIGN. That must be the command I was looking for. I'm going to have a lot of new code to test as soon as I'm done typing.

Perhaps I gave up too soon on my bomb throwing guys, if that code actually works. It's way ahead of my 3 or so days playing with Python between working.

Your code looks good. So I see you're going to be blowing up barrels on people. Classic and cool. No need to ID anyone for that. In fact you can probably get away with leaving it as (agent_deliver_damage_to_agent,":agent",":agent"), unless you find a way to make your scene prop's name show up as having killed someone. I'm not sure at this point if Python will take a prop as an agent. But I know there're a few commands relating to destructible scene props, so you should have a good thing going there.

And yeah, you can set it up to do a specific amount of damage. Earlier this week I found this, which will probably help you:
http://forums.taleworlds.com/index.php/topic,67622.0.html

After I figure out exactly what I'm doing with this new faction's weapon, I'm going to make an actual blast area effect that does damage that decreases with distance, rather than a set amount of damage over a given area. That'll make it a lot more realistic.

Glad we could help each other out!
 
Double post. Yeah. Responding to the edit I just noticed (that's what I get for taking so bloody long to reply in the first place)

It looks like your problem might be somewhere above the code you just wrote. Can you post a little more of your scene_props to see if we can make heads or tales of it?
 
Oh. I fixed it. I just placed it in the wrong place :razz:.. don't worry that is fixed.

Code:
  ("Explosive_Barrel",sokf_destructible|spr_hit_points(1),"barrel","asplode",
   [
     (ti_on_scene_prop_destroy,
      [
        (store_trigger_param_1, ":instance_no"),
        (val_add, "$g_last_destroyed_gourds", 1),
        (prop_instance_get_position, pos1, ":instance_no"),
        (copy_position, pos2, pos1),
        (position_set_z, pos2, -100000),
        (particle_system_burst, "psys_cannon_ground_hit_b_large", pos1, 2),
        (prop_instance_animate_to_position, ":instance_no", pos2, 1),
        (play_sound, "snd_pistol_shot"),
        (scene_prop_get_instance,":instance", "spr_explosion", 0),
             (try_for_agents,":agent"),
        (agent_get_position,pos2,":agent"),
        (get_distance_between_positions,":dist",pos3,pos2),
        (lt,":dist",325),
        (agent_set_hit_points,":agent",0,0),                     
        (agent_deliver_damage_to_agent,":chosen",":agent"),
        (agent_set_animation, ":agent", "anim_fall_body_back"),  
        (try_end),
        ]),
     (ti_on_scene_prop_init,
    [
     (particle_system_add_new, "psys_cannon_ground_hit_b_large"),
     (particle_system_add_new, "psys_fire_glow_1"),
    ]),


     ]),
Well this is what I did first. And nothing happend at all. But I could try to make this instead.

  ("Explosive_Barrel",sokf_destructible|spr_hit_points(1),"barrel","asplode",
  [
    (ti_on_scene_prop_destroy,
      [
        (store_trigger_param_1, ":instance_no"),
        (val_add, "$g_last_destroyed_gourds", 1),
        (prop_instance_get_position, pos1, ":instance_no"),
        (copy_position, pos2, pos1),
        (position_set_z, pos2, -100000),
        (particle_system_burst, "psys_cannon_ground_hit_b_large", pos1, 2),
        (prop_instance_animate_to_position, ":instance_no", pos2, 1),
        (play_sound, "snd_pistol_shot"),
        (scene_prop_get_instance,":instance", "spr_explosion", 0),
            (try_for_agents,":agent"),
        (agent_get_position,pos2,":agent"),
        (get_distance_between_positions,":dist",pos3,pos2),
        (lt,":dist",325),
        (agent_set_hit_points,":agent",0,0),                   
        (agent_deliver_damage_to_agent,":agent",":agent"),
        (agent_set_animation, ":agent", "anim_fall_body_back"), 
        (try_end),
        ]),
    (ti_on_scene_prop_init,
    [
    (particle_system_add_new, "psys_cannon_ground_hit_b_large"),
    (particle_system_add_new, "psys_fire_glow_1"),
    ]),


    ]),

or?
 
I figured it was just a simple error there. I was getting loads of similar errors before I started paying more attention to the way I punctuate this code.

I gotta admit, your scene prop code is way ahead of me. I'm just glad you say it works! I used to do CG for short films, the most popular of which featured a telescopically recoiling cannon on wheels. I was thinking about re-making that old prop and putting it into the game for old time's sake, but apparently it's going to take a little effort. I'm dying to figure out what the huge numbers are doing.

I'm a little disappointed in the grenade code you posted. Not because it's not a cool idea, but rather that it's basically a hitscan weapon and not a thrown grenade. On top of that, I couldn't see NPCs using it because I ended up blowing myself up without realizing it as much as I was actually hitting my intended targets. At least studying the code will probably help me locate the agent that's using this weird weapon of mine, because it does seem to give credit for the kill to its user.

 
well that mods grenade is abit strange. But.. about my Explosive Barrel thing. The thing is. It doesn't work. Not at all. It only explodes and the particle effect comes and the sound aswell but nothing else. No damage at all. Or is it so that I can't damage myself with it?  :shock:
 
bjorne. said:
well that mods grenade is abit strange. But.. about my Explosive Barrel thing. The thing is. It doesn't work. Not at all. It only explodes and the particle effect comes and the sound aswell but nothing else. No damage at all. Or is it so that I can't damage myself with it?  :shock:

You have to be relatively close to it, for one thing. 325 is spitting distance. But I'm sure you covered that.

Try changing your pos3 in
(get_distance_between_positions,":dist",pos3,pos2),
to pos1 and see what happens. Just a hunch.
 
no still nothing


#####EDIT#####

Well this is from the Curtain of Fire mod... but that wasn't a throw weapon either but it shot out a fire beam wich exploded and threw people up in the air and damaged them while doing it.

[(ti_on_weapon_attack, [(assign,":distance",99999),(try_for_agents,":agent"),
                            (particle_system_burst, ""psys_night_smoke_1"", pos1, 15),
                            (position_move_y,pos1,10),
                            (copy_position,pos2,pos1),
                            (position_set_z_to_ground_level, pos2),
                            (get_distance_between_positions,":dist",pos1,pos2),
                            (lt,":dist",10),
                            (particle_system_burst, "psys_grenade_fire", pos1, 15),
                            (particle_system_burst, "psys_grenade_smoke", pos1, 15),
                            (play_sound,"snd_pistol_shot"),
                            (try_for_agents,":agent"),
                              (agent_get_position,pos2,":agent"),
                              (get_distance_between_positions,":dist",pos1,pos2),
                              (lt,":dist",300),
                              (agent_set_hit_points,":agent",0,0),
                              (agent_deliver_damage_to_agent,":agent",":agent"),
                            (end_try),

                            (scene_prop_get_instance,":instance", "spr_explosion", 0),
                            (position_copy_origin,pos2,pos1),
                            (prop_instance_set_position,":instance",pos2),
                            (position_move_z,pos2,1000),
                            (prop_instance_animate_to_position,":instance",pos2,175),
                            (assign,reg5,1000),
                          (end_try),],)]],

But right now I thik it is only the red parts that matters. And that is when it actaully explodes i think. So... use your mind now... Cause I see nothing right now but numbers.
 
Yeah that AOE effect there should definitely work. Almost identical to the damage system I'm using. Here, I'll explain what it does, line by line:

(try_for_agents,":agent"), starts testing all actors in area to see if they meet the qualifications
  (agent_get_position,pos2,":agent"), gets position for agents (one at a time)
  (get_distance_between_positions,":dist",pos1,pos2), gets distance between the source position (pos1) and the agent's position (pos2)
  (lt,":dist",300), sets condition that the positions above must be under 300 apart, else it disqualifies the current agent and starts over
  (agent_set_hit_points,":agent",0,0), if the above agent passed the distance test, his hit points become zero (what a reward)
  (agent_deliver_damage_to_agent,":agent",":agent"), agent delivers some damage to himself
(end_try),

Right now all I really understand is how to make things blow up from a given location or the location of a throwing weapon as it's thrown. Can it be done just like the code in your post but with ti_on_scene_prop_destroy instead of ti_on_weapon_attack?
 
Okey. This is very strange really  :???: I have no idea of how things should work now... real, real strange.





Johnny Morphine said:
Can it be done just like the code in your post but with ti_on_scene_prop_destroy instead of ti_on_weapon_attack?

I believe that this line does just that...

Code:
                            (scene_prop_get_instance,":instance", "spr_explosion", 0),

This was from the code I posted from the Curtain of Fire mod.
 
The scene_prop_get_instance command is strange to me. I've been looking at your code and can't seem to figure out exactly what it does. Is anyone that understands how scene_props work reading this thread?
 
Back
Top Bottom