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

0 Members and 1 Guest are viewing this topic.

Offline Spoons

  • Donator
  • *
  • Posts: 627
    • View Profile
  • Nick: 33rd_Col_Spoons
  • Side: Neutral
Re: *Scripting Thread*
« Reply #195 on: February 17, 2018, 10:00:35 pm »
What you want requires string parsing, and module system doesn't have such capabilities so you would have to send the string to a PHP page or similar web server side script and return the reponse with info on which variable is changing and what the new value is.

If you don't want to write web scripts you can use new custom keys ability. V, B and four directional keys can be sent from client to activate server script, where you can implement some sort of menu system and have, for example, set Left variable to 5 by tapping left key five times, or have a system which increases previously selected variable by pressing right and decreases by pressing left key.

You can search through new module system files for "custom_keys:" to gather pieces of how it all works, or wait until I write a tutorial about using those and other new stuff useful for server modders.

I need a little help with using game chat as a trigger to set a numeric variable, basically I would like to be able to type: /left 5  and /right 6   and have it set a global that I can then use later:

(try_begin),
(eq, "$g_left", 5),


(try_begin),
(eq, "$g_right", 6),

But only so admins can use it, so maybe just checking admin chat would be the easiest (would probably help if all players could see the change).

Thanks for the info :)

Offline Mr.xexe

  • Private
  • *
  • Posts: 4
    • View Profile
Re: *Scripting Thread*
« Reply #196 on: February 19, 2018, 08:57:21 am »
I need a little help with using game chat as a trigger to set a numeric variable, basically I would like to be able to type: /left 5  and /right 6   and have it set a global that I can then use later:

(try_begin),
(eq, "$g_left", 5),


(try_begin),
(eq, "$g_right", 6),

But only so admins can use it, so maybe just checking admin chat would be the easiest (would probably help if all players could see the change).

You can use WSE https://forums.taleworlds.com/index.php/topic,324890.0.html
« Last Edit: February 19, 2018, 09:29:35 am by Mr.xexe »

Offline pete99

  • First Sergeant
  • *
  • Posts: 71
  • Gang Warily
    • View Profile
  • Nick: Drummond
  • Side: Confederacy
Re: *Scripting Thread*
« Reply #197 on: April 07, 2018, 02:31:06 pm »
I noticed with servers such as bot survival they make it so you can only join team 1. Does anyone know how to do this?

Offline Thunderstormer

  • FSE Developer
  • ****
  • Posts: 6309
  • Worse than Hotler
    • View Profile
  • Side: Neutral
Re: *Scripting Thread*
« Reply #198 on: April 08, 2018, 12:32:39 pm »
I noticed with servers such as bot survival they make it so you can only join team 1. Does anyone know how to do this?
just speculating, but they probably have a trigger firing every second assigning those who aren't spec or team 1 to team 1.  or found another way to do basically that. 
Should you need to talk to me regarding NA1 or or something regarding admining or the admins, PM me here on the forums and not on steam.  *

*This does not include Official Server Admins.

Offline Lilja Mariasdóttir

  • Colonel
  • *
  • Posts: 2013
  • Ist ein Schaf in einer Tasse
    • View Profile
  • Side: Confederacy
Re: *Scripting Thread*
« Reply #199 on: April 08, 2018, 01:19:27 pm »
I noticed with servers such as bot survival they make it so you can only join team 1. Does anyone know how to do this?
just speculating, but they probably have a trigger firing every second assigning those who aren't spec or team 1 to team 1.  or found another way to do basically that.
That would be extremely inefficient.
The server just says no, when the client is asking to go to team 2.
Seehofer schafft das Heer ab.

Offline Thunderstormer

  • FSE Developer
  • ****
  • Posts: 6309
  • Worse than Hotler
    • View Profile
  • Side: Neutral
Re: *Scripting Thread*
« Reply #200 on: April 08, 2018, 01:29:14 pm »
I noticed with servers such as bot survival they make it so you can only join team 1. Does anyone know how to do this?
just speculating, but they probably have a trigger firing every second assigning those who aren't spec or team 1 to team 1.  or found another way to do basically that.
That would be extremely inefficient.
The server just says no, when the client is asking to go to team 2.
there you go pete^^  I believe kanade makes the scripts for the server, so you can try and talk to him about that in more detail should he want to.
Should you need to talk to me regarding NA1 or or something regarding admining or the admins, PM me here on the forums and not on steam.  *

*This does not include Official Server Admins.

Offline Lilja Mariasdóttir

  • Colonel
  • *
  • Posts: 2013
  • Ist ein Schaf in einer Tasse
    • View Profile
  • Side: Confederacy
Re: *Scripting Thread*
« Reply #201 on: April 08, 2018, 01:49:15 pm »
One of many possibilities:

In Script: # script_multiplayer_server_process_client_team_selection
change this
Code
#condition checks are done
      (try_begin),
        #check if available
to this
Code
#condition checks are done
      (try_begin),
        #check if available
        (neq, ":value", 1),
Seehofer schafft das Heer ab.

Offline pete99

  • First Sergeant
  • *
  • Posts: 71
  • Gang Warily
    • View Profile
  • Nick: Drummond
  • Side: Confederacy
Re: *Scripting Thread*
« Reply #202 on: April 08, 2018, 10:21:07 pm »
Thanks for your help ;)

Offline Freestyler

  • Donator
  • *
  • Posts: 2486
    • View Profile
  • Nick: Freestyler
  • Side: Union
Re: *Scripting Thread*
« Reply #203 on: April 13, 2018, 03:50:28 pm »
1. does anyone have a molotow cocktail script?

2. Is it possible to integrate Molotov cocktail as a weapon in the admin tool?

Offline Freedom

  • Colonel
  • *
  • Posts: 2270
    • View Profile
  • Side: Confederacy
Re: *Scripting Thread*
« Reply #204 on: April 13, 2018, 05:25:34 pm »
you either have to make one by yourself or pay someone that knows how,i doubt anyone will give it for free

Offline tired

  • First Lieutenant
  • *
  • Posts: 1082
    • View Profile
  • Nick: [BBG] tired
  • Side: Neutral
Re: *Scripting Thread*
« Reply #205 on: April 20, 2018, 03:48:16 pm »
1. does anyone have a molotow cocktail script?

2. Is it possible to integrate Molotov cocktail as a weapon in the admin tool?

I already replied to your other post, yes I purchased a molotov script from Caesim, he gave me his source, then I scripted in the Admin Cheats menu instead of giving a holy hand grenade, it spawned an molotov instead.

Offline Black-Banner

  • Volunteer
  • *
  • Posts: 2
  • Cpl of the 95thRoF (AU)
    • View Profile
  • Nick: Black-Banner
  • Side: Confederacy
Re: *Scripting Thread*
« Reply #206 on: May 02, 2018, 12:02:52 am »
Hey guys, starting a new mod for NW, I'm looking for some (at least semi) experienced M&B Python coders :). throw me a PM and have a nice day!

Offline Koxxus

  • First Lieutenant
  • *
  • Posts: 255
  • Pułkownik (Colonel) Pułku 4. Piechoty LP
    • View Profile
  • Nick: 4pp_LP_Płk_Koxxus
  • Side: Confederacy
Re: *Scripting Thread*
« Reply #207 on: June 17, 2018, 09:45:01 pm »
//delete
"Ma frappe y'a personne qui l’arrête
Penalty j'souris au gardien
Igo y'a Mowgli dans l’arène
Ciseaux retourné comme Papin"

Offline King_George

  • Second Lieutenant
  • *
  • Posts: 519
    • View Profile
  • Nick: king_george
  • Side: Union
Re: *Scripting Thread*
« Reply #208 on: October 14, 2018, 03:30:04 pm »
Is there a way to run a normal NW server, but use a script that changes everyone's ammo at the start?
you can limit the amount of ammo start with, yes.   you don't need a script to do it.  i believe someone even did it by just modifying the text files.

Could you point me to the .txt file that it is? To make people start with e.g. 5 cartridges if possible :S

I am quite a newbie in scripting and basically, don't know much about it but I'm a fast learner so any help is appreciated! :)

I'm looking for the following scripting if anyone's willing to help me/make them for me:

A script which makes it so you either shoot 5 rounds with a musket without having to reload it and then have to reload and it takes a while, OR you can reload fast. As I said I'm new to the modding scene I did ask for advice; Kanade Tachibana suggested to just boost up the reload speed from the officer, but again, still don't know how to do that either...
« Last Edit: October 14, 2018, 09:00:43 pm by King_George »

Offline pete99

  • First Sergeant
  • *
  • Posts: 71
  • Gang Warily
    • View Profile
  • Nick: Drummond
  • Side: Confederacy
Re: *Scripting Thread*
« Reply #209 on: October 21, 2018, 07:59:37 am »

A script which makes it so you either shoot 5 rounds with a musket without having to reload it and then have to reload and it takes a while.

If you wanted it to be a client and server side mod this could be pretty easy, though i'm assuming you would probably just want it server side?

OR you can reload fast. As I said I'm new to the modding scene I did ask for advice; Kanade Tachibana suggested to just boost up the reload speed from the officer, but again, still don't know how to do that either...

You can pretty easily speed up the reload speed with the module system (even to the point of making it almost semi-automatic). So if you are willing to get into that, i'd recommend getting the module system. Other than that, maybe someone else can come up with a better answer than me...