Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Caba`drin said:
Patta said:
Any way to use "add_visitors_to_current_scene" in the following way:
Let a bot appear at the position of the player who pressed a key. For example i put it onto key "h", so when someone presses it, a bot spawns next to him. Spawning a bot in general is no problem, i made it that the bot is in the right team and so on (multiplayer) but i have a problem with making the bot spawn at the players position. I would like to use "add_visitors_to_current_scene" if posssible, i dont like "spawn_agent" very much.

On the key press trigger, mark that this spawn call has been made with a slot or a global variable, likely storing the player's id or some such. Then, use add_visitors_to_current_scene to spawn new agents. If you do the above in a conditions block, then have a few second delay before the consequences block, where you clear the slot/global.

Then, use a ti_on_agent_spawn trigger with a check for the spawn call variable/slot in the conditions block. In the consequences, do what you need to do to move the agent to the player's position.

Except the thing with resetting the variable, it seems like i got everything. Seems to work, too. Only the variable does not reset. Can you tell me how excatly i shall do that? thx.

Also, i have another question: How can i limit a class to one, so that only one player can take it per team? And is it possible to make it so that this troop (one per faction) is not able to take more then one weapon? So that weapon slots 2-4 are blocked for this class?
 
MadocComadrin said:
Get the position of the nearest enemy, check if it's within a certain distance, if it isn't, force a weapon switch to a melee weapon.
Caba`drin said:
FrisianDude said:
Is it possible to make spearthrowers smart enough so they wait a bit until they actually have a good chance of hitting their targets?
Could have a trigger with a distance-to-enemy check that forces a "hold fire" command until the enemy is within X range.
Ah, I thought it might be something like that but didn't know if it's actually possible. Sweet, thanks both.
 
Hold Fire will apply to all agents in the same class.
Patta said:
Also, i have another question: How can i limit a class to one, so that only one player can take it per team? And is it possible to make it so that this troop (one per faction) is not able to take more then one weapon? So that weapon slots 2-4 are blocked for this class?
Find the 3rd and 4th call of the script I mentioned above in the presentation and encapsulate those in a class check.
 
You could attempt to bypass the dialog screen and use presentations to get a look like this, but that could get extra-ordinarily messy.

Otherwise, you want to change the .dds file textures associated with dialogs--mainly dialog_window.dds, with the player's choice buttons in interface.dds

You could increase the area that is transparent in dialog_window...or make the whole thing transparent and see how that goes. But, so far as I know, what the NPC says will always show up centered, to the right and the player's options will always be centered text. The dialog window is hard coded in this regard.

I'm not positive, other than dialogs, what the button-like textures within interface.dds are used for. Perhaps others can speak to that, but changing that file will clearly change the appearance of the game any time those button textures are used.
 
Caba`drin said:
You could increase the area that is transparent in dialog_window...or make the whole thing transparent and see how that goes. But, so far as I know, what the NPC says will always show up centered, to the right and the player's options will always be centered text. The dialog window is hard coded in this regard.
I've attempted to modify the size of the picture of the talking preson (that's normally in the top left corner), but with no success - the game didn't use the expanded size of the 3D view, but used the normal positions and the whole thing looked exceptionally ugly. So my only guess is that this (screenshot) has been done by modifying game_variables.txt and making the dialog texture transparent

Lueii, I believe that M&B uses an alpha channel for transparency, not real transparency, but you could give it a shot.
Maybe the alpha channel is only for certain textures... (we could ask HokieBT or Swyter. There's a lot of transparency in SWC)
 
Lumos said:
C'est impossible with the ModuleSystem.

You can take a peek in game_variables.txt (? - name), and replace the native textures with transparent ones, but nothing more.
Transparent dialog windows don't work like this.  Trust me, I've tried it. 

That screen was made by the method Caba suggested, with presentations. 

Transparency does't seem to work with dialog windows, and with the UI, it just looks messy since screens layer on top of each other. 
 
MadocComadrin said:
Full trigger, modified from before. Now I'm not getting the messages.
Code:
(ti_on_agent_hit, 0, 0, [], [
					(store_trigger_param_1, ":haid"), 
					(store_trigger_param_2, ":daid"), #dealer
					(store_trigger_param_3, ":damage"),
					(assign, ":item", reg0),
					
                                        #I added neg|agent_is_non_player checks here too.
					(agent_get_player_id,":hpid",":haid"),
					(agent_get_player_id,":dpid",":daid"),
					
					(try_begin),
						#(neg|multiplayer_is_server),
						(display_message, "@Agent Hit!"),
						# (ge, ":dpid", 0),
						# (ge, ":hpid", 0),
						(player_get_team_no, ":dTeam", ":dpid"),
						(player_get_team_no, ":hTeam", ":hpid"),
						#(neq, ":dpid", ":hpid"),
						(eq, ":dTeam", ":hTeam"),
						(display_message, "@Team Damage!"),
						(player_get_slot,":td",":dpid",madmin_pslt_tw),
						(val_add, ":td", ":damage"),
						(player_set_slot,":dpid",madmin_pslt_tw, ":td"),
					(try_end),
									
					(try_begin),
						(multiplayer_is_server),
						(ge, ":dpid", 0),
						(ge, ":hpid", 0),
						(neq, ":dpid", ":hpid"),
						(player_is_admin, ":dpid"),
						(eq, ":item", "itm_bec_de_corbin_a"),
						(particle_system_burst ,"psys_moon_beam_1", pos0, 60),
						(str_store_player_username,s34,":hpid"),
						(str_store_player_username,s35,":dpid"),
						(server_add_message_to_log, "@{s35} struck {s34} with a banhammer."),
						(display_message, "@{s35} raised his glorious banhammer and smashed it upon the head of {s34}."),
						(ban_player, ":hpid", 1, ":dpid"),
					(try_end),
					
					(try_begin),
						(multiplayer_is_server),
						(ge, ":dpid", 0),
						(ge, ":hpid", 0),
						(player_get_team_no, ":dTeam", ":dpid"),
						(player_get_team_no, ":hTeam", ":hpid"),
						(neq, ":dpid", ":hpid"),
						(eq, ":dTeam", ":hTeam"),
						(player_get_slot,":td",":dpid",madmin_pslt_tw),
						(val_add, ":td", ":damage"),
						(player_set_slot,":dpid",madmin_pslt_tw, ":td"),
					(try_end),
					
				]),

Any ideas as to why this isn't working client-side (the respective parts that is). I'm not even getting the Agent Hit! message.
 
Eureka! I've got the way it was can might've been (able to have been)* done. An empty dialog entry at teh top of dialogs which applies to all troops and NPCs and is used only when a global var is set to something. Set it and you fire this dialog. The dialog first the presentation, passing the globalvariables of "$g_talk_troop" and everything else needed to the presentation...

* YAY English... :lol:
 
Somebody said:
Something like this
Code:
        (try_begin), #selecting helmets to display
          (eq, ":item_classes_begin", multi_item_class_type_heads_begin),
          (multiplayer_get_my_player, ":player_no"),
          (player_get_slot, ":selected", ":player_no", slot_player_selected_item_indices_begin+8),
          #check if hood is selected
          #easiest to do is to lower item_classes_end to exclude head-covering multi_item_class_type_heavy_helm
        (else_try),
          (assign, ":selected", -1),
        (try_end), #otherwise add individual checks below
        (try_for_range, ":item_no", all_items_begin, all_items_end),
          (item_get_slot, ":item_class", ":item_no", slot_item_multiplayer_item_class),
          (is_between, ":item_class", ":item_classes_begin", ":item_classes_end"),
          (this_or_next|eq, ":selected", -1), #hood not selected
          #check for disallowed helmets here
This should prevent the item icon from showing up if a hood is in the selected glove slot (provision for spawned/selected helmets elsewhere). You could always code up a script that unequips invalid helmets at spawn time anyways.

thanks somebody, gonna try that out!

you seem to have an answer for every problem  :grin:
 
I asked yesterday but noone replied so whether it has been overlooked or noone knows.

I just ask again because I haven't give up hope.

Is there a way to change the physics for ragdolls?
 
Is it possible to have few part mesh with few different textures in 1.011?
For example, I am creating sword, and I would like to have "sword" with envmap shader for metal parts and "sword.1" for leather parts (grip) with specular_shader_skin, and "sword.2" with dot3_alpha_shader for feathers (or however it is called) that are on pommel.
 
Status
Not open for further replies.
Back
Top Bottom