Modding Q&A [For Quick Questions and Answers]

正在查看此主题的用户

状态
不接受进一步回复。
JC LEON 说:
is there an easy way to view warband scenes and sco fiels..

I wonderring to change some scenes form native but where i can find the tool and the corresposnding names for every scenes??
You can't edit .sco files, you have to edit them in-game. In the launcher click options -> Advanced -> enable edit mod. Them enter the scene you want to edit, and click Ctrl + e.
 
jacobhinds 说:
You convert int values to RGB hex by multiplying B by 1 (160), G by 256 (162) and R by 65536 (16⁴), then converting them to hexadecimal and adding them all together. The individual RGB values will have to use the 0-255 range to work, as is normal.

this is strange, I did that(minus the converting to hexadecimal part, which seems to be unnecessary) for the presentation to pick the color and it worked, but when I tried to apply that collor to a colored item, it was all black(it works fine if I manually call it with 0x000000 or other values):
插入代码块:
(overlay_set_color,l.cur_overlay,(g.color_picker1*256*256)+(g.color_picker2*256)+(g.color_picker3)),
TKGXghD.jpg
插入代码块:
(assign,reg0,(g.color_picker1*256*256)+(g.color_picker2*256)+(g.color_picker3)),(cur_item_set_tableau_material, "tableau_camo_tribal_warrior_outfit_a", reg0 ),
q1v5O3c.jpg
插入代码块:
(cur_item_set_tableau_material, "tableau_camo_tribal_warrior_outfit_a", -0x800000),
dCpMKI4.jpg
(this is using lav's fish&chips camo items)
I also tried multiplying reg0 by -1, 0x000000, -0x000000 none of which worked
 
Just use normal warband math instead of relying on the compiler - I don't recall lav's compiler converting those operations into warband opcodes anyway.
 
afaik it does, and it worked for the presentation, but Ill try it anyway

EDIT:
found out the issue, aparently if you call agent_get_party_id on the player agent, you wont always get p.main_party, and that part of the code wasnt even getting executed
GPRq9Tx.jpg

now this outfit would attract a lot of attention in 'the dark ages' wouldnt it?
 
CutContent 说:
Does anyone know how to make an NPC constantly hold his shield up at all times?
插入代码块:
agent_set_defend_action                  = 1746  # (agent_set_defend_action, <agent_id>, <value>, <duration-in-1/1000-seconds>),
                                                 # Forces the agent to perform a defend action. Possible values: -2 = cancel any action (1.153+), 0 = defend_down, 1 = defend_right, 2 = defend_left, 3 = defend_up. Does time value determine delay, speed or duration? 4research.
CutContent 说:
I would also like to know if it is possible for a scene prop to play a vertex animation when spawned
插入代码块:
prop_instance_deform_to_time                = 2610  # (prop_instance_deform_to_time, <prop_instance_no>, <value>),
                                                    # Version 1.161+. Deforms a vertex-animated scene prop to specified vertex time. If you open the mesh in OpenBrf, right one of "Time of frame" boxes contains the relevant value.
prop_instance_deform_in_range               = 2611  # (prop_instance_deform_in_range, <prop_instance_no>, <start_frame>, <end_frame>, <duration-in-1/1000-seconds>),
                                                    # Version 1.161+. Animate vertex-animated scene prop from start frame to end frame within the specified time period (in milliseconds). If you open the mesh in OpenBrf, right one of "Time of frame" boxes contains the relevant values for frame parameters.
prop_instance_deform_in_cycle_loop          = 2612  # (prop_instance_deform_in_cycle_loop, <prop_instance_no>, <start_frame>, <end_frame>, <duration-in-1/1000-seconds>),
                                                    # Version 1.161+. Performs looping animation of vertex-animated scene prop within the specified vertex frame ranges and within specified time (in milliseconds). If you open the mesh in OpenBrf, right one of "Time of frame" boxes contains the relevant values for frame parameters.
prop_instance_get_current_deform_progress   = 2615  # (prop_instance_get_current_deform_progress, <destination>, <prop_instance_no>),
                                                    # Version 1.161+. Returns a percentage value between 0 and 100 if animation is still in progress. Returns 100 otherwise.
prop_instance_get_current_deform_frame      = 2616  # (prop_instance_get_current_deform_frame, <destination>, <prop_instance_no>),
                                                    # Version 1.161+. Returns current frame of a vertex-animated scene prop, rounded to nearest integer value.
 
erennuman_mb 说:
JC LEON 说:
is there an easy way to view warband scenes and sco fiels..

I wonderring to change some scenes form native but where i can find the tool and the corresposnding names for every scenes??
You can't edit .sco files, you have to edit them in-game. In the launcher click options -> Advanced -> enable edit mod. Them enter the scene you want to edit, and click Ctrl + e.
many thaks for your replay but this is not very useful i i want to thumbs all scenes to choose which to change
 
What about transferring over Warband operations to MB? I think TLD did something like this, since it had operations for the attack direction for trolls (not a vanilla MB operation) I think it is possible but how?
 
CutContent 说:
What about transferring over Warband operations to MB? I think TLD did something like this, since it had operations for the attack direction for trolls (not a vanilla MB operation) I think it is possible but how?
Nope...
It probably checked for the specific animations, but I'm not familar with the original M&B module system.
 
But in the 1866 mod in zombie quick battle if a zombie was shot in the head his head would disappear. Surley that would mean the zombie equipped an invisible head item on the fly. But vanilla operations in MB do not allow you to equip agents on the fly. Only warband so it must be possible
 
Quick question.

I have looked all over but couldn't find the answer. If I wanted an agent to drop an item in multiplayer, how would I do that? I know that I need to have them unequip using agent_unequip_item, but how do I spawn a scene prop instance of an item that they can pick up? Just like if a player dropped the item themselves, but instead, the server is doing so.
 
插入代码块:
spawn_item                                  = 1971  # (spawn_item, <item_kind_id>, <item_modifier>, [seconds_before_pruning]),
                                                    # Spawns a new item, possibly with modifier, on the scene in the position specified by previous call to (set_spawn_position). Optional parameter determines time period (in second) after which the item will disappear. Using 0 will prevent the item from disappearing.
 
Ikaguia 说:
插入代码块:
spawn_item                                  = 1971  # (spawn_item, <item_kind_id>, <item_modifier>, [seconds_before_pruning]),
                                                    # Spawns a new item, possibly with modifier, on the scene in the position specified by previous call to (set_spawn_position). Optional parameter determines time period (in second) after which the item will disappear. Using 0 will prevent the item from disappearing.

Oh...wow...

I completely missed that. Thanks xD
 
Nord Champion 说:
Ikaguia 说:
插入代码块:
spawn_item                                  = 1971  # (spawn_item, <item_kind_id>, <item_modifier>, [seconds_before_pruning]),
                                                    # Spawns a new item, possibly with modifier, on the scene in the position specified by previous call to (set_spawn_position). Optional parameter determines time period (in second) after which the item will disappear. Using 0 will prevent the item from disappearing.

Oh...wow...

I completely missed that. Thanks xD

Just to make sure you know it, you'll also have to set the position first using this:
插入代码块:
set_spawn_position                          = 1970  # (set_spawn_position, <position>),
                                                    # Defines the position which will later be used by (spawn_scene_prop), (spawn_scene_item), (spawn_agent) and (spawn_horse) operations.
 
So I made a decap test to test if decapitation was possible in MB without using WSE or warband operations.
In the scene/mission template there is a little trigger that checks when the NPC's health is below 30. at below 30 it fires the decap script. I get no errors in MS but the game crashes to the desktop. Here is the log in rgl log

I am not sure what it means. Apparently I have some kind of invalid agent id?  The problem seems to be in the scripts but I have attached the rgl log and the mission trigger just in case below
插入代码块:
 begin_setup end_setup SCRIPT WARNING ON OPCODE 1710: Invalid Agent ID: 1; LINE NO: 4: At script: decapitate_npc. At script: decapitate_npc. SCRIPT WARNING ON OPCODE 1710: Invalid Agent ID: 1; LINE NO: 4: At script: decapitate_npc. At script: decapitate_npc. SCRIPT WARNING ON OPCODE 1710: Invalid Agent ID: 1; LINE NO: 4: At script: decapitate_npc. At script: decapitate_npc. SCRIPT WARNING ON OPCODE 1710: Invalid Agent ID: 1; LINE NO: 4: At script: decapitate_npc. At script: decapitate_npc. SCRIPT WARNING ON OPCODE 1710: Invalid Agent ID: 1; LINE NO: 4: At script: decapitate_npc. At script: decapitate_npc. SCRIPT WARNING ON OPCODE 1710: Invalid Agent ID: 1; LINE NO: 4: At script: decapitate_npc. At script: decapitate_npc. SCRIPT WARNING ON OPCODE 1710: Invalid Agent ID: 1; LINE NO: 4: At script: decapitate_npc. At script: decapitate_npc. SCRIPT WARNING ON OPCODE 1710: Invalid Agent ID: 1; LINE NO: 4: At script: decapitate_npc. At script: decapitate_npc. SCRIPT WARNING ON OPCODE 1710: Invalid Agent ID: 1; LINE NO: 4: At script: decapitate_npc. At script: decapitate_npc. SCRIPT WARNING ON OPCODE 1710: Invalid Agent ID: 1; LINE NO: 4: At script: decapitate_npc. At script: decapitate_npc. SCRIPT WARNING ON OPCODE 1710: Invalid Agent ID: 1; LINE NO: 4: At script: decapitate_npc. At script: decapitate_npc. SCRIPT WARNING ON OPCODE 1710: Invalid Agent ID: 1; LINE NO: 4: At script: decapitate_npc. At script: decapitate_npc. SCRIPT WARNING ON OPCODE 1710: Invalid Agent ID: 1; LINE NO: 4: At script: decapitate_npc. At script: decapitate_npc.

Here is the mission trigger

插入代码块:
npc_health_checker = (
  0.5, 0, 0,
  [
     
	],
  [
      #(store_script_param, ":agent", 1),
	  
	  (get_player_agent_no, ":plyr"),
	  (try_for_agents, ":agent"),
	    (neq, ":agent", ":plyr"),
	    (store_agent_hit_points, ":agent_hp", ":agent"),
	    #(store_script_param, ":agent", 1),
		(try_begin),
	     (agent_is_alive, ":agent"),
         (is_between, ":agent_hp", 1, 30),
		 (display_message, "@npc's health is low!"),
		 (call_script, "script_decapitate_npc"),
	    (else_try),
	     #nothing
	    (try_end),
	  (try_end),
	   
	 
    ])

and the script

插入代码块:
("decapitate_npc", #param = ":agent"
    [
          #(store_script_param, ":agent", 1),
		 (get_player_agent_no, ":plyr"),
		 (try_for_agents, ":agent"),
	          (neq, ":agent", ":plyr"),
		  (agent_play_sound, ":agent", "snd_man_die"),
		  (agent_get_position, ":agent", pos1),
		  (set_spawn_position, pos1), 
		  (spawn_agent, "trp_victim_dead"),
		  (agent_set_hit_points, reg0, 0, 1), #agent spawns with zero health, so he spawns dead basically		  
		  (agent_deliver_damage_to_agent, ":plyr", reg0), #just to make sure he stays dead
		  (entry_point_get_position, pos2, 13),
		  (agent_set_position, ":agent", pos2), #teleport original agent to somewhere hidden
		 (try_end),
		  
		  
      ]),

does anyone see anything wrong with this? because I do not
 
Probably because your script grabs every non-player agent and tries to put them in one place, resulting in a crash. Use the parameters next time instead of just copy-pasting code that appears to work.
 
状态
不接受进一步回复。
后退
顶部 底部