Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Somebody said:
Don't use tf_allways_fall_dead. Personally I thought it was hilarious trying to keep companions alive in Expanded Gameplay with those flags.



I thought tf_allways_fall_dead was used to make sure normal troops (without tf_hero flag) would never end up being wounded... but dead :smile:.

The issue i have is any companions or the player who have tf_hero flag are dieing in some battles but not all. Meaning it will say the player has been killed by such and such and then seems to remove the player as a casualty (or companion). This means having to start a new game.

["player","Player","Player",tf_hero|tf_unmoveable_in_party_window,no_scene,reserved,fac_player_faction,


Ive noticed a tf_unkillable in header_troops but i thought tf_hero was hardcoded so they could not die. An example would be if you used tf_allways_fall_dead inconjunction with tf_hero then that character will always fall unconsious, never dead.


Apparently its been reported from players in Brytenwalda too so it doesnt seem to be an issue confined to just my module but with the module i used before modifying (which was Brytenwalda for anyone not following  :mrgreen:). So does anyone know what could cause a troop tagged with tf_hero to still be able to die in battle?






The_dragon said:
Where did you guys found that trigger? ti_on_switch_to_map is not in header_triggers...

It also doesn't seem to be used anywhere in the native module files.
 
Arch3r said:
ti_on_switch_to_map may not be what you're looking for, I guess this trigger is used for presentations/character screen you access from the map, rather than after battle.

That makes sense, thanks.

Arch3r said:
Have you tried finding the game menu/presentation that loads after a battle, showing the casualties and allowing you to take prisoners? If you find where that's called, you can also call your script there, most likely.

I've found it, but the problem is that when I add my code after the call to open the prisoner exchange screen, it runs immediately when the exchange screen appears. I need it to be AFTER the exchange screen is closed and the map returns. The exchange screen itself is hardcoded so not a lot I can do there it seems.

The_dragon said:
Where did you guys found that trigger? ti_on_switch_to_map is not in header_triggers...

Are you sure? It's in my header_triggers.
 
@MitchellD


You could set a $global to 1 after the battle screen. Then set a trigger to run when it detects this then change it back to 0 once it has processed.

I'm sure someone will have a much more elegant way to accomplish this though.
 
produno said:
@MitchellD


You could set a $global to 1 after the battle screen. Then set a trigger to run when it detects this then change it back to 0 once it has processed.

I'm sure someone will have a much more elegant way to accomplish this though.

Just what I needed! Thank you, I wasn't actually sure if that would work for what I need but gave it a test now and it's perfect.
 
Oh wow, I totally missed that. Thanks.

So 1001.2 is 215.1886

Say my code was:
Code:
(set_fixed_point_multiplier, 1000),
(store_pow, ":result", 100, 1.2),

:result would be 215 in this case, or 215189, because multiplied by 1000?
 
You actually can't enter 1.2 directly as the module system can't handle floating point numbers; instead you need to enter the appropriate numerator given a denominator equal to the fixed point multiplier. So 1.2 * 1000, i.e. 1200. You also have to multiply the 100 by 1000 because even though it's not floating point, that's what it expects for both arguments. So you do (store_pow, ":result", 100000, 1200).

Personally though I would recommend a longer but more readable and robust (in case you ever change the multiplier) form:

(assign, ":power", 6), # 1.2 = 6/5
(convert_to_fixed_point, ":power"),
(val_div, ":power", 5),

(assign, ":value", 100),
(convert_to_fixed_point, ":value"),

(store_pow, ":result", ":value", ":power"),
 
Ra'Jiska said:
Hey',

On the main campaign map, I'd be able to get the target position (destination) of a patrolling party.
Is it even possible, or is it completely random in function or a radius ? Thanks.

A combination of these operations should get you something:
get_party_ai_behavior                = 2290 # (get_party_ai_behavior,<destination>,<party_id>),
get_party_ai_object                  = 2291 # (get_party_ai_object,<destination>,<party_id>),
party_get_ai_target_position          = 2292 # (party_get_ai_target_position,<position_no>,<party_id>),
get_party_ai_current_behavior        = 2293  # (get_party_ai_current_behavior,<destination>,<party_id>),
get_party_ai_current_object          = 2294 # (get_party_ai_current_object,<destination>,<party_id>),

the behaviors come from this list:
ai_bhvr_hold            = 0
ai_bhvr_travel_to_party = 1
ai_bhvr_patrol_location = 2
ai_bhvr_patrol_party    = 3
ai_bhvr_track_party    = 4 #deprecated, use the alias ai_bhvr_attack_party instead.
ai_bhvr_attack_party    = 4
ai_bhvr_avoid_party    = 5
ai_bhvr_travel_to_point = 6
ai_bhvr_negotiate_party = 7
ai_bhvr_in_town        = 8
ai_bhvr_travel_to_ship  = 9
ai_bhvr_escort_party    = 10
ai_bhvr_driven_by_party = 11

So far as the destination of a patrolling party at any given moment, they either will be in the 'patrol' behavior and have the party or point they are patrolling around as their target (so their movement is 'random' there) or you'll see their behavior as attack_party if they are chasing a party.
 
Wursti said:
Does anyone know anything about a looting system for Multiplayer? Or could help me with that?

What do you mean, there is no standard looting system. If you want one you have to script it.
agent_killed
-> Percentage of looting
-> Get random loot
-> give it to the player / players inventory

Of course it needs backend .php scripts if you want to create something like an "inventory".
 
domipoppe said:
Wursti said:
Does anyone know anything about a looting system for Multiplayer? Or could help me with that?

What do you mean, there is no standard looting system. If you want one you have to script it.
agent_killed
-> Percentage of looting
-> Get random loot
-> give it to the player / players inventory

Of course it needs backend .php scripts if you want to create something like an "inventory".

Yeah expected that :c
 
Debug Alert: Party with commander mismatch -check log for details.
I'm having trouble with my new global id party.
from rgl "Neko commander of party #927 which is not his troop leaded party 0"
Simple triggers calls this every 2hours:
Code:
(eq, "$cheat_mode", 1),
	(assign, ":debug_menu_noted", 0),
	(try_for_parties, ":party_no"),
		(gt, ":party_no", "p_spawn_points_end"),
		(party_stack_get_troop_id, ":commander", ":party_no", 0),
		##diplomacy start+ chief
		(is_between, ":commander", heroes_begin, heroes_end),
		(this_or_next|troop_slot_eq, ":commander", slot_troop_occupation, slto_kingdom_hero),
		##diplomacy end+
		(is_between, ":commander", active_npcs_begin, active_npcs_end),
		(troop_get_slot, ":commander_party", ":commander", slot_troop_leaded_party),
		(neq, ":party_no", ":commander_party"),
		(assign, reg4, ":party_no"),
		(assign, reg5, ":commander_party"),
		
		(str_store_troop_name, s3, ":commander"),
		(display_message, "@{!}{s3} commander of party #{reg4} which is not his troop_leaded party {reg5}"), 
		##diplomacy start+ Make it clear what the error was chief
		(try_begin),
			(gt, reg4, 0),
			(gt, reg5, 0),
			(str_store_party_name, s3, reg4),
			(str_store_party_name, s65, reg5),
			(display_message, "@{!} Commanded party #{reg4} is {s3}, troop_leaded party #{reg5} is {s65}"),
			(str_store_troop_name, s3, ":commander"),
		(try_end),
		##diplomacy end+
		(str_store_string, s65, "str_party_with_commander_mismatch__check_log_for_details_"),

		(try_begin),
			(eq, ":debug_menu_noted", 0),
			(call_script, "script_add_notification_menu", "mnu_debug_alert_from_s65", 0, 0),
			(assign, ":debug_menu_noted", 1),
		(try_end),
	(try_end),
	]),
What can I do to fix this?
This began when i assigned Neko's party to the global modifier like below instead of just pt_neko.
Code:
(assign, "$qst_neko_party", reg0),
  (quest_set_slot, "qst_mod_trouble", slot_quest_target_party, "$qst_neko_party"),
I get this for other parties as well rarely, but this is the first time I've identified a source.
 
Status
Not open for further replies.
Back
Top Bottom