(try_begin),
(eq, ":action",16),
(assign,":player_no",":var1"),
(player_get_agent_id,":agent_no",":player_no"),
(neq,":agent_no",-1),
(agent_is_active,":agent_no"),
(agent_is_alive,":agent_no"),
(agent_equip_item, ":agent_no", "itm_ammobox",1),
(agent_set_wielded_item, ":agent_no", -1), #unwield the current item
(agent_set_wielded_item, ":agent_no", "itm_ammobox"),
(scene_prop_get_num_instances, ":end_cond", "spr_ie_rifle_ammobox"),
(try_for_range,":cur_instance",0,":end_cond"),
(scene_prop_get_instance, ":instance_id", "spr_ie_rifle_ammobox", ":cur_instance"),
(prop_instance_get_position, pos1, ":instance_id"),
(set_fixed_point_multiplier, 1000),
(position_move_z, pos1, -500),
(prop_instance_animate_to_position, ":instance_id", pos1,0),
(try_end),
If you're talking about de-spawning a prop, well, you can't. Hiding it below the ground (and potentially re-using it) is your only viable option.DanyEle said:Hello, simple question for you, great modders. How can i make the collision object of a prop disappear server-side? For now, i'm only able to hide it below the ground.
Give the sokf_moveable flag to the scene prop and the collision object will move with it. Or use prop_instance_enable_physics with 0 to disable the collision object. Or both.DanyEle said:I managed to make it disappear, but its collision object is still there.
As I think I said at the time in that thread, I suggest placing all the improvement structures in the scene and mark the props for each improvement using a number in one of the editor values (set in the scene props tab of the editor window, and retrieved with prop_instance_get_variation_id or prop_instance_get_variation_id_2), then write a script called from your mission template's ti_before_mission_start that iterates over the first X thousand valid props, running replace_prop_instance with spr_empty if they are marked as an improvement that isn't built. To avoid strange issues with AI meshes, just place a few rubbish heaps or rocks inside the improvement buildings, not marked as belonging, so when not built there will still be a visible reason for bots to avoid the area.Somebody said:There's a framework for it (that I haven't seen used) by Lav to add scene props, but you still need to modify the scene extensively to have entry points where the buildings are going to pop up (easier than hard-coding every coordinate for every scene IMO) and to make sure village/town walkers don't run into the building when the AI-mesh isn't modified.
cmpxchg8b said:Give the sokf_moveable flag to the scene prop and the collision object will move with it. Or use prop_instance_enable_physics with 0 to disable the collision object. Or both.DanyEle said:I managed to make it disappear, but its collision object is still there.
The physics thing has to be done on both client and server I believe.DanyEle said:I had tried prop_instance_enable_physycs, 0 , but it didn't work. Instead sofk_moveable, was exactly what i needed. Thank you!
Just do a polling trigger to remove the item from the inappropriate troops. Most "restrictions" can be done from the tableaus, but note that while it can move items around, your inventory screen won't refresh properly. Call the same trigger right before a mission starts if you suspect the player of trying to work around it. Again, you'll need to soft-code the requirements into the trigger, as well as displaying that difficulty in script_game_get_item_extra_text.Zerilius said:1.How can I make an armor or a weapon only to be used by a certain hero troop? (like e.g. I want only Marnid to equip a sword [str 10] even when I and others have the required strength to use it).
2.I made a new skill, now how can I assign difficulties of certain weapons on that skill? (like I want to make a sword which requires 6 spirit(new skill))
script_game_get_upgrade_xp/cost, wages should be in script_game_get_troop_wage. You can see how bandits take more xp, and mercs/mounted take more money, etc.Deathwhisper said:I'd like to make some particular units more expensive than others, without increasing drastically their level (which would make them better than intended in autocalc and longer to train).
module_troops
swadian_face_younger_1