Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
cwr said:
How can I call a certain script when a certain party takes a castle? :neutral: What I mean is, what script is called when a center is taken successfully?


Edit: Another question: Is it possible to have a world map that changes with the seasons? :smile:
Winter is coming :grin:
 
In troops.py, my troops are getting multiple melee weapons from their pool, while Native troops seem to get only one melee weapon per soldier, no matter how many there are in their pool. Why is that? Can't my troops do as Native troops? I'd try a search on the forum but you're not going anywhere with words like 'troop' or 'weapon'. :roll:
 
What item types are they? The engine doesn't spawns agents with more than 1 item of the same type (so 1 spear/halberd, 1 axe/sword), and Native doesn't have many troops with 3 different item types.
 
Docm30 said:
You could do it with shaders---the same way the shaders make the top of mountains snowy, you could make the terrain snowy and control it with the 'set_shader_param' operations in the module system.

Yes! Thanks! :grin:



cwr said:
How can I call a certain script when a certain party takes a castle? :neutral: What I mean is, what script is called when a center is taken successfully?
Does anyone have an idea for this? :smile:

I did a search of module scripts but nothing came up. :mad:
 
Somebody said:
What item types are they? The engine doesn't spawns agents with more than 1 item of the same type (so 1 spear/halberd, 1 axe/sword), and Native doesn't have many troops with 3 different item types.
I suspected that indeed. Sorry for the inconvenience.

Another question. In OpenBRF, I used to select multiple meshes so I could see them as if they were 'merged'. Now they show up in different sub-windows, unless they have the same common prefix. Is there a way to change that?
 
Zamensis said:
Another question. In OpenBRF, I used to select multiple meshes so I could see them as if they were 'merged'. Now they show up in different sub-windows, unless they have the same common prefix. Is there a way to change that?
Yeah. Somewhere in the lower right, you'll find the "multi-view" buttons (which only appear when you've selected more than one mesh). Combo mode will always show them together, Aside will always separate them, and Auto should work for multi-meshes only (or something). Fiddle around with these buttons until the problem is resolved.
 
GoldEagleMNE said:
@cwr It's in the game_menus. I am on mobile phone so I cant tell you which game menu exacly. I am sure you'll find it.

Thanks! :grin:

Wow I never would of thought that, because there's no in-game menu when castles are taken. I guess I just learned something new then! :grin:


Edit: I found the "castle_taken" menu, but it seems to only be for when the player takes a castle. "castle_taken_by_friends" seems to be for when you help someone else take a castle. Is there any way to call a script when an NPC party takes a castle? The party won't be part of a faction; if that matters. I feel so stupid right now, but notepad++ returns 584 options for searching "center" and other search words have only returned those two menus. :???:
 
Lumos said:
Zamensis said:
Another question. In OpenBRF, I used to select multiple meshes so I could see them as if they were 'merged'. Now they show up in different sub-windows, unless they have the same common prefix. Is there a way to change that?
Yeah. Somewhere in the lower right, you'll find the "multi-view" buttons (which only appear when you've selected more than one mesh). Combo mode will always show them together, Aside will always separate them, and Auto should work for multi-meshes only (or something). Fiddle around with these buttons until the problem is resolved.
Damn, I was certain I had checked everything. Thank you. :smile:
 
Bump, another one. At the beginning of module_troops.py, we find these kinds of lines:

Code:
ef wpex(o,w,p,a,c,t):
   n = 0
   n |= wp_one_handed(o)
   n |= wp_two_handed(w)
   n |= wp_polearm(p)
   n |= wp_archery(a)
   n |= wp_crossbow(c)
   n |= wp_throwing(t)
   return n
Code:
knight_attrib_1 = str_15|agi_14|int_8|cha_16|level(22)
And so on.

Can I create my own, or do I have to edit those that already exist?
 
wpex already formats all the proficiencies for you (unless you want firearms, which you can add as another parameter). The attrib flag collections you can modify or create one for yourself, but if you want something like 255 strength (the flags are only declared up to 30) you need to modify header_troops to add it in.
 
wpex already formats all the proficiencies for you (unless you want firearms, which you can add as another parameter).
Indeed I do want firearms, and I only need three variables (melee, ranged and firearms). This is why I asked. :grin:

if you want something like 255 strength (the flags are only declared up to 30) you need to modify header_troops to add it in.
No, I don't want that.

So... YESSS, I'm going to spare myself a lot of time. Thank you. :smile:
 
Then you'll want something like this
Code:
def wp_pewpew(m,r,f):
	n = wp_firearm(f)
	n |= wp_one_handed(m)
	n |= wp_two_handed(m)
	n |= wp_polearm(m)
	n |= wp_archery(r)
	n |= wp_crossbow(r)
	n |= wp_throwing(r)
	return n
 
Yop',

Just wanted to submit a problem that I experienced.
Here is what I would like to do:

I wish to get the value from a database on a player before he joins the game.
Here is my code:

Code:
   player_joined = (ti_server_player_joined, 0, 0, [], # server: handle connecting players
   [(store_trigger_param_1, ":player_id"),
   
      (call_script, "script_setup_player_joined", ":player_id"),
      (call_script, "script_player_check_name", ":player_id"),
    ])

So I send my url message in 'script_setup_player_joined', and I also want to get it in 'script_setup_player_joined' at some other lines in the same block.
The problem is it doesn't get the values of the website on time, so, I got told to create a new script where there will be the url message (send) inside, then a timer in order to wait 1 or 2 seconds to be sure the slots values have been got correctly in 'script_setup_player_joined'.

So that would look something like:
Code:
   player_joined = (ti_server_player_joined, 0, 0, [], # server: handle connecting players
   [(store_trigger_param_1, ":player_id"),
    (store_mission_timer_a, ":timer"),
     
      (val_add_timer, ":timer", 5),
      (call_script, "script_my_web_function", ":player_id"),
      (try_begin),
      (eq, ":timer, 10), #Let's say we want to wait 5 seconds.
        (call_script, "script_setup_player_joined", ":player_id"),
        (call_script, "script_player_check_name", ":player_id"),
      (try_end),
    ])

Thanks for the help :oops:.
 
I don't know for the multiplayer scripts Ra'Jiska  :neutral:

Just a question please.

it is a problem if i have a lot of variables ?
type (eq, "$im_tired", 1),

1292 with my new variables and native  :lol:
and i added 18 local variables (module system/variables.txt).

and it is limited ?
it's for dialogues/quests/scripts conditions/mission template conditions.....of course i use :
                    (check_quest_succeeded, "qst_a_quest"),
                    (neg|check_quest_failed, "qst_a_quest"),
...

But i need to use variables in a lot of scripts, and i do make more quests, complicated dialogues...

Thanks for your opinion.
 
Yes, avoid using lots of global variables. Try implementing some sort of a multi-purpose slot matrix instead.
I don't understand what you mean with this:
FantasyWarrior said:
and i added 18 local variables (module system/variables.txt).
You don't add local variables, you just define them upon usage. Variables.txt is not something to be edited manually, and it holds global variables, not locals.
 
Thank you Lumos  :neutral:

I don't have problems with these variables, but it's too much you're right.


An exemple with "local" variable (for me  :lol:)

Mission template
(for simulate a battle, it's a training for two npc...)
_QSh9.jpg

      (ti_on_agent_spawn, 0, 0, [],
      [

              (try_for_agents, ":agent_no"),
        (agent_get_troop_id, ":cur_agent_troop", ":agent_no"),
        (eq, ":cur_agent_troop", "trp_instructor_1"),
        (assign, "$g_instructor", ":agent_no"),
        (agent_ai_set_always_attack_in_melee, "$g_instructor", 1),
        (agent_set_no_death_knock_down_only, "$g_instructor", 1),
        (agent_set_invulnerable_shield, "$g_instructor", 1),

      (try_end),

Not work if it's a global variable, but it work perfectly if i added "g_instructor" in module system/variable.txt not in warband/variables.txt !!


my variables txt at my module system/varaibles.
caravan_escort_state
qst_bring_back_runaway_serfs_num_parties_fleed
qst_bring_back_runaway_serfs_num_parties_returned
qst_follow_spy_run_away
qst_follow_spy_meeting_state
qst_follow_spy_meeting_counter
qst_follow_spy_spy_back_in_town
qst_follow_spy_partner_back_in_town
qst_follow_spy_no_active_parties
debt_to_merchants_guild
npc_with_personality_clash
personality_clash_after_24_hrs
npc_is_quitting
npc_with_political_grievance
npc_to_rejoin_party
g_number_of_targets_destroyed
g_last_archery_point_earned
g_tutorial_training_ground_current_score
tutorial_num_total_dummies_destroyed
g_last_destroyed_gourds
g_talk_troop
g_talk_agent
g_talk_troop_faction
g_talk_troop_relation
g_talk_troop_effective_relation
g_talk_troop_faction_relation
g_talk_troop_party

bla,bla,bla...

g_instructor

Nevermind if i'm too complicated, i know it's a problem with a large number of global variables, thanks  :???:
i search a solution...but it work for the moment.
 
Are you using this variable anywhere else? This block of code could work perfectly well like this:
Code:
(ti_on_agent_spawn, 0, 0, [], [
	(store_trigger_param, ":agent", 1),
	(agent_get_troop_id, ":cur_agent_troop", ":agent"),
	(eq, ":cur_agent_troop", "trp_instructor_1"),
	(agent_ai_set_always_attack_in_melee, ":agent", 1),
	(agent_set_no_death_knock_down_only, ":agent", 1),
	(agent_set_invulnerable_shield, ":agent", 1),
  ]),
Also note how I've not used try_for_agents, given that the trigger is a ti_on_agent_spawn - the spawned agent is passed as a parameter to the trigger.
 
Status
Not open for further replies.
Back
Top Bottom