Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Does anyone know how to use the Horse animations?
The only animation I can force on a horse is the "rear" one. (Where the horse Rears up)
Jumping, turning head, running/walking all don't work.

I searched the forums and it was mentioned that all the horse_animations are directly tied to movement and therefor hardcoded.

If I can't use the original horse animation, could I instead duplicate it?
If so, would I need to just duplicate it in the module_animations or actually create another animation for in the .ani file?

 
Hatonastick said:
Another question:
Would (store_random_in_range, ":amount", 0, 0), return a range of 0 to 0 or 0 to -1?  I suspect 0, but need to know.  I wouldn't use a range of 0 to 0, just that one of the scripts I'm looking at has that as a potential range if certain criteria are met and I just need to know what the actual output would be in that situation.
Gut says 0 here, too. I'd expect 0 or an error before a -1...but I don't know for sure.

MaHuD said:
Does anyone know how to use the Horse animations?
The only animation I can force on a horse is the "rear" one. (Where the horse Rears up)
Jumping, turning head, running/walking all don't work.

I searched the forums and it was mentioned that all the horse_animations are directly tied to movement and therefor hardcoded.

If I can't use the original horse animation, could I instead duplicate it?
If so, would I need to just duplicate it in the module_animations or actually create another animation for in the .ani file?
Likely the reason you cannot call the other animations directly is their priority is not high enough to override movement. I don't believe that adding another amf_priority to the movement animations is a good idea, so duplicating them and then messing with the amf_priority flags would likely be how I'd approach it.
 
Caba`drin said:
Hatonastick said:
Another question:
Would (store_random_in_range, ":amount", 0, 0), return a range of 0 to 0 or 0 to -1?  I suspect 0, but need to know.  I wouldn't use a range of 0 to 0, just that one of the scripts I'm looking at has that as a potential range if certain criteria are met and I just need to know what the actual output would be in that situation.
Gut says 0 here, too. I'd expect 0 or an error before a -1...but I don't know for sure.
Thanks, gut instinct will do just fine -- in any case I think you are probably right. :smile:
 
Hi, I added a new troop using the Troop Editor. But now, I want to add it to the troop tree. Let's say, that troop will be the next upgrade for the "Nord Huscarl". How can I do that?
 
Bertanx said:
Hi, I added a new troop using the Troop Editor. But now, I want to add it to the troop tree. Let's say, that troop will be the next upgrade for the "Nord Huscarl". How can I do that?
Go to the Huscarl and add it as an upgrade for it?
Not sure which editor you are using, but that is straight forward with Morgh's.
 
Bertanx said:
Hi, I added a new troop using the Troop Editor. But now, I want to add it to the troop tree. Let's say, that troop will be the next upgrade for the "Nord Huscarl". How can I do that?

I do not know Troop Editor. However if you have module system it is easy.

Open module_troops.py
Go down and add this line:

Code:
upgrade(troops,"nord_champion","your_troop")
 
Caba`drin said:
Bertanx said:
Hi, I added a new troop using the Troop Editor. But now, I want to add it to the troop tree. Let's say, that troop will be the next upgrade for the "Nord Huscarl". How can I do that?
Go to the Huscarl and add it as an upgrade for it?
Not sure which editor you are using, but that is straight forward with Morgh's.

Gergin Adam said:
Bertanx said:
Hi, I added a new troop using the Troop Editor. But now, I want to add it to the troop tree. Let's say, that troop will be the next upgrade for the "Nord Huscarl". How can I do that?

I do not know Troop Editor. However if you have module system it is easy.

Open module_troops.py
Go down and add this line:

Code:
upgrade(troops,"nord_champion","your_troop")

Thanks to both of you. My bad...I should have seen the box named as "Upgrade path".  :lol:
 
Code:
finnish1 = (0, 0, 8, 
        [
           (multiplayer_get_my_player,":player_no"),
           (player_get_troop_id, ":player_troop", ":player_no"),
           (is_between, ":player_troop", "trp_finnish_rifleman_multiplayer", "trp_russian_rifleman_multiplayer"),
           (key_clicked, key_numpad_1),
        ],
        [
            #(multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_kylla"),
			(store_trigger_param_1, ":agent_id"),
			(call_script, "script_agent_play_sound", ":agent_id", "snd_kylla"),
        ])
For some reason, that won't play the sound when numpad is pressed, but if using it in a weapon like this:

Code:
["pystykorva", "M/28 'Pystykorva'", [("pystykorva_3",0)], itp_type_crossbow |itp_merchandise|itp_ignore_gravity|itp_primary|itp_next_item_as_melee ,itcf_shoot_crossbow|itcf_carry_spear, 650 , weight(6)|difficulty(0)|spd_rtng(30) | shoot_speed(150) | thrust_damage(80 ,pierce)|max_ammo(5)|accuracy(120),imodbits_none,
 [(ti_on_weapon_attack, [(store_trigger_param_1, ":agent_id"), (call_script, "script_agent_play_sound", ":agent_id", "snd_pystykorva")])]],
It works. Any suggestions?
 
I am trying to add an NPC inside Shariz Castle, near where Sultan Hakim stands.

In module_troops.py, I added the NPC code just after Tavern minstrel list (I tried several places). Here it is.

Code:
   ["caliph_1","Caliph of Sarranids","Caliph of Sarranids",tf_hero, scn_town_19_castle|entry(99),reserved, fac_commoners,
    [itm_sarranid_cloth_robe,itm_sarranid_boots_b],
    def_attrib|level(23),wp(100),knows_common,
    0x0000000fff10428659aa74e4f5aadd2500000000001e399c0000000000000000],

In Shariz castle scene, I assigned a new entry point and named it 99. (I tried to use existing ones but did not work)

Also I prepared a constant for dialogues.

However he does not show up. I waited one week, still nobody in the town castle. I checked some tutorials about adding NPC but could not find my mistake. What do I miss?
 
That method of stationing NPCs within a certain location is deprecated. If you look in module_game_menus under town_castle, you'll note that script_enter_court is being called, which resets all visitors and populates the lord's hall dynamically. You'll want to add your new npc as a visitor in that script.
 
If I do:

Code:
(assign, ":quantity_chance", 100),
(val_div, ":quantity_chance", 51),
This would normally give something like 1.96 etc. if you used a calculator.  However in Warband (without the operator that tells the engine to allow remainders) would the result be 1 or 2?  ie. does it round up, round down, or just drop the remainder?

I'm hoping it just drops/ignores the remainder and returns 1.  Would make my shonky maths hack work. :grin:
 
Hatonastick said:
If I do:

Code:
(assign, ":quantity_chance", 100),
(val_div, ":quantity_chance", 51),
This would normally give something like 1.96 etc. if you used a calculator.  However in Warband (without the operator that tells the engine to allow remainders) would the result be 1 or 2?  ie. does it round up, round down, or just drop the remainder?

I'm hoping it just drops/ignores the remainder and returns 1.  Would make my shonky maths hack work. :grin:

It will return 1, as local variables are integers and the operation work for integer only. You can multiply it by 10000 instead of 100, and get 196 as the result.
 
Gimp/Photoshop/Paint.NET
Brain 1.0
A mouse
The Warband Crosshair texture

(Obviously brain 1.0 and a mouse are just for fun. :wink:)
 
Somebody said:
That method of stationing NPCs within a certain location is deprecated. If you look in module_game_menus under town_castle, you'll note that script_enter_court is being called, which resets all visitors and populates the lord's hall dynamically. You'll want to add your new npc as a visitor in that script.

Thanks a LOT! It works now, my caliph stands next to Sultan Hakim. At first he was naked (what a blasphemy!), anyway found a way to fix.

I am not a skillful coder..  :oops: can you check my code? Is it ok or can be better? I added right under guard code.
Code:
      bla bla bla...
      (set_visitor, 7, ":guard_troop"),

#adding my caliph
     (try_begin),
      (eq, ":castle_scene", "scn_town_19_castle"),
      (set_visitor, 20, "trp_caliph_1"),   
     (try_end),
#end?
      
      (assign, ":cur_pos", 16),
      ...bla bla bla

My next question will be..  I prepared a dialogue template but I do not know where to put. Is there a specific space for new dialogues? Or I can locate just the bottom of everything?
 
dunde said:
Hatonastick said:
If I do:

Code:
(assign, ":quantity_chance", 100),
(val_div, ":quantity_chance", 51),
This would normally give something like 1.96 etc. if you used a calculator.  However in Warband (without the operator that tells the engine to allow remainders) would the result be 1 or 2?  ie. does it round up, round down, or just drop the remainder?

I'm hoping it just drops/ignores the remainder and returns 1.  Would make my shonky maths hack work. :grin:
It will return 1, as local variables are integers and the operation work for integer only. You can multiply it by 10000 instead of 100, and get 196 as the result.
Ok, thanks! :smile:
 
Status
Not open for further replies.
Back
Top Bottom