Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
kraggrim said:
Drugs, this is what I was told when I asked that before:
JuJu70 said:
In mission templates you need to compare village_attack_bandits and village_raid to lead_charge and make changes, also need to edit in game_menu attack_bandits and village_raid (or whatever it's called).

Sadly I wasn't able to figure it out.
Hello. I'm interested in this thing as well. I am new to modding as well. I looked at these mission-templates, but didn't find the answer either. What I was thinking about: After we win in usual battles in the field we get both 'capture prisoners' and 'looting' screens. After we capture a settlement we only have the 'capture prisoners' screen So we should just copy the code of looting menu from the usual battle's code and put it after the 'capture prisoners' code from the siege victory code.
In addition we can add the code to reward the player with money and xp after for capturing a settlement. Again we copy he code and put it in the right place.
Unfortunately, I do not know for sure how to do this correctly but I've found some code. I hope that more experienced modders will help us.

I did everything in module_game_menus.py
Code:
         
          (troop_clear_inventory, "trp_temp_troop"),
          (call_script, "script_party_calculate_loot", "p_total_enemy_casualties"), #p_encountered_party_backup changed to total_enemy_casualties
          (gt, reg0, 0),
          (troop_sort_inventory, "trp_temp_troop"),
          (change_screen_loot, "trp_temp_troop"),
        (else_try),
          #finished all
          (try_begin),
            (le, "$g_ally_party", 0),
            (end_current_battle),
          (try_end),
          (call_script, "script_party_give_xp_and_gold", "p_total_enemy_casualties"), #p_encountered_party_backup changed to total_enemy_casualties
          (try_begin),
            (eq, "$g_enemy_party", 0),
            (display_message,"str_error_string"),
          (try_end),

I also found a simpler way of rewarding with money and xp, but it is a fixed amount.
Add this
Code:
        #Add a fixed amount of money and xp to player after he has captured a settlement
        (call_script, "script_troop_add_gold", "trp_player", 5000),
	(add_xp_as_reward, 500), 
     
after this line
Code:
        (call_script, "script_change_troop_renown", "trp_player", 5),
You can put any amount instead of 5000 and 500.
Of course, make this changes in a separate module, not directly in Native!
I hope this code will be improved by experienced modders.
 
TheVideoGameInn said:
Noone knows?
What should we be knowing? Forcing us to scan through previous pages is not a good idea. If you're going to bump your own posts every six hours, at least have the decency to quote yourself. (But put pictures of that size in spoiler tags so they don't occupy half our screens every time.)

I'm wondering what you expected when you gave the horse animations to an ostrich. There's obviously ways to animate stuff, though you don't get to have "horse alternatives", or at least not much freedom with them. You've got to rig your model first, which can be explained as binding surfaces to different bones. Then you can apply the horse animations, if you want the ostrich to be rideable. Or, though excessive scripting, you should be able to force a custom animation loop on the ostrich, if you use the horse skeleton. DO NOT rig it to other skeletons, that won't work.
 
Ironically an ostrich could quite seamlessly be rigged to a horse skeleton. The back legs of a quadruped are almost identical in movement to the back legs of an animal with recurve legs like an ostrich.

SURVIVAL-ostrich017.jpg

It'd probably need really precise manual rigging though. And I have no idea how manual rigging works, so good luck.
 
That's actually pretty cool, and I didn't know about that, but if the ostrich indeed gets rigged to the hind legs of the horse skeleton, then a mounting player will either be seated on the ostrich's head, shoved up his arse, or will be floating in mid-air somewhere in close proximity to the ostrich's head, which will of course depend on the model... the player's mounting position is fixed, right?
Then there's the problem with the collision volumes, which, IIRC, are defined per-skeleton. This might be a lie, though.

A far-fetched idea could be to rig the ostrich to the hind legs of the horse skeleton, but do a Z (or X, or whatever forwards was) offset so that a mounted players sits atop the ostrich properly. I really don't know if the collisions would be okay, but it would be a fun experiment, and may just work.

jacobhinds said:
It'd probably need really precise manual rigging though. And I have no idea how manual rigging works, so good luck.
I had to rig a full humanoid once, and to be honest, it's not as bad as I thought it would be. You just need to bind every vertex to a bone, with various degrees of strictness. 3DSMax comes with a full set of tools which made the process exceptionally easy (bar some manual number-adjusting I had to do for some trickier verts), and Blender can't be without them too. And given that an ostrich so much fits a horse's hackside, rigging it would probably be even easier. :smile:
 
vitali-attila said:
kraggrim said:
Drugs, this is what I was told when I asked that before:
JuJu70 said:
In mission templates you need to compare village_attack_bandits and village_raid to lead_charge and make changes, also need to edit in game_menu attack_bandits and village_raid (or whatever it's called).

Sadly I wasn't able to figure it out.
Hello. I'm interested in this thing as well. I am new to modding as well. I looked at these mission-templates, but didn't find the answer either. What I was thinking about: After we win in usual battles in the field we get both 'capture prisoners' and 'looting' screens. After we capture a settlement we only have the 'capture prisoners' screen So we should just copy the code of looting menu from the usual battle's code and put it after the 'capture prisoners' code from the siege victory code.
In addition we can add the code to reward the player with money and xp after for capturing a settlement. Again we copy he code and put it in the right place.
Unfortunately, I do not know for sure how to do this correctly but I've found some code. I hope that more experienced modders will help us.

I did everything in module_game_menus.py
Code:
         
          (troop_clear_inventory, "trp_temp_troop"),
          (call_script, "script_party_calculate_loot", "p_total_enemy_casualties"), #p_encountered_party_backup changed to total_enemy_casualties
          (gt, reg0, 0),
          (troop_sort_inventory, "trp_temp_troop"),
          (change_screen_loot, "trp_temp_troop"),
        (else_try),
          #finished all
          (try_begin),
            (le, "$g_ally_party", 0),
            (end_current_battle),
          (try_end),
          (call_script, "script_party_give_xp_and_gold", "p_total_enemy_casualties"), #p_encountered_party_backup changed to total_enemy_casualties
          (try_begin),
            (eq, "$g_enemy_party", 0),
            (display_message,"str_error_string"),
          (try_end),

I also found a simpler way of rewarding with money and xp, but it is a fixed amount.
Add this
Code:
        #Add a fixed amount of money and xp to player after he has captured a settlement
        (call_script, "script_troop_add_gold", "trp_player", 5000),
	(add_xp_as_reward, 500), 
     
after this line
Code:
        (call_script, "script_change_troop_renown", "trp_player", 5),
You can put any amount instead of 5000 and 500.
Of course, make this changes in a separate module, not directly in Native!
I hope this code will be improved by experienced modders.

wow, amazing :smile:! thank you guys for answering :smile: hoping more experienced modders also will answer to this. that would be awesome.
and as i mentioned in my last post: its about getting to loot + experience and money after every siege battle, because you dont in native.
 
DruGs said:
vitali-attila said:
Add this
Code:
        #Add a fixed amount of money and xp to player after he has captured a settlement
        (call_script, "script_troop_add_gold", "trp_player", 5000),
	(add_xp_as_reward, 500), 
     
after this line
Code:
        (call_script, "script_change_troop_renown", "trp_player", 5),
You can put any amount instead of 5000 and 500.
Of course, make this changes in a separate module, not directly in Native!
I hope this code will be improved by experienced modders.
wow, amazing :smile:! thank you guys for answering :smile: hoping more experienced modders also will answer to this. that would be awesome.
and as i mentioned in my last post: its about getting to loot + experience and money after every siege battle, because you dont in native.

By the way I forgot to mention that the code above works only when you capture a settlement. Though only the message of receiving money appears on the screen. But in script_add_gold there is nothing written about messaging, so it must be automatically.
Does anyone know why there how to make the message of xp received show up on the screen?

The code for the loot screen after defending a town/castle should be the same. Again I have found where to put it and again with a fixed amount of gold and xp.
So after this lines in module_game_menus.py
Code:
              (display_message, "@The enemy has been forced to retreat. The assault is over, but the siege continues."),
              (assign, "$g_battle_simulation_cancel_for_party", "$g_encountered_party"),
add this code
Code:
              (call_script, "script_troop_add_gold", "trp_player", 1000),
              (add_xp_as_reward, 300),
Again, you can put any numbers instead of 1000 and 300. :smile: I should check the code for the looting screen I posted in the previous message.
 
How to add a code which will be active when 'E' is pressed for example?

Edit: @The_Dragon Thanks!
 
Using a trigger like this:
Code:
(0, 0, 0, [(key_clicked, key_e)],[
## your code here ##
]),

If you are on the world map, then add the trigger into module_triggers.
If you are in a mission, then add it to the corresponding mission_template.
 
Hello, I am trying to edit the deathmatch code in module_mission_templates so that players will always spawn on an entry point. At the moment it seems players only some of the time spawn on the entry points, which is really annoying as they keep spawning in places I don't want them to spawn.

The logical place to start seemed to be to edit the lines that say:
Code:
           (call_script, "script_multiplayer_find_spawn_point", ":player_team", 0, ":is_horseman"), 
           (player_spawn_new_agent, ":player_no", reg0),
However when you go to module_scripts, the only script you will see is: "multiplayer_find_spawn_point_2". This shows that the script called upon in the above code does not exist. Does this mean the above lines of code is meaningless? If this is the case I cannot figure out where look in module_mission_templates in order to force players to spawn on entry points.
 
"multiplayer_find_spawn_point" is above "multiplayer_find_spawn_point_2".
To make them spawn only at one entry point, you need to edit the player_spawn_new_agent operation (you can delete the call script line).
Code:
player_spawn_new_agent               = 409 # (player_spawn_new_agent, <player_id>, <entry_point>),
Replace the <entry_point> with your entry and you are done.
 
Life_Erikson said:
Where is the original faction of a city set?

For some reason curraw is set as a khergit citiy in native which causes me some problems...
It might be this section:

#Give centers to factions first, to ensure more equal distributions
  (call_script, "script_give_center_to_faction_aux", "p_town_1", "fac_kingdom_4"),

Under ("game_start",  in module_scripts.py.

 
Thanks! Strangely it is set as faction_kingdom_2 which is the vaegirs.

I implemented a code which checks for the faction of a town and gives it certain troops. It works perfect.
However curraw allways gets khergit troops.

Here an exemple:
Code:
      ("hire_vaegir_spearman",[(party_get_slot,":town_faction","$g_encountered_party",slot_center_ex_faction),(eq,":town_faction","fac_kingdom_2"),],"Hire vaegir spearmen.",
       [
           (jump_to_menu,"mnu_town_hire_vaegir_spearman"),
        ]),
Code:
      ("hire_khergit_professional_lancer3",[(party_get_slot,":town_faction","$g_encountered_party",slot_center_ex_faction),(eq,":town_faction","fac_kingdom_3"),],"Hire khergit lancers.",
       [
           (jump_to_menu,"mnu_town_hire_khergit_professional_lancer3"),
        ]),

Has anybody an idea what could cause this?
 
It is because slot 'slot_center_ex_faction' gets set to kingdom_3 for town_11 (curaw).
In script game_start there is this line (line 614 in notepad++):
Code:
(party_set_slot, "p_town_11",   slot_center_ex_faction, "fac_kingdom_3"), #Khergits claim vaegir-held curaw
 
Life_Erikson said:
Ah, I see. So khergit actually is it's "original" faction.

Would it have any negative effect to simply change it to some vaegir castle?

this slot makes things more interesting as the AI likes to go to war to recover lost land  :mrgreen:
as long you keep that in mind it is all good
 
Status
Not open for further replies.
Back
Top Bottom