TaleWorlds Forum Modding Contest [June 2018][Scripting]

Currently viewing this thread:

kalarhan

Python Saint
Count
WBNWVCWF&S
Ruthven said:
Ruthven said:
Is the purpose of these contests to determine the fairest winner, or to stimulate the community?

you already have a answer for that, right? It was part of the discussion (internal) when organizing it. I am not sure why you think this was not a main concern. I also believe that the discussion around WSE (in particular) was exausted in this thread (related to this contest, not the future ones).

Duh said:
One thing we could consider for the next scripting context is permitting WSE but taking it into account for Ease of Installation/Customization/OSP Value.

Can we focus on what is in front of us, instead of what will happen in a few months? This kind of posts are more likely to scare new modders than to make them feel confortable sharing here.

I will even suggest a creation of a thread for discussion/feedback/ideas on the format (in general).

As this is about code, lets use a coding reference: KISS. This is the first coding contest, so I am sure the results and feedback will be used to improve it.
https://en.wikipedia.org/wiki/KISS_principle
 

Namakan

Grandmaster Knight
M&BWBWF&SNWVC
Have their been any submissions so far? Is anyone actually working on something?
This isn't meant in a hostile way, I'm genuinely interested.
 

cwr

Count
M&BWB
Do we need to submit a download link if its just a bit of code? I don't think it would really be useful to add what I made to Native and submit that.

Edit: Just finished, pretty much bug free but its a simple feature to make. What should I put up as a download? A Native source code with skeleton rocks added or what. It seems easier to just post the code.

And here are 2 wip screenshots or script errors I had to fix:
DKsQx2k.jpg
H88MHsO.jpg
 

Lumos

Archduke
WBWF&SNWM&BVC
We'd normally expect you to package your additions only (no Native skeleton), as well as any installation instructions, and upload that somewhere. However, if your code fits into a single post, and you're confident that the instructions you will put into that same post would be clear and understandable, go right ahead and use the submission form without a download link, with just the code instead.


This may also be a good moment to state that if there is to be one singular submission, whether or not the monetary prize is awarded at all will depend on a final decision by the judges as to the overall merit of the sole submission.
 

cwr

Count
M&BWB
Thats understandable.

Forum username: cwr
Submission name: Necromancy Stones
Code/OSP installation instructions:
Add this to module_items:
Code:
["skeleton_stones",         "Skeleton Stones", [("throwing_stone",0)], itp_type_thrown |itp_primary ,itcf_throw_stone, 1000 , weight(4)|difficulty(0)|spd_rtng(97) | shoot_speed(30) | thrust_damage(11 ,  blunt)|max_ammo(18)|weapon_length(8),imodbit_large_bag, [
(ti_on_missile_hit, [
(store_trigger_param_1, ":thrower"), 
(play_sound_at_position, "snd_pistol_shot", pos1), 
(particle_system_burst, "psys_village_fire_smoke_big", pos1, 15), 
(agent_get_team, ":throwerteam", ":thrower"),
(set_spawn_position, pos1),
(spawn_agent, "trp_skeleton_for_necromancy"),
(agent_set_team, reg0, ":throwerteam"),
(agent_set_is_alarmed, reg0, 1),
])
], [] ],

Create a troop that you wish to spawn. I have this:
Code:
   ["skeleton_for_necromancy","Hernar Ancestor","Hernar Ancestors",tf_skeleton|tf_allways_fall_dead,no_scene,reserved,fac_commoners,
   [itm_vaegir_fur_helmet,itm_vaegir_spiked_helmet,itm_vaegir_lamellar_helmet,itm_bone],
   def_attrib|level(15),wp(100),knows_common|knows_ironflesh_4|knows_power_strike_4,skeleton_face1, skeleton_face2],
This troop uses Barf's OSP skeleton, so if you are not using that you could use the undead race from Native, or whatever you want really. Just remember to not add this troop to a party as it is not counted in casualties.

In script_count_mission_casualties_from_agents, in the first try for agents block, add:
                (neq, ":agent_troop_id", "trp_skeleton_for_necromancy"),
Below this:
                (agent_get_troop_id, ":agent_troop_id", ":cur_agent"),
In the second try for agents block add this:
                (agent_get_troop_id, ":troop_of_agent", ":cur_agent"),
                (neq, ":troop_of_agent", "trp_skeleton_for_necromancy"),
Below this:
                (agent_is_human, ":cur_agent"),

This prevents script errors from appearing during casualties and prevents the troops from appearing as casualties in the battle reports. (as they are not part of a party they are not relevant information on the actual damage done to either the player or the enemies)

In script_agent_reassign_team add this:
                (agent_get_troop_id, ":troop_of_agent", ":agent_no"),
                (neq, ":troop_of_agent", "trp_skeleton_for_necromancy"),
Below:
                (agent_is_human, ":agent_no"),

This prevents errors during sieges.

Because this troop is spawned during battle rather than being part of the reinforcement waves, you should replace the first trigger in mt_lead_charge (ti_on_agent_spawn) with this:
Code:
      (ti_on_agent_spawn, 0, 0, [],
       [
         (store_trigger_param_1, ":agent_no"),
         (assign, ":initial_courage_score", 5000),
		 (try_begin),
			(agent_get_troop_id, ":troop_of_agent", ":agent_no"),
			(neq, ":troop_of_agent", "trp_skeleton_for_necromancy"),
			(call_script, "script_agent_reassign_team", ":agent_no"),

                  
			(agent_get_troop_id, ":troop_id", ":agent_no"),
			(store_character_level, ":troop_level", ":troop_id"),
			(val_mul, ":troop_level", 35),
			(val_add, ":initial_courage_score", ":troop_level"), #average : 20 * 35 = 700
         
			(store_random_in_range, ":randomized_addition_courage", 0, 3000), #average : 1500
			(val_add, ":initial_courage_score", ":randomized_addition_courage"), 

			(agent_get_party_id, ":agent_party", ":agent_no"),         
			(party_get_morale, ":cur_morale", ":agent_party"),
         
			(store_sub, ":morale_effect_on_courage", ":cur_morale", 70),
			(val_mul, ":morale_effect_on_courage", 30), #this can effect morale with -2100..900
			(val_add, ":initial_courage_score", ":morale_effect_on_courage"), 
		(else_try),
			(val_add, ":initial_courage_score", 3000), 
         	(try_end),
         (agent_set_slot, ":agent_no", slot_agent_courage_score, ":initial_courage_score"), 
         ]),

For mt_bandits_at_night:
Code:
      (ti_on_agent_spawn, 0, 0, [],
       [
         (store_trigger_param_1, ":agent_no"),
         (agent_get_troop_id, ":troop_no", ":agent_no"),
         (neq, ":troop_no", "trp_player"),
	 (neq, ":troop_no", "trp_skeleton_for_necromancy"),
         (agent_set_team, ":agent_no", 1),
         ]),

For mt_town_fight (if you still use this mission)
Code:
      (ti_on_agent_spawn, 0, 0, [],
      [
        (store_trigger_param_1, ":agent_no"),
        (agent_get_troop_id, ":troop_of_agent", ":agent_no"),
        (neq, ":troop_of_agent", "trp_skeleton_for_necromancy"),
        (agent_set_team, ":agent_no", 0),
      ]),

The end result will be spawning skeletons, or whatever troop you choose, wherever the rock is thrown.

By submitting this work I agree to the rules and regulations of this contest.
 

Pitch

Sergeant at Arms
WBNWVCM&BWF&S
Forum username: PitchPL
Submission name: Battlefield Skills & Effects ᴺᵒᵒᵇ ᴱᵈᶦᵗᶦᵒᶰ
Download link:PDF With Instructions Contain Download Links

By submitting this work I agree to the rules and regulations of this contest.




 

Khamukkamu

Master Knight
M&BWBWF&SVC


Forum username: Khamukkamu
Submission name: Melee Combo & Combo Effects
Download link: Single PY file with All Code Additions (Commented)

Instructions
- Copy the relevant code to its relevant location (module_constants.py additions to module_constants.py; module_mission_templates.py additions to module_missiont_templates.py, and so on...)

- Add the 'combo_effects' mission template trigger list to the mission templates you want it to appear.
-- For instance, in Lead Charge:
Code:
(
    "lead_charge",mtf_battle_mode,charge,
    "You lead your men to battle.",
    [
      (1,mtef_defenders|mtef_team_0,0,aif_start_alarmed,12,[]),
      (0,mtef_defenders|mtef_team_0,0,aif_start_alarmed,0,[]),
      (4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,12,[]),
      (4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,0,[]),
    ], combo_effects+

- Modify the module_constants.py additions to your liking:
-- Set the COMBO TIERS
-- Set the COMBO ACTION TIERS
-- See below:
Code:
# Melee Combo & Effects by Khamukkamu START

# Agent Slots for Counting Hits and Time Since Last Hit

slot_agent_combo_counter = 1002
slot_agent_combo_timer = 1003

# Set the Following Option To 1 if You Want To Reset The Combo to 0 if the Player is Hit. Otherwise, set it to 0.
DAMAGE_TO_PLAYER_RESETS_COMBO = 0

# Change the Value Below in Seconds to Set The Duration / Length of the Combo Time (i.e How Long The Combo Multiplier Lasts Before it Resets to 0)
COMBO_TIMER_ADDITION = 5 #Seconds


# Constants for Combo Tiers (More Can Be Added Depending on Mod)
# Min Values are the start of the tier, Max Values - 1 are the end of a tier.

COMBO_TIER_1_MIN = 2
COMBO_TIER_1_MAX = 4 

COMBO_TIER_2_MIN = COMBO_TIER_1_MAX
COMBO_TIER_2_MAX = COMBO_TIER_2_MIN + 2

# Combo Action Tiers - If You Want To Have A Special Action / Effect To Happen at A Specific Combo Hit, You Can Set it Up Here.
# The Value is the Current Combo Hit That Occurred Which Will Trigger The Effect

COMBO_ACTION_TIER_1 = 3
COMBO_ACTION_TIER_2 = 6
COMBO_ACTION_TIER_3 = 10

# Combo Text Colours
COMBO_TEXT_GOOD = 0x33FF33
COMBO_TEXT_GREAT = 0xFFFF33
COMBO_TEXT_EXCELLENT = 0xFF3333


# Debug Switch - Set to 1 to Show Debug Messages
COMBO_DEBUG = 1

# Melee Combo & Effects by Khamukkamu END

- Modify script_cf_combo_effect to add what combo effects you want. Included in the code is an overpowered Two-Handed Weapon AOE at COMBO ACTION TIER 1.
By submitting this work I agree to the rules and regulations of this contest.

WIP Images
JZBO6.jpg
QRkWX.jpg
sVNGL.jpg
xExzq.jpg

Credits for the mods used for testing / video
- TLD Team for TLD
- Swyter for SWC
- FantasyWarrior (1429 HWY) & Seek N Destroy (1429 HYW La Relance)

* Apologies for the potato vid quality... Modding Laptop was used...
 

Lumos

Archduke
WBWF&SNWM&BVC
The deadline for submissions has been reached as of right now. I would like to thank all of the participants for their involvement, and to wish them good luck and high scores!
 

Marko͘

Section Moderator
WBNWM&BWF&SVC
Just as a disclaimer the soon means soon, and not the soon you would normally expect to find on Taleworlds forums.
 

Lumos

Archduke
WBWF&SNWM&BVC

The Results are Out!

The first edition of the Scripting Contest saw a small number of submissions and some discussion about the nature of the chosen theme, as well as the definitions of the rules. Whilst that gives us food for thought with regard to future editions of the contest, the three submissions still provided unique and interesting takes on the "Combat Features" theme. Without further ado, I would like to announce our judges' decisions...



DqsNp.png
gLFj0.png
nk3Ys.png



1st Place - Melee Combo & Combo Effects by Khamukkamu - 78/90 points
Code:
Quality 23 | Gameplay 14 | Installation 13 | Customisation 13.5 | OSP Value 14.5
Khamukkamu takes the first place with his combo-tracking framework that allows modders to easily set up their own custom effects, with the example effect being an area-of-effect attack for two-handed non-polearm melee weapons. His clean, succinct, and easy to implement code left a lasting impression on our judges!


2nd Place - Necromancy Stones by cwr - 73/90 points
Code:
Quality 25 | Gameplay 13.5 | Installation 11 | Customisation 11 | OSP Value 12.5
Simplicity and intuitiveness being the theme of the submissions, the second place goes to cwr and his "necromancy stones" that allow the player to summon skeletons for aid on the battlefield, or to replace said skeletons with any other type of unit. The panel certainly found the idea and provided implementation very interesting!


3rd Place - Battlefield Skills & Effects ᴺᵒᵒᵇ ᴱᵈᶦᵗᶦᵒᶰ by PitchPL - 63/90 points
Code:
Quality 17 | Gameplay 12.5 | Installation 10.5 | Customisation 10 | OSP Value 13
Amongst the three submissions, PitchPL provided the largest amount of individual additions – six different effect conditions that work with each other in various ways, including sprinting, clutch health regeneration, raging for damage bonuses, and exhaustion to keep all others in check. This submission can clearly provide a solid foundation, as well as a lot of inspiration, to modders seeking to add similar mechanics to their own projects!




Rewards

Thanks to Khamukkamu's generosity, we have a $50 prize pool to distribute, in the 60-30-10 ratio that has become standard for our competitions. Contact me via personal messages to claim your prize.



Afterword

Once again, as is customary, a huge thanks to everyone that helped with the organisation and implementation of this contest. Special thanks to the judges: kalarhan, _Sebastian_, and Somebody, who carefully and critically investigated each submission, and were the driving force behind the definition and formalisation of the Scripting Contest rules. Thanks to Efe Karacar for once again providing the custom badges, and another thanks to Khamukkamu for the generous prize pool that he once again provided for the Modding Contest. Finally, thanks to the three fantastic contributors who participated! Good job, and see you on the next one, perhaps with some conditions revised!
 

Marko͘

Section Moderator
WBNWM&BWF&SVC
Congratulations to the participants! Efe really outdid himself with the badges on this one as well.
 
Top Bottom