Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Hey . I have queestion about placing  npc/bots via entry points  on mp map (battle).

There is way to change that :


These npc alwas are hostile for second team .  They dont atack first team.

I want to create them as "neutral" but If player near them , they attack.
Because now after round start they run all of the map to kill players .


There is way to change/fix this?



I want create them like dogs/wolfs in Festung Breslau Mod .Thanks for any advice.
 
PitchPL said:
I want to create them as "neutral" but If player near them , they attack.

check agents operations, you can regulate if they are in attack mode or passive (call alarmed), and which teams are enemies/friendly. Add a trigger that detects when a enemy gets near them and change their behaviour. Remember to use a loop filtered by distance (radius around the position) to reduce performance impact.

you can also play with other alternatives like disable dynamics, turn speed to 0 (can't move), etc, if the agent is not a ranged unit.

and there may be other MP options as well to explore
 
kalarhan said:
PitchPL said:
I want to create them as "neutral" but If player near them , they attack.

check agents operations, you can regulate if they are in attack mode or passive (call alarmed), and which teams are enemies/friendly. Add a trigger that detects when a enemy gets near them and change their behaviour. Remember to use a loop filtered by distance (radius around the position) to reduce performance impact.

you can also play with other alternatives like disable dynamics, turn speed to 0 (can't move), etc, if the agent is not a ranged unit.

and there may be other MP options as well to explore



Thanks! I'll take a good look at this.

I have another little question.
Do you remember which part of the mission templates is responsible for  spawning destructable scene props and other stuff?  Because after round end everything which I add via (this script) It is only for one(first ) round.

Thanks.
Code:
siege_multi_items = (1,0,800,[(multiplayer_is_server)],[
      
      (try_for_range,":entry",60,64), 
         (entry_point_get_position,pos1,":entry"),
         (set_spawn_position,pos1),
         (spawn_horse,"itm_uber_horse",0),
      (end_try),
      
      (try_for_range,":entry",65,69), #para defensores
         (entry_point_get_position,pos1,":entry"),
         (set_spawn_position,pos1),
         (spawn_item,"itm_t_good_sablya_a",0),
      (end_try),

 (try_for_range,":entry",70,71), #para defensores
         (entry_point_get_position,pos1,":entry"),
         (set_spawn_position,pos1),
		 (spawn_agent,"trp_npc1",0),
      (end_try),            
      ])
 
PitchPL said:
Do you remember which part of the mission templates is responsible for  spawning destructable scene props and other stuff? 

I dont play/mod MP, but if you are talking about a mission template: find which MT you are using, and all triggers for that specific MP mode will be listed there.
 
Hi

Do you know why certain consumable items can not be consumed like "date Fruit", Oil, ale... and some other one?
I have had the flag "itp_consumable" but...

Also, why pork, beef and chicken are eaten very fast?

How can I change that?


Thank you.
 
lolitablue said:
Do you know why certain consumable items can not be consumed like "date Fruit", Oil, ale... and some other one?
I have had the flag "itp_consumable" but...

Also, why pork, beef and chicken are eaten very fast?

see flags for food and food_quality, the range for food items, and the code that controls stuff like meat going bad.

Code:
food_begin = "itm_smoked_fish"
food_end = "itm_siege_supply"

like the script that "consumes", as in, removes food from inventory
Code:
  # script_consume_food
  # Input: arg1: order of the food to be consumed
  # Output: none
  ("consume_food",
   [(store_script_param, ":selected_food", 1),
    (troop_get_inventory_capacity, ":capacity", "trp_player"),
    (try_for_range, ":cur_slot", 0, ":capacity"),
      (troop_get_inventory_slot, ":cur_item", "trp_player", ":cur_slot"),
      (is_between, ":cur_item", food_begin, food_end),
      (troop_get_inventory_slot_modifier, ":item_modifier", "trp_player", ":cur_slot"),
      (neq, ":item_modifier", imod_rotten),
      (item_slot_eq, ":cur_item", slot_item_is_checked, 0),
      (item_set_slot, ":cur_item", slot_item_is_checked, 1),
      (val_sub, ":selected_food", 1),
      (lt, ":selected_food", 0),
      (assign, ":capacity", 0),
      (troop_inventory_slot_get_item_amount, ":cur_amount", "trp_player", ":cur_slot"),
      (val_sub, ":cur_amount", 1),
      (troop_inventory_slot_set_item_amount, "trp_player", ":cur_slot", ":cur_amount"),
    (try_end),
    ]),

and the triggers


Code:
  # Consuming food at every 14 hours
  (14,

  # Setting item modifiers for food
  (24,
 
whydott said:
What is the purpose for giving unit more than one weapon or armor? is it just for diverse looking?

items are selected on a normal curve distribution, based on the item value. So if you have a cheap sword, a normal priced sword, and a expensive sword, that means most troops will use the normal one, while a few will have the cheap or expensive version.

you can manipulate the distribution by adding copies of a item (2 of the same normal priced sword, as a example). You can also combine this with different types of weapons belonging to the same category (like 1 handed weapons). A example: 5 swords and 2 axes on inventory.

By properly giving the troop profiencies (1-handed, 2-handed, polearms, etc) and using "must have this" flags, like "must use a shield", you can control what the agent will have on his 4 slots (which were picked from the entire troop inventory).
 
kalarhan said:
whydott said:
What is the purpose for giving unit more than one weapon or armor? is it just for diverse looking?

items are selected on a normal curve distribution, based on the item value. So if you have a cheap sword, a normal priced sword, and a expensive sword, that means most troops will use the normal one, while a few will have the cheap or expensive version.

you can manipulate the distribution by adding copies of a item (2 of the same normal priced sword, as a example). You can also combine this with different types of weapons belonging to the same category (like 1 handed weapons). A example: 5 swords and 2 axes on inventory.

By properly giving the troop profiencies (1-handed, 2-handed, polearms, etc) and using "must have this" flags, like "must use a shield", you can control what the agent will have on his 4 slots (which were picked from the entire troop inventory).

It's sorted by price?

another thing, is it possible to paint the skybox? I wonder if I could paint a shadow giant like this in the sky.
8cd1c3d6415b98a787d3ed19ca0e429a.jpg
 
whydott said:
It's sorted by price?

another thing, is it possible to paint the skybox? I wonder if I could paint a shadow giant like this in the sky.

price=value, so yes. Game needs some reference to say that [Sword A] is better than [Axe B], and it uses the item value/price for that. It is your responsibility, as the modder, to make sure the item prices are properly defined, not just a random value that breaks your economy or troops gear selection.

skybox is like that, yes. You already have times of the day for it, and you can force change using operation
Code:
set_skybox                                   = 2389  # (set_skybox, <non_hdr_skybox_index>, <hdr_skybox_index>),
                                                     # Version 1.153+. Forces the scene to be rendered with specified skybox. Index of -1 will disable.
A example of VC using this operations to set the mood on a MP map
Code:
            (eq,":scene","scn_multi_scene_inv_5"),#cloudy, dark dusk
            (set_skybox, 6, 7),
            (set_fog_distance, 250, 0xFF928055),
            (set_fixed_point_multiplier,255),
            (set_startup_sun_light,410,330,190),
            (set_startup_ambient_light,60,40,10),
            (set_startup_ground_ambient_light,80,70,50),
You can't copy the numbers 6 and 7, as it should be obvious. You need to use OpenBRF and check your own game skybox list, then use the proper IDs there. Other operations give a example on how to change stuff like lightning.

You can also mess with fog, rain, snow, etc
Code:
(set_rain,0,0),
(set_fog_distance, 200, 0xFFA09060),

get Lav's modsys so you can search for operations.
 
kalarhan said:
PitchPL said:
I want to create them as "neutral" but If player near them , they attack.

check agents operations, you can regulate if they are in attack mode or passive (call alarmed), and which teams are enemies/friendly. Add a trigger that detects when a enemy gets near them and change their behaviour. Remember to use a loop filtered by distance (radius around the position) to reduce performance impact.

you can also play with other alternatives like disable dynamics, turn speed to 0 (can't move), etc, if the agent is not a ranged unit.

and there may be other MP options as well to explore



Well Im study this kind of stuff and I can't make bot/npc stay stable . They always want kill me with his fist ;c


there is my code (trash code warning)



Code:
	  	  	  	  	  	  (try_for_range,":entry",99,100), #para defensores
         (entry_point_get_position,pos1,":entry"),
         (set_spawn_position,pos1),
		 (spawn_agent,"trp_town_3_horse_merchant",0),
		 (try_for_agents, ":cur_agent"),
        (agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
		  (eq, ":cur_agent_troop", "trp_town_2_horse_merchant"),
        (agent_set_team, ":cur_agent", 3),	 
		(agent_set_no_dynamics, ":cur_agent", 0),
		(display_message, "@You must stay behind the line on the ground! Point is not counted."),
      (end_try),
 
PitchPL said:
there is my code (trash code warning)

you need to re-read the header_operations.py description. The dynamic operation, as a example, is not doing what you want it to do (wrong value)

why are you doing a loop for 1 ?
Code:
 (try_for_range,":entry",99,100), #para defensores

also check more operations, like "add_visitors_to_current_scene"

and do work on your code indentation before posting it, that hurts the eyes.
 
kalarhan said:
PitchPL said:
there is my code (trash code warning)

you need to re-read the header_operations.py description. The dynamic operation, as a example, is not doing what you want it to do (wrong value)

why are you doing a loop for 1 ?
Code:
 (try_for_range,":entry",99,100), #para defensores

also check more operations, like "add_visitors_to_current_scene"

and do work on your code indentation before posting it, that hurts the eyes.


Thanks for advice . I will remember about that in my next scripts .

Today I work try working on Kill/Death count . Saving on database after exiting server and seting after player  join.

I do everything but Kills/Deaths doesn't show in table properly . I always see 0 .

Note : Even If I dont see them If I kill someone and I left server value increase ...


Like this:

I have in database 11 kills , I join to server , Press tab and here is 0 kills but If I kill someone and leave the server I can see on database 12 kills.

kalarhan I know you are working sp only but you have wide knowledge so maybe u can help me :grin:


Code:
("game_receive_url_response",
    [
     (store_script_param, ":num_integers", 1),
    (store_script_param, ":num_strings", 2),
    
    (try_begin),
      (eq, ":num_integers", 0),
      (eq, ":num_strings", 1),
        (display_message, s0),#error will display in console window
    (else_try),
      (gt, ":num_integers", 0),#just in case
        (assign, ":event", reg0),
        (try_begin),
          (eq, ":event", -1),#could not connect to mysql server
            (display_message, "@Error!!"),
        (else_try),
          (assign, ":Unique_Id", reg1),
          (assign, ":local_Id", reg2),
          
          (eq, ":event", 1),#Load K/D...
            (try_begin),
              (assign, ":kills", reg4),
            
              (player_is_active, ":local_Id"),
              (player_get_unique_id, ":uid", ":local_Id"),
              
              (eq, ":Unique_Id", ":uid"),
                (player_set_kill_count, ":local_Id", ":kills"),
				  (display_message, "@ K/D Received"),
            (try_end),          
        (try_end),
    (try_end),   
      ]),



One more question . If game_receive_url_response for example In reg5 , How I can use that in other scripts? Or I can't?




EDIT


Well I find  one part of  issue.



I add many operations to test it.


But nothing work.

Even If I add (kick_player, ":uid"),  (uid my id)  server logs told me

Code:
 At script: game_receive_url_response. SCRIPT WARNING ON OPCODE 465: Invalid Pla
yer ID: xxxx; LINE NO: 26:



But after I add


(team_set_score, 1, ":kills"),    (kills value was 10 , max  score team was 8 so server start reseting )


If I change it to (team_set_score, 1, ":kills"),  (kills  value = 4)
team score still 0 but after I disconect  and connect to server again I can see correct value (4) . There is way to sync it in real time (kills,deaths too) ?


 
Khamukkamu said:
kalarhan said:
Khamukkamu said:
Any suggested way to debug this?

Try setting it on all frames using a trigger for "(0,0,0,[],[])".

I haven't tested the operation in a long time, but the feature/mechanic works on VC, so it should still be working on latest Warband.

Note that it is a default walking animation in VC (no weapon)

Can't get it to work :sad: I even tried it on all agents on the scene, and they still walked normally. Next step for me is to copy+paste VC sneak triggers and see if that works.

Ok so copy + pasting all of VC's sneaking triggers work for the player agent. So I tested it with our troll walking animation:



Some observations:

- VC triggers the agent_set_walk_forward_animation operation at 0 seconds , so the operation was running all the time. Also, they made it work for the player agent.

- As you can see, the walking animation is overridden by default walking animation when the agent has their weapons drawn.

- Also, you can see that the animation we made only fires AFTER walking, which means there is something wrong with the actual animation. Perhaps using part of the cheering animation was not right, and we'll need to create a new / proper walking animation for the troll.

- From the Viking Conquest code, they have a trigger that makes the player sheathe their weapon when they are sneaking. Perhaps this is what is required for the animation to work, but does this mean that I have to disarm the troll every time they walk?
 
Hello, Can someone help me with removing these warnings?
Initializing...
Compiling all global variables...
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
Exporting item data...
Exporting scene data...
Exporting troops data
Exporting particle data...
Exporting scene props...
Exporting tableau materials data...
Exporting presentations...
Exporting party_template data...
Exporting parties
Exporting quest data...
Exporting info_page data...
Exporting scripts...
Exporting mission_template data...
Exporting game menus data...
WARNING: Usage of unassigned global variable: $g_presentation_marshall_selection
_max_renown_3
WARNING: Usage of unassigned global variable: $g_presentation_marshall_selection
_max_renown_3_troop
WARNING: Usage of unassigned global variable: $g_presentation_marshall_selection
_max_renown_3
WARNING: Usage of unassigned global variable: $g_presentation_marshall_selection
_max_renown_3_troop
exporting simple triggers...
exporting triggers...
exporting dialogs...
Checking global variable usages...
WARNING: Global variable never used: $g_presentation_marshall_selection_max_reno
wn_3
WARNING: Global variable never used: $g_presentation_marshall_selection_max_reno
wn_3_troop
WARNING: Global variable never used: $g_presentation_marshall_selection_max_reno
wn_3
WARNING: Global variable never used: $g_presentation_marshall_selection_max_reno
wn_3_troop
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .
 
KaToZ said:
Hello, Can someone help me with removing these warnings?
Initializing...
Compiling all global variables...
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
Exporting item data...
Exporting scene data...
Exporting troops data
Exporting particle data...
Exporting scene props...
Exporting tableau materials data...
Exporting presentations...
Exporting party_template data...
Exporting parties
Exporting quest data...
Exporting info_page data...
Exporting scripts...
Exporting mission_template data...
Exporting game menus data...
WARNING: Usage of unassigned global variable: $g_presentation_marshall_selection
_max_renown_3
WARNING: Usage of unassigned global variable: $g_presentation_marshall_selection
_max_renown_3_troop
WARNING: Usage of unassigned global variable: $g_presentation_marshall_selection
_max_renown_3
WARNING: Usage of unassigned global variable: $g_presentation_marshall_selection
_max_renown_3_troop
exporting simple triggers...
exporting triggers...
exporting dialogs...
Checking global variable usages...
WARNING: Global variable never used: $g_presentation_marshall_selection_max_reno
wn_3
WARNING: Global variable never used: $g_presentation_marshall_selection_max_reno
wn_3_troop
WARNING: Global variable never used: $g_presentation_marshall_selection_max_reno
wn_3
WARNING: Global variable never used: $g_presentation_marshall_selection_max_reno
wn_3_troop
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .

we are not a wizards. We can't help you without code. But we can advise you what you can do.


Errors says all what do you need to fix the error.

You use a global variable which you don't assign .

Do it!

Look at the operations.

Code:
assign,<destination>,<value>)


How it works?

KMJPmNE.png



My ":Gold" is variable but it can be for example 5.

Now you should know how you can assign.



Second warning
WARNING: Global variable never used: $g_presentation_marshall_selection_max_reno
told you that you add variable which you never use (trash code) or you do something wrong in copy-paste....
 
Does the AI take weapon types into account? E.g. do agents distinguish between 2H weapons and polearms and know when to use which, in case they have both in their inventory? Or do they choose based on the weapon's range?

I'm asking because TLD has a lot of 2H axes flagged as itp_type_polearm, and I wonder if that somehow impedes the AI.
 
PitchPL said:
KaToZ said:
Hello, Can someone help me with removing these warnings?
Initializing...
Compiling all global variables...
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
Exporting item data...
Exporting scene data...
Exporting troops data
Exporting particle data...
Exporting scene props...
Exporting tableau materials data...
Exporting presentations...
Exporting party_template data...
Exporting parties
Exporting quest data...
Exporting info_page data...
Exporting scripts...
Exporting mission_template data...
Exporting game menus data...
WARNING: Usage of unassigned global variable: $g_presentation_marshall_selection
_max_renown_3
WARNING: Usage of unassigned global variable: $g_presentation_marshall_selection
_max_renown_3_troop
WARNING: Usage of unassigned global variable: $g_presentation_marshall_selection
_max_renown_3
WARNING: Usage of unassigned global variable: $g_presentation_marshall_selection
_max_renown_3_troop
exporting simple triggers...
exporting triggers...
exporting dialogs...
Checking global variable usages...
WARNING: Global variable never used: $g_presentation_marshall_selection_max_reno
wn_3
WARNING: Global variable never used: $g_presentation_marshall_selection_max_reno
wn_3_troop
WARNING: Global variable never used: $g_presentation_marshall_selection_max_reno
wn_3
WARNING: Global variable never used: $g_presentation_marshall_selection_max_reno
wn_3_troop
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .

we are not a wizards. We can't help you without code. But we can advise you what you can do.


Errors says all what do you need to fix the error.

You use a global variable which you don't assign .

Do it!

Look at the operations.

Code:
assign,<destination>,<value>)


How it works?

KMJPmNE.png



My ":Gold" is variable but it can be for example 5.

Now you should know how you can assign.



Second warning
WARNING: Global variable never used: $g_presentation_marshall_selection_max_reno
told you that you add variable which you never use (trash code) or you do something wrong in copy-paste....
I don't know how to open that thing that you just opened where you assign the variables or whatever it's called.
 
Status
Not open for further replies.
Back
Top Bottom