Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
where would i have to look for the spawns in Team Deathmatch Mode? I looked over the whole mission template but can't find anything in there. I want to have the same Spawns as in Battle (0 and 32) so that the players in team 1 spawn at point 0 only and those of team two at 32 only... But i can't figure out where the spawns for Team Death Match are assigned.
 
I'm guessing the spawns are placed in the scene editor and then agents are spawned pseudo-randomly. Team Deathmatch doesn't have "sides" to the battlefield unlike battle mode.
 
Well, the spawns are placed in the editor, of course. But somewhere in the scripts there must be assigned on what of the entry points you placed in the editor the player will spawn. And the teams are defined for Team Deathmatch, of course. So that would be no problem. I just need to find the place where the game checks where a player will spawn. I think the positions are chosen as the entry point closest to other team members.
 
Take a look at script_multiplayer_find_spawn_point. But what you can do instead is to ignore that script altogether and have
Code:
             (try_begin),
               (eq, ":player_team", 0),
               (assign, ":entry_no", multi_initial_spawn_point_team_1),
             (else_try),
               (eq, ":player_team", 1),
               (assign, ":entry_no", multi_initial_spawn_point_team_2),
             (try_end),
             (player_spawn_new_agent, ":player_no", ":entry_no"),
 
What would i have to do to get a combo button overlay to work properly?

Code:
	(position_set_x, pos1, 200),
	(position_set_y, pos1, 510),
        (create_combo_button_overlay, "$g_presentation_obj_11"),
        (overlay_set_position, "$g_presentation_obj_11", pos1),
        (overlay_add_item, "$g_presentation_obj_11", "@First"),
        (overlay_add_item, "$g_presentation_obj_11", "@Second"),
        (overlay_add_item, "$g_presentation_obj_11", "@Third"),		
        (overlay_add_item, "$g_presentation_obj_11", "@Fourth"),		
        (overlay_add_item, "$g_presentation_obj_11", "@Fifth"),

I have taken a look at the character_creation presentation, but it currently blows my mind.

I want to be able to click on one of the buttons, id it as the chosen button and create a text based upon that. I did gave it a copy-pasta try from the char creation, but while i can click the buttons, the displayed text will always say "this is number 1"
Code:
        (try_begin),
          (eq, "$g_presentation_obj_13", reg6),
          (overlay_set_val, "$g_presentation_obj_11", 0),
        (else_try),
          (eq, "$g_presentation_obj_13", reg7),
          (overlay_set_val, "$g_presentation_obj_11", 1),
		(else_try),
          (eq, "$g_presentation_obj_13", reg8),
          (overlay_set_val, "$g_presentation_obj_11", 2),
		(else_try),
          (eq, "$g_presentation_obj_13", reg9),
          (overlay_set_val, "$g_presentation_obj_11", 3),
		(else_try),
          (eq, "$g_presentation_obj_13", reg10),
          (overlay_set_val, "$g_presentation_obj_11", 4),  
        (try_end),
		
		(try_begin),
			(eq, "$g_presentation_obj_11", 0),
			(str_store_string,s1, "@This is number 1"),
		(else_try),	
			(eq, "$g_presentation_obj_11", 1),
			(str_store_string,s1, "@This is number 2"),
		(else_try),	
			(eq, "$g_presentation_obj_11", 2),
			(str_store_string,s1, "@This is number 3"),
		(else_try),	
			(eq, "$g_presentation_obj_11", 3),
			(str_store_string,s1, "@This is number 4"),
		(else_try),	
			(eq, "$g_presentation_obj_11", 4),
			(str_store_string,s1, "@This is number 5"),
		(try_end),
		
		(create_text_overlay, reg1, "@{s1}", tf_double_space|tf_scrollable),
        (position_set_x, pos1, 400),
        (position_set_y, pos1, 80),
        (overlay_set_position, reg1, pos1),
        (position_set_x, pos1, 550),
        (position_set_y, pos1, 450),
        (overlay_set_area_size, reg1, pos1), 	
		
		(presentation_set_duration, 999999),
        ]),
		
		(ti_on_presentation_event_state_change,
      [
        (store_trigger_param_1, ":object"),
        (store_trigger_param_2, ":value"),

        (try_begin),
          (eq, ":object", "$g_presentation_obj_11"),
          (try_begin),
            (eq, ":value", 0),
            (assign, "$g_presentation_obj_13", reg6),
          (else_try),
            (eq, ":value", 1),
            (assign, "$g_presentation_obj_13", reg7),
		(else_try),
            (eq, ":value", 2),
            (assign, "$g_presentation_obj_13", reg8),
		(else_try),
            (eq, ":value", 3),
            (assign, "$g_presentation_obj_13", reg9),
		(else_try),
            (eq, ":value", 4),
            (assign, "$g_presentation_obj_13", reg10),
        (try_end),
        (start_presentation, "prsnt_set_ship_name"),
		
		]),
      ]),

@Button:
Code:
(position_set_y, pos1, 430),
        (create_combo_button_overlay, "$g_presentation_obj_12"),
        (overlay_set_position, "$g_presentation_obj_12", pos1),
        (overlay_add_item, "$g_presentation_obj_12", "@a thief"),
        (overlay_add_item, "$g_presentation_obj_12", "@a steppe nomad"),
        (overlay_add_item, "$g_presentation_obj_12", "@a hunter"),
        (overlay_add_item, "$g_presentation_obj_12", "@a veteran warrior"),
        (overlay_add_item, "$g_presentation_obj_12", "@a travelling merchant"),
        (overlay_add_item, "$g_presentation_obj_12", "@an impoverished noble"),
        (try_begin),
          (eq, "$background_type", cb_thief),
          (overlay_set_val, "$g_presentation_obj_12", 0),
        (else_try),
          (eq, "$background_type", cb_nomad),
          (overlay_set_val, "$g_presentation_obj_12", 1),
        (else_try),
          (eq, "$background_type", cb_forester),
          (overlay_set_val, "$g_presentation_obj_12", 2),
        (else_try),
          (eq, "$background_type", cb_guard),
          (overlay_set_val, "$g_presentation_obj_12", 3),
        (else_try),
          (eq, "$background_type", cb_merchant),
          (overlay_set_val, "$g_presentation_obj_12", 4),
        (else_try),
          (eq, "$background_type", cb_noble),
          (overlay_set_val, "$g_presentation_obj_12", 5),
        (try_end),
ti_on_presentation_event_state_change:

Code:
        (try_begin),
          (eq, ":object", "$g_presentation_obj_11"),
          (try_begin),
            (eq, ":value", 0),
            (assign, "$character_gender", tf_female),
          (else_try),
            (eq, ":value", 1),
            (assign, "$character_gender", tf_male),
          (try_end),
          (start_presentation, "prsnt_character_creation"),
        (else_try),
          (eq, ":object", "$g_presentation_obj_12"),
          (try_begin),
            (eq, ":value", 0),
            (assign, "$background_type", cb_thief),
          (else_try),
            (eq, ":value", 1),
            (assign, "$background_type", cb_nomad),
          (else_try),
            (eq, ":value", 2),
            (assign, "$background_type", cb_forester),
          (else_try),
            (eq, ":value", 3),
            (assign, "$background_type", cb_guard),
          (else_try),
            (eq, ":value", 4),
            (assign, "$background_type", cb_merchant),
          (else_try),
            (eq, ":value", 5),
            (assign, "$background_type", cb_noble),
          (try_end),
          (start_presentation, "prsnt_character_creation"),


Edit: Clicking the button "Fourth" actually doesnt change anything. It will still display the button "Third". All others (1,2,3,5) do at least display the correct button as being chosen  :???:

Solved thanks to cmp.

Code:
(try_begin),
			(eq, "$g_presentation_obj_11", 0),
			(str_store_string,s1, "@This is number 1"),
			...and the rest

moved to trigger and changed to eq, ":value", 0
 
How hard would it be to make a menu when using a scene prop, where you can select an item from a range? So simply if you use the prop, a menu opens and there is a list of items. Then you klick on one item in the list and that item spawns.
 
OK, that was what i did not want to hear :wink: I did never really need them, but i read a bit and took a look at them. I will be looking what i can learn...
 
Ran into a problem here guys, just wondering if anyone can help me solve it. Every time I start a new character in my mod, you arbitrarily gain 30 levels... This has happened before apparently, I found a similar thread here: http://forums.taleworlds.com/index.php/topic,42162.msg1092137.html#msg1092137 but I didn't want to resurrect it, does anyone have any suggestions? If I can't solve this, doesn't anyone know if there's a line that can let you remove XP from a character on creation, in the same way that you can add gold or skills?
 
acrob14 said:
Ran into a problem here guys, just wondering if anyone can help me solve it. Every time I start a new character in my mod, you arbitrarily gain 30 levels... This has happened before apparently, I found a similar thread here: http://forums.taleworlds.com/index.php/topic,42162.msg1092137.html#msg1092137 but I didn't want to resurrect it, does anyone have any suggestions? If I can't solve this, doesn't anyone know if there's a line that can let you remove XP from a character on creation, in the same way that you can add gold or skills?

Use Winmerge to see the differences between your code and the original Native.
Surely it's into
Code:
module_scripts.py
. Look in
Code:
game_start
or any other important one.

Patta said:
OK, that was what i did not want to hear :wink: I did never really need them, but i read a bit and took a look at them. I will be looking what i can learn...
They can be as complex as you want them to be. Imagine them as some sort of interactive Powerpoints without preview.
Once you work a little playing with the examples they come alone.

Look at the Rubik's Tetris and Minesweeper. Those are the most advanced ones you'll ever seen. Truly impressive.
 
I have two bugs.

Code:
           (try_begin),
             (check_quest_active, "qst_save_relative_of_merchant"),
             (eq, "$current_town","p_village_40"),
             (this_or_next|neg|check_quest_succeeded, "qst_collect_men"),
             (this_or_next|neg|check_quest_succeeded, "qst_learn_where_merchant_brother_is"),
             (neg|check_quest_succeeded, "qst_save_relative_of_merchant"),
             (modify_visitors_at_site,":village_scene"),
             (reset_visitors),
             (set_visitor, 45, "trp_monos"),
             (set_visitor, 37, "trp_monos_hitman"),
             (set_visitors, 4, "trp_monos_assassin", 2),
           (try_end),     

It's suppose to make those troops spawn.  Instead it makes it so the villagers don't spawn and the "monos_assassins" don't spawn.

Code:
[trp_monos_hitman, "start",
  [
    (try_begin),
      (check_quest_active, "qst_save_relative_of_merchant"),
      (call_script, "script_activate_tavern_attackers"),
      (assign, "$g_main_attacker_agent", "trp_monos_hitman"),
    (try_end),
  ],
  "You have seen nothing. Move along or you will be gutted.","saving_monos_threat",[]],
[anyone|plyr, "saving_monos_threat",[],"You saw nothing. Drop your swords and move along or you will be gutted","saving_monos_response_agress", []],
[anyone|plyr, "saving_monos_threat",[],"I need to speak to this man and you won't stop me","saving_monos_try_stopping_me",[]],
[anyone|plyr, "saving_monos_threat",[],"Farewell then.","close_window",[]],
[trp_monos_hitman, "saving_monos_response_agress",
 [],
 "Ha! I am sorry to kill someone such as you","close window",
 [
 ]],

[trp_monos_hitman, "saving_monos_try_stopping_me",
 [],
 "Ha! I am sorry to kill someone such as you","close window",
 [
 ]],


The dialogue windows won't close.
 
May be it's because you used the wrong pair of brackets?

I mean this one:
  [trp_monos_hitman, "start",

shouldn't it be like this:

  (trp_monos_hitman, "start",


The same at the end of it, of course.
 
I think I did it correctly.  At least all the precedents have "[]"...

[trp_tutorial_trainer, "start", [(eq, "$tutorial_1_state", 1),], "TODO: Watch me.", "tutorial_1_1_1",[]],
 
(reset_visitors),

is this the problem with the missing villagers?

edit: I still don't know why the dialogue window won't close or why those two don't spawn.
 
I think that the visitor operations can only be used with before_mission_start or prior to the mission call. Otherwise you need to use spawn_agent.
 
ithilienranger said:
I think that the visitor operations can only be used with before_mission_start or prior to the mission call. Otherwise you need to use spawn_agent.

I use
    (store_current_scene, ":cur_scene"),
    (modify_visitors_at_site, ":cur_scene"),
    (add_visitors_to_current_scene, ":entry_point", ":troop_id", 1),
within a "ti_after_mission_start" trigger.
 
Status
Not open for further replies.
Back
Top Bottom