Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
So the code changes should be:

(ti_on_init_scene_prop,
    [
      (store_trigger_param_1, ":instance_id"),
    (prop_instance_get_variation_id, ":door_link_number", ":instance_id"),
    (scene_prop_get_num_instances, ":door_count", "spr_teleport_1side_5"),
      (try_for_range, ":eek:ther_instance_no", 0, ":door_count"),     
      (scene_prop_get_instance, ":eek:ther_instance_id", "spr_teleport_1side_5_destination", ":eek:ther_instance_no"),
      (neq, ":eek:ther_instance_id", ":instance_id"),
      (prop_instance_get_variation_id, ":eek:ther_door_link_number", ":eek:ther_instance_id"),
      (eq, ":eek:ther_door_link_number", ":door_link_number"),
      (prop_instance_get_position, pos1, ":eek:ther_instance_id"),
      (prop_instance_get_position, pos2, ":instance_id"),
      (position_move_y, pos1, 50),     
    (try_for_agents, ":agent", [pos2], [5]), #gets added   
      (ge,":agent",0),
      (agent_is_active,":agent"),
      (agent_is_alive, ":agent"),
    #gets removed
      (agent_get_position, pos0, ":agent"),
      (get_distance_between_positions_in_meters, ":distance_to_target_pos", pos0, pos2),
      (lt, ":distance_to_target_pos", 5),

      (agent_set_position, ":agent", pos1), 
        (assign, ":door_count", -1),     
      (try_end),     
    (try_end),     
    ]),
Did I get it right? I'm new to the MS so it's quite a hard task for me  :???:
 
You want auto teleport bots if they are closer than 5m from doors, right ?

You cannot use ti_on_init_scene_prop , because its trriger after someone use it. ( im not sure, fix me if im not right).

also add debug messages to find, where  script fails. (Before and after condition)
 
UndeadDuke said:
    (try_for_agents, ":agent", [pos2], [5]), #gets added 

the "[ ]" on header_operations.py just means the parameter is optional (not mandatory), so you can do

Code:
(try_for_agents, reg1),

or

Code:
(try_for_agents, reg1, pos1, 1000),

same operation with 1 or 3 parameters (without or with distance filter). You can't keep them on your code. Also test your fixed point to see if you need to pass 5 or a multiplier for distance (like 500).
 
PitchPL said:
You want auto teleport bots if they are closer than 5m from doors, right ?
yes, me and bots, even horses, every alive agent around

PitchPL said:
You cannot use ti_on_init_scene_prop , because its trriger after someone use it. ( im not sure, fix me if im not right).
in header_triggers.py I see only this options:
ti_on_scene_prop_init / ti_on_init_scene_prop - sounds like it works when scene is runned
ti_on_scene_prop_hit - works on hit, target is not even nessesary to be desrtoyable
ti_on_scene_prop_destroy - works after target is out of hp, not my choice
ti_on_scene_prop_use - doesn't work in singleplayer at all for some reason
ti_on_scene_prop_is_animating - dunno when exactly it works but definitely not my choice
ti_on_scene_prop_animation_finished - same
ti_on_scene_prop_start_use - most likely used for ladders in MP, not my choice
ti_on_scene_prop_cancel_use - same
PitchPL said:
also add debug messages to find, where  script fails.
No idea how to do it im noob  :sad:
 
Just add (display_messages, "@debug part 1"), where you want check.

Im not sure about that trriger  , I cannot check it now. Maybe kalarhan would know .

Nooby way to do this could be loop trought all The active/Alive agents.
If agent is lt 5 , do whatever you want.
 
kalarhan said:
Code:
(try_for_agents, reg1, pos1, 1000),

same operation with 1 or 3 parameters (without or with distance filter). You can't keep them on your code. Also test your fixed point to see if you need to pass 5 or a multiplier for distance (like 500).
I did (try_for_agents, ":agent", pos2, 100), and nothing happens ingame. Again. I'm sorry for being so dumb but... Can you share a code fragment which you think should work? Also no idea what fixed point is - that code is from internet and its a miracle that it worked.
 
UndeadDuke said:
kalarhan said:
Code:
(try_for_agents, reg1, pos1, 1000),

same operation with 1 or 3 parameters (without or with distance filter). You can't keep them on your code. Also test your fixed point to see if you need to pass 5 or a multiplier for distance (like 500).
I did (try_for_agents, ":agent", pos2, 100), and nothing happens ingame. Again. I'm sorry for being so dumb but... Can you share a code fragment which you think should work? Also no idea what fixed point is - that code is from internet and its a miracle that it worked.





Add debug messages to know that this even trrigers.
 
Like this?
(ti_on_init_scene_prop,
    [
      (store_trigger_param_1, ":instance_id"),
  (display_message, "@debug part 1"),
    (prop_instance_get_variation_id, ":door_link_number", ":instance_id"),
    (scene_prop_get_num_instances, ":door_count", "spr_teleport_1side_5"),
  (try_for_range, ":eek:ther_instance_no", 0, ":door_count"),     
  (set_fixed_point_multiplier, 1),
      (scene_prop_get_instance, ":eek:ther_instance_id", "spr_teleport_1side_5_destination", ":eek:ther_instance_no"),
      (neq, ":eek:ther_instance_id", ":instance_id"),
      (prop_instance_get_variation_id, ":eek:ther_door_link_number", ":eek:ther_instance_id"),
      (eq, ":eek:ther_door_link_number", ":door_link_number"),
      (prop_instance_get_position, pos1, ":eek:ther_instance_id"),
  (prop_instance_get_position, pos2, ":instance_id"),
      (position_move_y, pos1, 50),
  (display_message, "@debug part 2"),
      (try_for_agents, ":agent", pos2, 100),  
    (ge,":agent",0),
    (agent_is_alive, ":agent"),
    (agent_set_position, ":agent", pos1), 
  (try_end),
  (display_message, "@debug part 3"),
(assign, ":door_count", -1),
    (try_end), 
    ]),
or more?

Edit - all 3 messages showed up as I entered the scene. Which means... I'm already in radius and nothing happens? or what?
 
UndeadDuke said:
Need help with scene editing. I'm trying to make teleport doors for singleplayer sieges. In singleplayer all objects with sokf_moveable|spr_use_time(0) are not highlighted to be use with F for some reason, they become just a destructible targets so I had to put teleport in ti_on_scene_prop_hit trigger. And it works, but mostly for me, and the goal was to be able to take my archers/companions with me using F1-F2 order. Any idea how to make it possible for them to come with me? I'm trying to do it through a distance comparison so that all agents that are closer than 5 meters to the door will be moved to the end destination. But this code doesn't work, compiler doesn't show any errors but in game nothing happens within 5m radius either. What I'm doing wrong?
("teleport_1side_5",sokf_moveable,"door_c","bo_door_a", [
###Not working code, I know its something wrong here but what exactly?
  (ti_on_init_scene_prop,
    [
      (store_trigger_param_1, ":instance_id"),
    (prop_instance_get_variation_id, ":door_link_number", ":instance_id"),
    (scene_prop_get_num_instances, ":door_count", "spr_teleport_1side_5"),
    (try_for_agents, ":agent"),
  (try_for_range, ":eek:ther_instance_no", 0, ":door_count"),     
      (scene_prop_get_instance, ":eek:ther_instance_id", "spr_teleport_1side_5_destination", ":eek:ther_instance_no"),
      (neq, ":eek:ther_instance_id", ":instance_id"),
      (prop_instance_get_variation_id, ":eek:ther_door_link_number", ":eek:ther_instance_id"),
      (eq, ":eek:ther_door_link_number", ":door_link_number"),
      (prop_instance_get_position, pos1, ":eek:ther_instance_id"),
  (prop_instance_get_position, pos2, ":instance_id"),
      (position_move_y, pos1, 50),  
    (ge,":agent",0),
    (agent_is_active,":agent"),
    (agent_is_alive, ":agent"),
(agent_get_position, pos0, ":agent"),
(get_distance_between_positions_in_meters, ":distance_to_target_pos", pos0, pos2),
(lt, ":distance_to_target_pos", 5),
    (agent_set_position, ":agent", pos1), 
        (assign, ":door_count", -1),
  (try_end),
 
    (try_end), 
    ]),


###Perfectly working code but having it on scene prop hit is not enough
  (ti_on_scene_prop_hit,
      [
    (store_trigger_param_1, ":instance_id"),
    (prop_instance_get_variation_id, ":door_link_number", ":instance_id"),
    (scene_prop_get_num_instances, ":door_count", "spr_teleport_1side_5"),
    (try_for_range, ":eek:ther_instance_no", 0, ":door_count"),
  (set_fixed_point_multiplier, 1),
          (position_get_x, ":attacker_agent_id", pos2),
          (get_player_agent_no, ":player_agent"),
          (eq, ":player_agent", ":attacker_agent_id"),
      (scene_prop_get_instance, ":eek:ther_instance_id", "spr_teleport_1side_5_destination", ":eek:ther_instance_no"),
      (neq, ":eek:ther_instance_id", ":instance_id"),
      (prop_instance_get_variation_id, ":eek:ther_door_link_number", ":eek:ther_instance_id"),
      (eq, ":eek:ther_door_link_number", ":door_link_number"),
      (prop_instance_get_position, pos1, ":eek:ther_instance_id"),
      (position_move_y, pos1, 50),
      (agent_set_position, ":player_agent", pos1),
      (assign, ":door_count", -1),
    (try_end), 
    ]),
]),

  ("teleport_1side_5_destination", 0, "pointer_arrow", "0", []),

KnightV said:
I have misterious bug or error, i dont know. So i have a new one animation in game while jumping and i want to remove it. But in module_animation in section @jump@ there isnt the animation, i see only default native animation. Help anybody. What could cause these? It is true that animations can call not only file module_animation. thanks in advance
Pay attention to the names in quotes.
6c46f8627550b83b4d2d5898d9f1780f-full.png
These are names of the animation resource in brf-s and they are the only thing that matters. If in your module_animations.py they differ from my pic, then just rename them to match it and problem will be solved. Good luck.

I have fixed my error even didnt read your message jet. I simply used native file, saw that bug disappeared and understood that problem is in jump section
 
kalarhan said:
see header_triggers.py for the list of triggers you can use. Make sure you are using the one related to the kind of event you need.
Hey, maybe thats the case? Could it be that ti_on_init_scene_prop, triggers only once, doesn't find any agents within radius and stops furher checking? Then I need a mission edit not a trigger don't I... oh, jeez. Too hard for noob like me but I don't want to give up
 
UndeadDuke said:
ti_on_init_scene_prop

ti = trigger
on = on
init = initialization, creation, first appearance, it is there
scene_prop = the scene prop instance

by reading the notes and/or trigger name you can start to see what they are used for.
 
cd5ssmffan said:
How do you make a "shotgun" bow? I mean make a bow spawn multiple arrows but in a random "cone"
Code:
add_missile                              = 1829  # (add_missile, <agent_id>, <starting_position>, <starting_speed_fixed_point>, <weapon_item_id>, <weapon_item_modifier>, <missile_item_id>, <missile_item_modifier>),
                                                 # Version 1.153+. Creates a missile with specified parameters. Note that <starting_position> parameter also determines the direction in which missile flies.
                                                 #MOD info, only speeds up to 204.7 m/s will be synced to the clients
 
hi again mate sorry for bothering your day
i have a problem with my alpha texture, first look at this

dXEQ698.png

lookin noice? now

V69iBRe.png

EanbcMZ.png

as you can see, it seems like, when surface is assigned to an alpha, the transparent part will act as transparent to the background, and not displaying the mesh behind it... how can i make the transparent really, transparent?

im sorry english not my native language, thanks in advance, mate
 
So I make a new boots model, with textures and everything, it looked perfect when I viewed it in OpenBrf, but when I tried it ingame it was invisible, any advice on how to fix this ?
 
Status
Not open for further replies.
Back
Top Bottom