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

0 Members and 1 Guest are viewing this topic.

Offline Grozni

  • Second Lieutenant
  • *
  • Posts: 308
    • View Profile
  • Nick: RRA_10thRH_SoH_Grozni
  • Side: Neutral
Re: *Scripting Thread*
« Reply #165 on: November 11, 2016, 12:46:02 pm »
Just do exactly as I already said, read carefully:

Order of the item on the list (in module_items.py) can sometimes matter, you can get unexpected bugs during game run, NW performs some checks where order of items count, I don't know them all by heart but it is best you just keep items of similar class grouped together (so for example put new pistol with old pistols), ideally add new items somewhere in the middle rather than below existing items of same class.

Offline zude

  • First Sergeant
  • *
  • Posts: 47
  • Applied Behavior Analyst
    • View Profile
    • Napoleonic Drill Instructors
  • Side: Neutral
Re: *Scripting Thread*
« Reply #166 on: November 11, 2016, 02:32:11 pm »
Is there a way to run a normal NW server, but use a script that changes everyone's ammo at the start?

Different regiments, outfits, and groups participate in the academy. You can ask the academy to attend your event a week in advance. We become the responsibility of the contractor for that event.

Offline Thunderstormer

  • FSE Developer
  • ****
  • Posts: 6309
  • Worse than Hotler
    • View Profile
  • Side: Neutral
Re: *Scripting Thread*
« Reply #167 on: November 11, 2016, 02:42:37 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.
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 nukey111

  • Private
  • *
  • Posts: 26
    • View Profile
  • Nick: Roland
  • Side: Confederacy
Re: *Scripting Thread*
« Reply #168 on: November 11, 2016, 05:16:51 pm »
Hey, I've redone order and played with it enough, so I've got units working, thank you :D Would you know off hand if scripts can create particles? I'd like to make a smoke grenade and smoke shell for cannons.
Do not argue with idiots. They will drag you down to their level, and then beat you with experience.

Offline Grozni

  • Second Lieutenant
  • *
  • Posts: 308
    • View Profile
  • Nick: RRA_10thRH_SoH_Grozni
  • Side: Neutral
Re: *Scripting Thread*
« Reply #169 on: November 11, 2016, 06:19:44 pm »
Start by searching through module_items for "particle", you will run into a ranged broken bottle item that has a script attached for ti_on_missile_hit trigger which means that script will run on thrown bottle making an impact, and it has an example of a function which spawns particles. You'll see that the script (surrounded by []) is made to be one long line of text which saves space but is not easy to read, to fix that you can press enter to add new line after each ")," to make the script more readable, it will still work.

Just notice that first two lines are
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode)
Which means the code below will apply only to server which is what you want as the server will broadcast particle event to all clients.

But to make some more realistic effect, like smoke grenade bouncing or smoke starting with latency, coding just inside module_items entry won't cut it, you'd need to get good at writing more complex stuff in module_scripts and module_mission_templates.


Offline nukey111

  • Private
  • *
  • Posts: 26
    • View Profile
  • Nick: Roland
  • Side: Confederacy
Re: *Scripting Thread*
« Reply #170 on: November 11, 2016, 09:43:33 pm »
Yeah, I've looked through that, seems to be the case.

How would I actually guarantee items to a unit? I've been messing with it for hours now, and I've got everything in place/order as you said, but I've still got troops spawning with gloves in inventory and whatnot. Anyway I can force it to a slot?
Do not argue with idiots. They will drag you down to their level, and then beat you with experience.

Offline Rojoyerf

  • Sergeant Major
  • *
  • Posts: 250
  • A Nigarian Prince with a large inheritance
    • View Profile
  • Nick: [43rdQL]Col_Rojoyerf
  • Side: Neutral
Re: *Scripting Thread*
« Reply #171 on: December 14, 2016, 01:31:03 pm »
Hello, I need help with a small server side mod that changes the item the 'ze treasure' chest gives you depending on its variable number. Also would it be possible to change the "open ze treasure" to something else? Any help would be much appreciated.
« Last Edit: January 12, 2017, 05:23:56 pm by Rojoyerf »
Credits to Bonzo for the footer

Offline Rojoyerf

  • Sergeant Major
  • *
  • Posts: 250
  • A Nigarian Prince with a large inheritance
    • View Profile
  • Nick: [43rdQL]Col_Rojoyerf
  • Side: Neutral
Re: *Scripting Thread*
« Reply #172 on: December 28, 2016, 07:54:50 pm »
Hello everyone, I was wondering if I could have some help with editing spawn points, I want to make it so either:
A: certain people spawn at certain entry points
or B: certain types of troop spawn at certain entry points

I have the NW module system and I have a feeling it's one of the mtef strings in module_mission_templates but I'm not sure

any help would be much appreciated :)
Credits to Bonzo for the footer

Offline Gurkha

  • Lieutenant General
  • ***
  • Posts: 2650
  • Former 33rd LtCol
    • View Profile
    • Official 33rd Regiment of Foot Website
  • Nick: Gurkha
  • Side: Union
Re: *Scripting Thread*
« Reply #173 on: February 03, 2017, 09:05:55 am »
Scripters of NW, how scriptable are conquest flags.

Offline Grozni

  • Second Lieutenant
  • *
  • Posts: 308
    • View Profile
  • Nick: RRA_10thRH_SoH_Grozni
  • Side: Neutral
Re: *Scripting Thread*
« Reply #174 on: February 03, 2017, 10:43:17 am »
Scripters of NW, how scriptable are conquest flags.

Very scriptable, down to smallest details.

Offline DarthKiller

  • Sergeant Major
  • *
  • Posts: 83
    • View Profile
    • Eliteteam alias. The Imperial Army
  • Nick: kk_IR_Nr59_Obst_DarthKiller
  • Side: Union
Re: *Scripting Thread*
« Reply #175 on: February 04, 2017, 04:23:00 pm »
*Notice on everyone with Item Issues in NW

Search for:
(try_for_range,":item",all_items_begin,all_items_end),

and let it look at the end somehow like this:

Spoiler
(else_try),
          (lt,":item","itm_arty_horse_howitzer_french"),  #Artillery Horse for Cannon
          (item_set_slot,":item",slot_item_multiplayer_item_class, multi_item_class_type_horse_cannon),
        (else_try),
          (lt,":item","itm_gun1"),
          (item_set_slot,":item",slot_item_multiplayer_item_class, multi_item_class_type_horse_howitzer),
      (else_try),
         (lt,":item","itm_pistol1"),
         (item_set_slot,":item",slot_item_multiplayer_item_class2, multi_item_class_type_gun),
         (item_set_slot,":item",slot_item_multiplayer_item_class, multi_item_class_type_gun),
      (else_try),
         (lt,":item","itm_hat1"),
         (item_set_slot,":item",slot_item_multiplayer_item_class2, multi_item_class_type_pistol),
      (else_try),
         (lt,":item","itm_uniform1"),
         (item_set_slot,":item",slot_item_multiplayer_item_class, multi_item_class_type_hat),
      (else_try),
         (lt,":item","itm_boot1"),
         (item_set_slot,":item",slot_item_multiplayer_item_class, multi_item_class_type_uniform),
      (else_try),
         (lt,":item","itm_glove1"),
         (item_set_slot,":item",slot_item_multiplayer_item_class, multi_item_class_type_boot),
      (else_try),
         (lt,":item","itm_shotgunbullet"),
         (item_set_slot,":item",slot_item_multiplayer_item_class, multi_item_class_type_glove),
      (else_try),
         (lt,":item","itm_items_end"),
         (item_set_slot,":item",slot_item_multiplayer_item_class, multi_item_class_type_bullet),
         (item_set_slot,":item",slot_item_multiplayer_item_class2, multi_item_class_type_gun),
        (try_end),
[close]
Make sure that all those Items are in the right order that you add. And to correctly name them. You can add billions (not really) of items in between those new ones that will not mess-up your current build of items assigned.

Also watch out that you don't copy paste this 1:1 but insert it correctly.


Why:

Because the NW Module system adds items and assigns them to these classes to make sure you exactly get what the script thinks the troop is supposed to have.
Join the Nr59 join the Infantry.
kk_IR_Nr59_Obst_DarthKiller

Offline Glenn.

  • Colonel
  • *
  • Posts: 254
    • View Profile
  • Side: Union
Re: *Scripting Thread*
« Reply #176 on: February 05, 2017, 03:12:18 am »
Does anyone know how or know someone who writes scripts for AZW, Such as a player/admin joining and leaving the server with their GUID's in the chat?

Offline Gurkha

  • Lieutenant General
  • ***
  • Posts: 2650
  • Former 33rd LtCol
    • View Profile
    • Official 33rd Regiment of Foot Website
  • Nick: Gurkha
  • Side: Union
Re: *Scripting Thread*
« Reply #177 on: February 11, 2017, 09:29:34 pm »
Scripters of NW, how scriptable are conquest flags.

Very scriptable, down to smallest details.

Can you point me to the right direction on where to start? :D

Offline Futui_tuto

  • Sergeant
  • *
  • Posts: 58
  • S&M Senior developer & Level design lead
    • View Profile
  • Nick: 96y_Maj_Futui
  • Side: Neutral
Re: *Scripting Thread*
« Reply #178 on: February 14, 2017, 10:46:07 am »
Somebody know, how to do script, when on map will be spawn arms in random places?

Offline Yebenoso

  • First Lieutenant
  • *
  • Posts: 178
  • "Ya hablaremos de capitulaciĆ³n despuĆ©s de muertos"
    • View Profile
  • Nick: Yebenoso
  • Side: Confederacy
Re: *Scripting Thread*
« Reply #179 on: February 18, 2017, 10:44:36 pm »
Hi guys! Is it possible to allow a troop to spawn both musket and pistol?
"El amigo ha de ser como la sangre, que acude luego a la herida sin esperar a que le llamen"

Francisco Quevedo