Hello Warhammer!
I am a S2 modder, and I am stuck with some scripting issues.
I was looking back for answers hoping to find parts of the code left over from med2 or etw, but it has come to my attention S2 is where the scripting codes changed.
Considering I cant find anyone who knows anything about scripting in S2 anymore,
I thought, why not look forward. The structure should be the same now right?

Anyway What I basically need is a list of all available scripting commands.
In S2 we have scripting.lua (basically a text file)
Im assuming you have the same thing.

Here is what I need to be able to do:
Its basically to replicate a "bribe" action.
General A is in Faction 2.
Im playing as Faction 1.
I want to get General A to my faction.


Heres the tricky part:
I need general 1 to retain:
First and last name
Portrait ID
Unit Model
Unit stats
Traits etc

( in s2 the general portraits and models are assigned under campaign_character_arts_sets, campaign_character_arts, agent_uniforms)

So heres some examples of VANILLA script commands in the lua:

--[MISSION KEY]--
"jap_chosokabe_intro_mission_two",
--[MISSION ISSUER]--
"CLAN_ELDERS",
--[FACTION KEY]--
"chosokabe",
--[TURN LIMIT]--
0,
--[TARGET]--
"technology:shogun_military_bow_way_of_the_bow",
--[REWARD]--
"grant_unit:Inf_Missile_Bow_Samurai_Chosokabe#capital")

Tokugawa Mission 2: Research Secret Police
local function tokugawa_intro_mission_two()
out.ting("Tokugawa Mission: Research Secret Police")
scripting.game_interface:trigger_custom_mission(--[MISSION KEY]--
"jap_tokugawa_intro_mission_two",
--[MISSION ISSUER]--
"CLAN_ELDERS",
--[FACTION KEY]--
"tokugawa",
--[TURN LIMIT]--0,
--[TARGET]--
"technology:shogun_civil_metsuke_secret_police",
--[REWARD]--
"grant_agent:metsuke#capital")

Chosokabe Mission One: Spawn Medium Tosa Rebellion")
scripting.game_interface:force_rebellion_in_region(--[TARGET REGION]--
"jap_kii",
--[NUMBER OF (RANDOM) REBELLION UNITS]--
0,
--[SPECIFIC ARMY LIST]--
AI_FORCE_large,
--[FORENAME]--
"names_name_names_japaneseFusanari",
--[FAMILY NAME]--
"names_name_names_japaneseKitajo",
--[COORDINATES]--
114.5, -179.0,
--[SUPPRESS MESSAGE]--
false)







local AI_FORCE_large = "Inf_Spear_Yari_Ashigaru,Inf_Spear_Yari_Ashigaru,Inf_Spear_Yari_Samurai,Inf_Missile_Bow_Ashigaru,Cav_Spear_Yari_Cavalry"


the issue here is if i put the general unit in the force list it doesnt seem to work, game crashes? Ive been testing a few things but it keeps breaking

Theres something I can almost do here..
The p
The problem is I cant figure out how to structure it to be like
reward:
agent_general
--[Unit]---
"custom_unit",
--[FORENAME]--
"names_name_names_japaneseFusanari",
--[FAMILY NAME]--
"names_name_names_japaneseKitajo",
--[COORDINATES]--
114.5, -179.0,
--[Arts_set]--
Custom_ID)


Hopefully you guys get what im getting at and have something in Warhammer that can help As you can see I cant really put a unit or art set ID in, nor do I know if its even possible to structure this all this way.
Thanks for your time and help!