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

0 Members and 1 Guest are viewing this topic.

Offline Spoons

  • Donator
  • *
  • Posts: 463
    • 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

  • Corporal
  • *
  • Posts: 40
    • 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: 5780
  • 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 Kanade Tachibana

  • Colonel
  • *
  • Posts: 1435
  • Great Sister of Minisiege EU_Commander & Mininaval
    • 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.
„Im Verein mit den Mir verbündeten Herrschern hatte ich unseren Feinden vorgeschlagen, alsbald in Friedensverhandlungen einzutreten. Die Feinde haben Meinen Vorschlag abgelehnt. Ihr Machthunger will Deutschlands Vernichtung. Der Krieg nimmt seinen Fortgang! Vor Gott und der Menschheit fällt den feindlichen Regierungen allein die schwere Verantwortung für alle weiteren furchtbaren Opfer zu, die Mein Wille euch hat ersparen wollen. In der gerechten Empörung über der Feinde anmaßenden Frevel, in dem Willen, unsere heiligsten Güter zu verteidigen und dem Vaterlande eine glückliche Zukunft zu sichern, werdet ihr zu Stahl werden. Unsere Feinde haben die von Mir angebotene Verständigung nicht gewollt. Mit Gottes Hilfe werden unsere Waffen sie dazu zwingen!“ gez. Wilhelm, I. R.

Offline Thunderstormer

  • FSE Developer
  • ****
  • Posts: 5780
  • 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 Kanade Tachibana

  • Colonel
  • *
  • Posts: 1435
  • Great Sister of Minisiege EU_Commander & Mininaval
    • 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),
„Im Verein mit den Mir verbündeten Herrschern hatte ich unseren Feinden vorgeschlagen, alsbald in Friedensverhandlungen einzutreten. Die Feinde haben Meinen Vorschlag abgelehnt. Ihr Machthunger will Deutschlands Vernichtung. Der Krieg nimmt seinen Fortgang! Vor Gott und der Menschheit fällt den feindlichen Regierungen allein die schwere Verantwortung für alle weiteren furchtbaren Opfer zu, die Mein Wille euch hat ersparen wollen. In der gerechten Empörung über der Feinde anmaßenden Frevel, in dem Willen, unsere heiligsten Güter zu verteidigen und dem Vaterlande eine glückliche Zukunft zu sichern, werdet ihr zu Stahl werden. Unsere Feinde haben die von Mir angebotene Verständigung nicht gewollt. Mit Gottes Hilfe werden unsere Waffen sie dazu zwingen!“ gez. Wilhelm, I. R.

Offline pete99

  • Corporal
  • *
  • Posts: 40
    • 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: 1617
    • View Profile
  • Nick: IceAngel/FreestylerVI
  • Side: Neutral
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?



Ich plan ein Attentat, auf deiner Klassenfahrt
Bis ihr alle ausseht wie pürierter Blattspinat

Offline Freedom

  • Colonel
  • *
  • Posts: 1736
    • View Profile
  • Side: Neutral
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: 774
    • 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: 1
    • View Profile
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: 219
  • Amor patriae nostra lex.
    • View Profile
  • Nick: Stonewall_BrigGen_T_Jackson
  • Side: Confederacy
Re: *Scripting Thread*
« Reply #207 on: June 17, 2018, 09:45:01 pm »
//delete