Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Somebody said:
I found that stuff in module_scene_props, inside ti_on_scene_prop_hit, which apparently stores the id of the attacker inside the x component of pos2 (some hardcoded trigger magic), so if you use it outside, pos2 will be unassigned and the agent is invalid.
Also, I forgot this - (set_fixed_point_multiplier, 1), which might also explain whatever invalid value you get since ids are ints.
Yea exactly, I cant use that as agent id outside of scene props, which I need to do for what I'm doing..

Can you think of any other method?
 
Ethan109 said:
MadocComadrin said:
Redo the terrain code with the same keys, but disable the no-grass option.

Sorry, but how do I go about doing that?  :oops: I'm still learning the ropes.

I haven't done this in a while, but I think this is how it works. First copy the terrain code that who originally got from edit-mode (the one with no static grass). Then go in-game to the terrain generator and press the paste button. Then just make sure the disable grass button is off and click generate.
 
WookieWarlord said:
Yea exactly, I cant use that as agent id outside of scene props, which I need to do for what I'm doing..
huh? why can't you run your script from ti_on_scene_prop_hit trigger?

The other method would include running a constant check with try_for_agents and get_distance_between_positions for positions of agents and a prop, and assuming that nearest agent is attacking. You really would not want to do it like that, especially if your prop is big :smile:


And I yet to find a solution for that one:
GetAssista said:
I have a simple flat 400 tri mesh in Wings 3d file, that refuses to be exported - specifically, export runs w/o errors but output file is empty (no matter format). At the same time Wings saves/loads it into its own file format just fine.
Export is empty even when I assign hole material to all the triangles except one, or select arbitrary subsets. Cleanup does not help too.
 
Is there any way to limit a weapon to only the player? So he can't give it to companions, but can sell it?
Or make it so when a player hits a key, it looks like he's throwing a stone, and there's an explosion generated where he looks? (I'm making a special weapon called "Shock Grenades" available only to the Recluse class)

EDIT: I checked my list of abilities and found out that I have to make a "Cloak" ability. So, which are the team numbers and how can I make the player to be temporarily allied to both teams? (So the player will act "invisible".) His army mustn't be allied to the enemies, though.
There is this "agent_set_team" operation, but I don't get the number of the team it requires.
 
Lumos said:
Is there any way to limit a weapon to only the player? So he can't give it to companions, but can sell it?

Code:
["repeating_sniper_crossbow", "Special Repeating Siege Crossbow", [("crossbow_c",0)], itp_type_crossbow |itp_merchandise|itp_primary|itp_two_handed|itp_cant_reload_on_horseback ,itcf_shoot_crossbow|itcf_carry_crossbow_back, 
683 , weight(3.75)|difficulty(10)|spd_rtng(37) | shoot_speed(70) | thrust_damage(63 ,pierce)|max_ammo(3),imodbits_crossbow ],

Code:
  # script_restrict_repeating_crossbow_to_player
  # Input: arg1 = troop_no
  # Output: none (Can fail)
  ("restrict_repeating_crossbow_to_player",
    [
      (store_script_param, ":troop_no", 1),
      (store_script_param, ":item_no, 2),
      (store_script_param, ":imod", 3),
     (try_begin),
        (neq, ":troop_no", "trp_player"),
        (troop_has_item_equipped, ":troop_no", ":item_no"),
        (this_or_next|eq, ":imod", imod_cracked),
        (this_or_next|eq, ":imod", imod_bent),
        (this_or_next|eq, ":imod", 0),
        (eq, ":imod", imod_masterwork),
        (eq, ":item_no", "itm_repeating_sniper_crossbow"),
        (troop_remove_item, ":troop_no", "itm_repeating_sniper_crossbow"),
        (troop_add_item, "trp_player", "itm_repeating_sniper_crossbow", ":imod"),
     (else_try),
        (add_xp_to_troop, 0, "trp_kingdom_1_lord"), #placeholder
     (try_end),
  ]),
  (0,
  [
      (call_script, "script_restrict_repeating_crossbow_to_player"),
    ]),
EDIT: I know, I can't help with others.
 
Huh. Awesome, thanks. I don't know where my mind was when I wrote that. :smile:

EDIT: Sadly, I know:
Lumos said:
I checked my list of abilities and found out that I have to make a "Cloak" ability. So, which are the team numbers and how can I make the player to be temporarily allied to both teams? (So the player will act "invisible".) His army mustn't be allied to the enemies, though.
There is this "agent_set_team" operation, but I don't understand the number of the team it requires.
 
Is there some shader that supports making whole armor translucent (assuming the texture has the correct alpha values), and if not, is there one that supports partial transparency (maybe hair shader)? I've tried a few shaders with 50% alpha texture, but in-game the armor is invisible.
 
What does it mean if part of a mesh is blue in Wings3d? It seems to prevent things from loading, but how do I add/remove that? As it has successfully annoyed me.
 
FrisianDude said:
What does it mean if part of a mesh is blue in Wings3d? It seems to prevent things from loading, but how do I add/remove that? As it has successfully annoyed me.
Yeah, it's the 'hole' material wings uses to make... holes. Go face tab, LMB and change the material to default or whatever. Newer versions of wings don't have this anymore.
 
So i've been trying to make the battle continuation thing work using the method outlined by MartinF.http://forums.taleworlds.com/index.php/topic,61929.msg1603855.html#msg1603855

Everything works perfectly except for the common_battle_tab_press constant, i think. When i press tab, it always asks to retreat, regardless of whether i've won or lost the battle. Does anyone have any experience with this particular modification or know how i can fix this?

Here's the code
common_battle_tab_press = (
  ti_tab_pressed, 0, 0, [],
  [
    (try_begin),
      (eq, "$battle_won", 1),
      (call_script, "script_count_mission_casualties_from_agents"),
      (finish_mission,0),
  (else_try),
      (eq, "$pin_player_fallen", 1),
      (call_script, "script_simulate_retreat", 5, 20),
      (str_store_string, s5, "str_retreat"),
      (call_script, "script_count_mission_casualties_from_agents"),
      (set_mission_result, -1),
      (finish_mission,0),
    (else_try),
      (call_script, "script_cf_check_enemies_nearby"),
      (question_box,"str_do_you_want_to_retreat"),
    (else_try),
      (display_message,"str_can_not_retreat"),
    (try_end),
    ])
 
The global variable is actually g_battle_won. So obviously it would never trigger. And btw, if you didn't get the camera working yet, just add a one or 0 as the last parameter of mission_cam_animate_to_position.
 
Oh, hahaha, thanks alot. I noticed that error while it was compiling but i'm totally noob so i didn't think much of it.

I actually haven't tried the camera thing yet, but i'd have been lost there too, so thanks!  :grin:
 
Highlander said:
FrisianDude said:
What does it mean if part of a mesh is blue in Wings3d? It seems to prevent things from loading, but how do I add/remove that? As it has successfully annoyed me.
Yeah, it's the 'hole' material wings uses to make... holes. Go face tab, LMB and change the material to default or whatever. Newer versions of wings don't have this anymore.
Ah, thanks. Yeah, I thought it was the hole bit, but yeah. I'll see. :razz:

Anyway, would it be possible to script it so that a certain strength value limits the amount of weight you can use in your hands at the same time? (In hands is weapon (and shield))
 
Is there an easy way to make an agent (player in multiplayer, specifically) not be able to move from a specific spot? And if I make the spot move, allow the agent to stay with the spot?

Also, is there a limit to how large a number you can use for entry points (I assume it's the integer limit, but I want to make sure)

Also this:
MadocComadrin said:
Is there some shader that supports making whole armor translucent (assuming the texture has the correct alpha values), and if not, is there one that supports partial transparency (maybe hair shader)? I've tried a few shaders with 50% alpha texture, but in-game the armor is invisible.

Thanks!
 
Okay, I'm curious, here. In my mod almost every ranged weapon has more than 1 ammo, and I intend to have it displayed in the item info. Now, I could manually add the ammo capacity for every item in the item_get_extra_info or whatever it's called, but I'm fairly sure there's an easier way.

I've got a vague idea of how to do it - the auto-loot script retrieved every detail of an item (I'm not sure if it did ammo,) and one could go and have the item_get_extra_info script check if an item is a ranged weapon, get the ammo capacity and return a string with either (6/6) (or whatever the amount may be) or Single shot. Now, what I'm wondering is whether there's an easier way to do this or better yet if someone's already done this.

Also, is there a way to reload readying speed and reloading speed?
 
MadocComadrin said:
Is there an easy way to make an agent (player in multiplayer, specifically) not be able to move from a specific spot? And if I make the spot move, allow the agent to stay with the spot?

Also, is there a limit to how large a number you can use for entry points (I assume it's the integer limit, but I want to make sure)
Code:
   (0, 0, 0, [],
      [           
        (multiplayer_is_server),
        (try_for_agents, ":cur_agent"),
        (agent_get_troop_id, ":cur_troop", ":cur_agent"),
        (agent_get_entry_no, ":entry_no", ":cur_agent"),
        (try_begin),
           (eq, ":cur_troop", "trp_Bob"),
           (entry_point_get_position, pos5, ":entry_no"),
           (agent_set_animation, ":cur_agent", "anim_standstill"), #maybe give an animation so he doesn't run on the spot.
           (agent_set_position, ":cur_agent", pos5),
        (try_end),
      (try_end),
       ]),
I think you could force him into any position, I did it at an entry point, so he stays where he spawns.
You should be able to adapt that to forcing a player to one spot.
You may also be interested in:
Code:
(agent_set_scripted_destination,<agent_id>,<position_no>,<auto_set_z_to_ground_level>),
As for your other question, I think you can at least have well over 100 entry points, but bot agents can only SPAWN at 1-19 or something similar.
 
Status
Not open for further replies.
Back
Top Bottom