Author Topic: *Scripting Thread*  (Read 70972 times)

0 Members and 1 Guest are viewing this topic.

Offline Windflower

  • General
  • ****
  • Posts: 14805
  • ex PSG, 30th
    • View Profile
    • my jam
  • Nick: 𝒲𝒾𝓃𝒹𝒻𝓁🌸𝓌𝑒𝓇
  • Side: Union
Re: *Scripting Thread*
« Reply #255 on: May 30, 2019, 04:39:00 pm »
Thought I might ask a question here to avoid getting someone else to do it for me,
would anyone know the basic scripting for changing the damage done from kicks & punches?
NAPL season 1 saw the greatest regiment winning
ribbit 🐸 cute? 😳 im not cute 😓 i mean my parents 👨‍👩‍👧 call me cute ☺️ but honestly 👉👈 ive never ❌ heard it 👂 from someone else 🗣 before 🥰 thanks i guess? 😳

Offline pete99

  • First Sergeant
  • *
  • Posts: 71
  • Gang Warily
    • View Profile
  • Nick: Drummond
  • Side: Confederacy
Re: *Scripting Thread*
« Reply #256 on: May 31, 2019, 03:02:16 am »
Thought I might ask a question here to avoid getting someone else to do it for me,
would anyone know the basic scripting for changing the damage done from kicks & punches?

The way I would normally do it is using this trigger:

Spoiler
ti_on_agent_hit          = -28.0 #can only be used in module_mission_templates triggers
# Trigger Param 1: damage inflicted agent_id
# Trigger Param 2: damage dealer agent_id
# Trigger Param 3: inflicted damage
# Trigger Param 4: hit bone
# Trigger Param 5: missile item kind no
# Register 0: damage dealer item_id
# Position Register 0: position of the blow
#                      rotation gives the direction of the blow
# Trigger result: if returned result is greater than or equal to zero, inflicted damage is set to the value specified by the module.
[close]

I simply check that the player has no item equipped (for punches, not sure about kicking since it can be done while holding a weapon). Then change the damage using:

(set_trigger_result, [new damage]),

Since you can get the original damage with # Trigger Param 3: inflicted damage, you can either adjust this, or just create a standard amount of damage you want done, e.g. (set_trigger_result, 10),


Offline Coldstreamer

  • First Lieutenant
  • *
  • Posts: 1602
  • Proud Gay Conservative, and leader of the RegduRoi
    • View Profile
    • My Youtube Channel
  • Nick: "J-Man11"
  • Side: Union
Re: *Scripting Thread*
« Reply #257 on: December 04, 2019, 03:51:48 pm »
Anyone have an idea on how to re-named and replace the marches for nations?  I'm trying to re-name some of them and add my own marches to them..

Offline Woeski

  • Second Lieutenant
  • *
  • Posts: 231
  • (2Ch) - DDB - Mamluk
    • View Profile
    • 2Ch & BACM regiment
  • Nick: Woeski
  • Side: Neutral
Re: *Scripting Thread*
« Reply #258 on: December 16, 2019, 03:54:55 pm »
Anyone have an idea on how to re-named and replace the marches for nations?  I'm trying to re-name some of them and add my own marches to them..

Can you be a bit more specific, like you mean the marches that musicians can play or the ones that play when a team wins the round?

Offline No0B

  • First Lieutenant
  • *
  • Posts: 740
    • View Profile
  • Nick: Doctor Noob/2LBI_CSgt_Noob
  • Side: Neutral
Re: *Scripting Thread*
« Reply #259 on: March 10, 2020, 03:54:50 am »
Anyway to disable team 2, on a server in NW, Even pointing me to the right files is a huge help thanks.

Offline Lilja Mariasdóttir

  • Colonel
  • *
  • Posts: 1939
  • Ist ein Schaf in einer Tasse
    • View Profile
  • Side: Confederacy
Re: *Scripting Thread*
« Reply #260 on: March 11, 2020, 02:35:33 pm »
Anyway to disable team 2, on a server in NW, Even pointing me to the right files is a huge help thanks.
Maybe not the most beautiful solution, but the most easy to do yourself without any prior experience:

Follow this instructions to get and set up the module system of MB (if you dont have already):
https://www.fsegames.eu/forum/index.php?topic=11836.0
Edit: but download the module system from here, the one in the thread is old: https://www.taleworlds.com/en/Games/NapoleonicWars (click "+Downloads" and get "Module Source:"

then open module_scripts.py
and replace this line:
Code
(call_script, "script_cf_multiplayer_team_is_available", ":player_no", ":value"),
with:
Code
(neq, ":value", 1),
(1 is the value for team 2)
« Last Edit: March 11, 2020, 02:40:54 pm by Lilja Mariasdóttir »
In support of https://gamersagainstbigotry.org/

Seehofer schafft das Heer ab.

Offline Wellesley

  • Corporal
  • *
  • Posts: 48
    • View Profile
  • Nick: DI_VAmb_Welly
  • Side: Neutral
Re: *Scripting Thread*
« Reply #261 on: March 12, 2021, 12:12:56 pm »
Hello, im tryng to make compatible Baillie's Immersion Mod with the new patch, i changed the vanilla game_missile_launch line with Baillie's one, and i have the old effects in game, but i dont know why i hear voices (i think they are from tutorial) in battle, any idea of tho solve this?

Offline Coldstreamer

  • First Lieutenant
  • *
  • Posts: 1602
  • Proud Gay Conservative, and leader of the RegduRoi
    • View Profile
    • My Youtube Channel
  • Nick: "J-Man11"
  • Side: Union
Re: *Scripting Thread*
« Reply #262 on: July 30, 2021, 11:11:23 pm »
If anyone knows where to find some scripts for bot survival (like the ones on BBG Bot Survival) or changing uniforms (Tropical Paradise), please let me know!!  Also, I know how to add weapons for units, but not sure how to make it server-side only..
« Last Edit: July 31, 2021, 12:48:32 am by Coldstreamer »