Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
I'm looking for a way to change the ocean terrain into the river terrain.

Basically, I want the ocean terrain to keep its waves breaking against the coast effect, but otherwise look exactly like the river terrain. As in no shallow/deep water effect.
 
Cozur said:
I'm looking for a way to change the ocean terrain into the river terrain.

Basically, I want the ocean terrain to keep its waves breaking against the coast effect, but otherwise look exactly like the river terrain. As in no shallow/deep water effect.
I guess it's done like this:

1. Go to Warband's Textures folder.
2. Find river.dds file.
3. Copy it to your mod's Textures folder as ocean.dds.
 
Lav said:
Cozur said:
I'm looking for a way to change the ocean terrain into the river terrain.

Basically, I want the ocean terrain to keep its waves breaking against the coast effect, but otherwise look exactly like the river terrain. As in no shallow/deep water effect.
I guess it's done like this:

1. Go to Warband's Textures folder.
2. Find river.dds file.
3. Copy it to your mod's Textures folder as ocean.dds.

Or, you simply find the texture that Ocean is using as its texture and edit it via PS.
 
Waldzios said:
Somebody said:
No, it's called for the troop being upgraded, not the troop it upgrades to.
Then, how it is possible ? (simple trick with counting number of calls)
upgradec.jpg
It's definitely called for  troop it upgrades to, but with  the troop being upgraded as only script param.
The script "game_get_upgrade_xp" is called for the troop being upgraded.
"game_get_upgrade_cost" is called for the new, upgrade troop(s).

As for getting which upgrade it is (and making it not level based), it looks like you'd either need to store the prior troop in the tree in a troop_slot for the new troops, or do a loop that checks for what troops upgrade to it and whether that upgrade is 0 or 1 with (troop_get_upgrade_troop,<destination>,<troop_id>,<upgrade_path>), #upgrade_path can be: 0 = get first node, 1 = get second node (returns -1 if not available)
 
Waldzios said:
Then, how it is possible ? (simple trick with counting number of calls)
upgradec.jpg
It's definitely called for  troop it upgrades to, but with  the troop being upgraded as only script param.
Did a brief research. It is definitely possible, but the trick is not so simple.

When you select a troop in the party window, the game calls script_game_get_upgrade_cost once for each available upgrade path - that is, once or twice. You can check if the script is supposed to be called once or twice by checking that the troop has a second upgrade path available.

When the troop is upgraded, it looks like script_game_get_upgrade_cost is called once to get the cost of selected upgrade, and then twice to get all upgrade costs. No idea why. So for troops with 1 upgrade path, script is called 3 times during upgrade. For troops with 2 upgrade paths, the script is called 5 times.

Now, the problem is simple: when the game is calling script_game_get_upgrade_cost, you have no way of knowing if the call is made to get upgrade cost for actual upgrade, or the game is just requesting upgrade costs to display them on the screen. However in the next call to script_game_get_upgrade_cost, number of upgraded troops in the party will increase. When you detect this situation, this means that previous call was not "get me upgrade price for first path", but "get me upgrade price for the troop type which number has increased". If troop from the second path increased in number, then it means player actually clicked on the second upgrade button - in this case you must manually charge him the difference in price between second and first upgrades (multiplied by number of troops actually upgraded), and otherwise treat this call to script_game_get_upgrade_cost as the first call (i.e. return upgrade cost for first path).
 
Belendor Torheal Artendor said:
I just watched the Battering Ram and Mill proof of concept videos for Crusaders: Way to Expiation. And, i am wondering, how to assign an animation like that to any object and even if we do, would it read the bones automatically?
 




As you can see, there's a sort of deep sea effect, amongst other things, with the ocean terrain, while the river terrain is more bland. It has nothing to do with the texture itself.

What I am looking for is a way to turn the ocean terrain into the river terrain, without actually having to use the river terrain.
 
I have asked this before and could someone explain to me what sf_priority does in the module sounds. I just want to know what this does, pretty please with cherries on top.
 
xPearse said:
I have asked this before and could someone explain to me what sf_priority does in the module sounds. I just want to know what this does, pretty please with cherries on top.
sf_priority means Science Fiction priority. If your mod has a science fiction theme (SW, W40K etc.) it will play certain files and won't play others, according to the code. For example, sf_priority=8 is a code for Star Wars. It's an undocumented feature, and you have to ask TW what the other codes mean. If your mod is not about SF, you probably need to put sf_priority=0.

/trolling

Guess: there are only so many sounds MB will play at the same time on a busy battlefield with plenty of events that cause sounds. How does it choose which ones to play when there are too many? There.
 
Hey guys Who do I make a Traveller spawn in 10 seconds when I get in a town/place?

Example

You enter the town of mod_town
You wait 10 seconds while in your town
A traveller apears

Who do I do that?

Sorry for my English. Im Peruvian
 
See "alley_fight" in mission templates.
Hint: add_visitors_to_current_scene

Here's a good procedure how to solve problems yourself:
1. Think of a situation where Warband does something similar, or the same thing. E.g. a merchant spawns in the intro mission and runs to talk to you. Or bandits spawn in the bandit lair.
2. Search for keywords through the relevant code. E.g. "merchant" or "bandit" in mission templates.
3. ???
4. Profit
 
Sorry if there are some question like this in this topic because there are alot of page, and you know that i can't check all with my poor English.  I want to ask that how can i add more object to my mod. That isn't like add object to the edit screen, hope you understand
 
MadVader said:
xPearse said:
I have asked this before and could someone explain to me what sf_priority does in the module sounds. I just want to know what this does, pretty please with cherries on top.
sf_priority means Science Fiction priority. If your mod has a science fiction theme (SW, W40K etc.) it will play certain files and won't play others, according to the code. For example, sf_priority=8 is a code for Star Wars. It's an undocumented feature, and you have to ask TW what the other codes mean. If your mod is not about SF, you probably need to put sf_priority=0.

/trolling

Guess: there are only so many sounds MB will play at the same time on a busy battlefield with plenty of events that cause sounds. How does it choose which ones to play when there are too many? There.

So if I put the sf_ priority 0 it will not play only a selected sounds.
 
xPearse said:
MadVader said:
xPearse said:
I have asked this before and could someone explain to me what sf_priority does in the module sounds. I just want to know what this does, pretty please with cherries on top.
sf_priority means Science Fiction priority. If your mod has a science fiction theme (SW, W40K etc.) it will play certain files and won't play others, according to the code. For example, sf_priority=8 is a code for Star Wars. It's an undocumented feature, and you have to ask TW what the other codes mean. If your mod is not about SF, you probably need to put sf_priority=0.

/trolling

Guess: there are only so many sounds MB will play at the same time on a busy battlefield with plenty of events that cause sounds. How does it choose which ones to play when there are too many? There.

So if I put the sf_ priority 0 it will not play only a selected sounds.
That would be pointless - if you don't want sounds to play you can simply remove them. Better explain why do you need this info and people will be able to help you better.
(also notice that the first part above was a joke - I'm a troll :smile:)
 
MadVader said:
See "alley_fight" in mission templates.
Hint: add_visitors_to_current_scene

Here's a good procedure how to solve problems yourself:
1. Think of a situation where Warband does something similar, or the same thing. E.g. a merchant spawns in the intro mission and runs to talk to you. Or bandits spawn in the bandit lair.
2. Search for keywords through the relevant code. E.g. "merchant" or "bandit" in mission templates.
3. ???
4. Profit

I don't see how this can help the add_visitors is an arena scene
 
MadVader said:
That would be pointless - if you don't want sounds to play you can simply remove them. Better explain why do you need this info and people will be able to help you better.
(also notice that the first part above was a joke - I'm a troll :smile:)

Oh right then, guess I shouldnt have sent that e-mail to taleworlds asking about the sf_priority. Well I want to change it to make the sound that plays totally random and not cling more to the start. Just when you said trolling I though you meant this bit

MadVader said:
/trolling

Guess: there are only so many sounds MB will play at the same time on a busy battlefield with plenty of events that cause sounds. How does it choose which ones to play when there are too many? There.
 
xPearse said:
MadVader said:
That would be pointless - if you don't want sounds to play you can simply remove them. Better explain why do you need this info and people will be able to help you better.
(also notice that the first part above was a joke - I'm a troll :smile:)

Oh right then, guess I shouldnt have sent that e-mail to taleworlds asking about the sf_priority. Well I want to change it to make the sound that plays totally random and not cling more to the start. Just when you said trolling I though you meant this bit


Well that joke didn't work too well, but this is a good guess what sf_priority does:
MadVader said:
Guess: there are only so many sounds MB will play at the same time on a busy battlefield with plenty of events that cause sounds. How does it choose which ones to play when there are too many? There.
See how various footstep sounds have low priority, weapon sounds medium, and screams and such, especially dying, have high priority. Think of it as how important is that sound when you compare it to others, especially in a large melee.
 
Lav said:
Waldzios said:
Then, how it is possible ? (simple trick with counting number of calls)
upgradec.jpg
It's definitely called for  troop it upgrades to, but with  the troop being upgraded as only script param.
I finally nailed everything down, see OSP/Python Script Exchange.
Thanks, I already wrote something similar:
Code:
  ("game_get_upgrade_cost",
    [
      (store_script_param_1, ":troop_id"),
      
      (troop_get_upgrade_troop,":upgrade_troop_1",":troop_id",0),
      (troop_get_upgrade_troop,":upgrade_troop_2",":troop_id",1),

      (try_begin),
        (le, ":upgrade_troop_2", 0),
          (assign, ":upgrade_troop", ":upgrade_troop_1"),
      (else_try),
        (party_count_members_of_type,":temp_upgrade_no_1","p_main_party",":upgrade_troop_1"),
        (party_count_members_of_type,":temp_upgrade_no_2","p_main_party",":upgrade_troop_2"),

        (try_begin),
          (eq, "$g_upgrade_count", 0),
            (assign, ":upgrade_troop", ":upgrade_troop_1"),
            (assign, "$g_upgrade_count", 1),
        (else_try),
          (eq, "$g_upgrade_no_1", ":temp_upgrade_no_1"),
          (eq, "$g_upgrade_no_2", ":temp_upgrade_no_2"),
            (assign, ":upgrade_troop", ":upgrade_troop_2"),
            (assign, "$g_upgrade_count", 0),
        (else_try),
            (assign, ":upgrade_troop", ":upgrade_troop_1"),
            (assign, "$g_upgrade_count", 1),
            (neq, "$g_upgrade_no_2", ":temp_upgrade_no_2"),
              (store_sub, ":amount", ":temp_upgrade_no_2","$g_upgrade_no_2"),
              (call_script,"script_game_get_cost_diffrence",":upgrade_troop_1",":upgrade_troop_2"),
              (store_mul, ":diff", reg0, ":amount"),
              (set_show_messages,0),
              (troop_add_gold, "trp_player", ":diff"),
              (set_show_messages,1),
        (try_end),

        (assign, "$g_upgrade_no_1", ":temp_upgrade_no_1"),
        (assign, "$g_upgrade_no_2", ":temp_upgrade_no_2"),
      (try_end),
      
      (call_script,"script_game_get_cost_diffrence",":upgrade_troop",":troop_id"),
      (set_trigger_result, reg0),
  ]),
but there is problem with single or last troop in stack , when the stack is removed  the game_get_upgrade_cost is called only once :sad:.
 
Waldzios said:
but there is problem with single or last troop in stack , when the stack is removed  the game_get_upgrade_cost is called only once :sad:.
My script works correctly though. game_get_upgrade_cost is not called once in this situation, but it is called for a different troop. You are making checks for troop passed for current run, while actually you should work with troop from previous run, that's where the problem with your script is.
 
Status
Not open for further replies.
Back
Top Bottom