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

0 Members and 1 Guest are viewing this topic.

Offline Thunderstormer

  • FSE Developer
  • ****
  • Posts: 6309
  • Worse than Hotler
    • View Profile
  • Side: Neutral
Re: *Scripting Thread*
« Reply #135 on: June 24, 2016, 01:56:48 am »
Yea, i was referring to the NA cav Gf server run by Griffith of the 1erPLG.

i haven't looked into how often someone can make a poll but i thought there was a timer somewhere.(thought i seen it mentioned anyways)  don't really have time right now to look.  if it is not in the script file, it may be in the mission template.

and yea, i have been using their ID to make them into different kinds of admins by giving or removing certain powers.  not sure about client side mods currently. not that they wouldnt be useful but getting people to dl them and use them with the admins staff would be a pain.  considering all the work that would go into it and little gain the server would see from it, idk if it would be worth it.  something for me to think about tho.

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 #136 on: June 24, 2016, 02:21:02 am »
Ah, yes, it is running an older version of my cavgf script.

The polls are timelocked both, client and serverside, thats why you cant change it only serverside (clientside it is located in presentations.py).
For my server it is enough, as the player just need to decide once, if he wants the messages or not, but if you want to make something, that need a more often communication, the polls are no good option. (btw, admins can do as many polls as they want, if I remember right).
Seehofer schafft das Heer ab.

Offline Karl_of_the_line

  • Volunteer
  • *
  • Posts: 1
    • View Profile
  • Side: Neutral
Re: *Scripting Thread*
« Reply #137 on: August 19, 2016, 04:41:27 pm »
Could anyone help me out and make a script that increases explosion and blast radius from the howitzer by 50 times? Would be greatly appreciated :)

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 #138 on: August 28, 2016, 01:24:07 am »
Hello I'm new to the scripting scene and as such noob I request the help of you glorious masterminds.

What I want is simple, fix the following script for me or give me atleast a guide what I did wrong there. Any help would be greatly appreciated because I need this script working to prevent sapper spam on my Mod and have doors destructible (these aren't yet in the code but will be added later)

module_mission_templates.py (part)
Quote
multiplayer_server_botbarricadeattack = (
   3, 0, 0, [],
   [
   (call_script, "script_botattackbarricade"),
   ])

module_scripts.py   (part)
Quote
("botattackbarricade",
 [
 (try_begin),
    (try_for_agents,":agent_id"),
   (store_script_param, ":instance_id", 1),
   (agent_is_alive, ":agent_id"),
   (agent_is_active, ":agent_id"),
   (agent_is_human, ":agent_id"),
   (agent_is_non_player, ":agent_id"),
 
       (prop_instance_get_scene_prop_kind, ":prop_kind", ":instance_id"),
         (this_or_next|eq,":prop_kind","spr_mm_stakes_destructible"),
         (this_or_next|eq,":prop_kind","spr_mm_stakes2_destructible"),
         (this_or_next|eq,":prop_kind","spr_sandbags_destructible"),
         (this_or_next|eq,":prop_kind","spr_chevaux_de_frise_tri_destructible"),
         (this_or_next|eq,":prop_kind","spr_gabiondeploy_destructible"),
         (eq,":prop_kind","spr_mm_fence1"),
      
       (agent_get_position, pos79, ":agent_id"),
       (prop_instance_get_position, pos80, ":prop_kind"),
         (get_distance_between_positions_in_meters, ":player_distance", pos79, pos80),
       (lt, ":player_distance", 2),
       (prop_instance_receive_damage, ":prop_kind", ":agent_id", 10),
       (try_end),
 (try_end),
 ]),

The Error:


Yours faithfully,
DarthKiller454 Lieutenant of the IR59
Join the Nr59 join the Infantry.
kk_IR_Nr59_Obst_DarthKiller

Offline Thunderstormer

  • FSE Developer
  • ****
  • Posts: 6309
  • Worse than Hotler
    • View Profile
  • Side: Neutral
Re: *Scripting Thread*
« Reply #139 on: August 28, 2016, 01:39:15 am »
dont have time to look through the code, but if you get an op code error, look at the # and the corresponding number in your header operations file. 
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 Grozni

  • Second Lieutenant
  • *
  • Posts: 308
    • View Profile
  • Nick: RRA_10thRH_SoH_Grozni
  • Side: Neutral
Re: *Scripting Thread*
« Reply #140 on: August 28, 2016, 03:07:38 am »
For start, if you use store_script_param in your script then you're supposed to pass parameter to it while calling it
 (call_script, "script_botattackbarricade", ":some_instance"), #since you passed some_instance as parameter, this would make (store_script_param, ":instance_id", 1), actually store that something into instance_id variable, whatever some_instance is, I don't see how you intend to get it from trigger

Another thing, put try_for_agents below store_script_param, as you want to call store_script_param only once, otherwise store_script_param will be performed per each agent on the map, that will cause the script to perform unneeded extra work.

Though, if I am guessing right at what you're trying to do here, you shouldn't be passing parameter and using store_script_param at all, what you want to do is loop through all the objects on the scene (there are many examples of how to do that in existing code) and then check if it is the sapper construction type, as you already do.

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 #141 on: August 28, 2016, 03:15:50 pm »
Okay I fixed it thanks to your help reducing it to mission_templates_only

here is the script as a Sign of my gratitude

Quote
multiplayer_server_botbarricadeattack = (
   3, 0, 0, [(this_or_next|multiplayer_is_server),(neg|game_in_multiplayer_mode),],
   [
   (try_for_agents,":agent_id"),
      (try_begin),
         (agent_is_active, ":agent_id"),
         (agent_is_alive, ":agent_id"),
         (agent_is_human, ":agent_id"),
         (agent_is_non_player, ":agent_id"),
         (agent_get_position, pos79, ":agent_id"),
         (try_for_range,":barricade", mm_destructible_props_begin, mm_destructible_props_end),
            (scene_prop_get_num_instances, ":num_instances_of_scene_prop", ":barricade"),     
            (try_for_range, ":cur_instance", 0, ":num_instances_of_scene_prop"),
            (scene_prop_get_instance, ":cur_instance_id", ":barricade", ":cur_instance"),
            (prop_instance_is_valid,":cur_instance_id"),
            (prop_instance_get_position, pos80, ":cur_instance_id"),
            (get_distance_between_positions, ":player_distance", pos79, pos80),
            (lt, ":player_distance", 200),
            (prop_instance_receive_damage, ":cur_instance_id", ":agent_id", 1),
            (try_end),
         (try_end),
       (try_end),
   (try_end),
   ])

May not be working yet
« Last Edit: August 28, 2016, 03:42:24 pm by DarthKiller »
Join the Nr59 join the Infantry.
kk_IR_Nr59_Obst_DarthKiller

Offline Lilja Mariasdóttir

  • Colonel
  • *
  • Posts: 2013
  • Ist ein Schaf in einer Tasse
    • View Profile
  • Side: Confederacy
Re: *Scripting Thread*
« Reply #142 on: August 28, 2016, 04:07:16 pm »
Spoiler
Okay I fixed it thanks to your help reducing it to mission_templates_only

here is the script as a Sign of my gratitude

Quote
multiplayer_server_botbarricadeattack = (
   3, 0, 0, [(this_or_next|multiplayer_is_server),(neg|game_in_multiplayer_mode),],
   [
   (try_for_agents,":agent_id"),
      (try_begin),
         (agent_is_active, ":agent_id"),
         (agent_is_alive, ":agent_id"),
         (agent_is_human, ":agent_id"),
         (agent_is_non_player, ":agent_id"),
         (agent_get_position, pos79, ":agent_id"),
         (try_for_range,":barricade", mm_destructible_props_begin, mm_destructible_props_end),
            (scene_prop_get_num_instances, ":num_instances_of_scene_prop", ":barricade"),     
            (try_for_range, ":cur_instance", 0, ":num_instances_of_scene_prop"),
            (scene_prop_get_instance, ":cur_instance_id", ":barricade", ":cur_instance"),
            (prop_instance_is_valid,":cur_instance_id"),
            (prop_instance_get_position, pos80, ":cur_instance_id"),
            (get_distance_between_positions, ":player_distance", pos79, pos80),
            (lt, ":player_distance", 200),
            (prop_instance_receive_damage, ":cur_instance_id", ":agent_id", 1),
            (try_end),
         (try_end),
       (try_end),
   (try_end),
   ])

May not be working yet
[close]
working now
Seehofer schafft das Heer ab.

Offline Miau

  • Volunteer
  • *
  • Posts: 8
    • View Profile
  • Side: Neutral
Re: *Scripting Thread*
« Reply #143 on: September 29, 2016, 01:11:25 am »
Miau started a new commander battle server called BLOODBATH. It has had a lot of peoples active on it lately. This is Miau first server, so wondering about some scripts or advice.


    Trying to make it so only 1 of each Cavalry regiment can be played. No matter what I set the %'s to in the admin panel, people can always pick more cav.

    I am also wondering if it is possible to remove the default maps from the poll menu so it is only the random ones.

    Can the sailor class be disabled from being able to be picked / removed?

    Finally, I'm wondering if anyone knows how the EU Commander Battle server allows line regiments to have musicians and flags!

Any help Miau would appreciate.
« Last Edit: September 29, 2016, 01:13:45 am by Miau »

Offline Lilja Mariasdóttir

  • Colonel
  • *
  • Posts: 2013
  • Ist ein Schaf in einer Tasse
    • View Profile
  • Side: Confederacy
Re: *Scripting Thread*
« Reply #144 on: September 29, 2016, 12:29:13 pm »
Trying to make it so only 1 of each Cavalry regiment can be played. No matter what I set the %'s to in the admin panel, people can always pick more cav.
The adminpanel's options are default not working for Commanderbattlemode, but it is possible to add limits to CB aswell (as you can see on the EU_Commander)
Quote
I am also wondering if it is possible to remove the default maps from the poll menu so it is only the random ones.
This is absolutly possible, however the client will be able to see all the maps in his poll menu, but when he chooses a wrong one, the server can just ignore that poll.
Quote
Can the sailor class be disabled from being able to be picked / removed?
The same like point 1.
Quote
Finally, I'm wondering if anyone knows how the EU Commander Battle server allows line regiments to have musicians and flags!
If I remember correctly, Grozni offered such scripts here in the thread, and he doesnt even want credits. https://steamcommunity.com/id/grozni
Seehofer schafft das Heer ab.

Offline Miau

  • Volunteer
  • *
  • Posts: 8
    • View Profile
  • Side: Neutral
Re: *Scripting Thread*
« Reply #145 on: September 29, 2016, 01:38:13 pm »
Thank you Kanade! I will add him and ask.

Offline Preobraz_LG_Official

  • First Sergeant
  • *
  • Posts: 98
    • View Profile
Re: *Scripting Thread*
« Reply #146 on: October 20, 2016, 06:18:07 pm »
Hi,wanted to know,whether there is some script-module,which replace Napoleon/Wellington etc with General skins. For server I mean,not for personal use.

Offline Johny_Nawalony

  • First Lieutenant
  • *
  • Posts: 762
    • View Profile
  • Side: Confederacy
Re: *Scripting Thread*
« Reply #147 on: October 20, 2016, 09:08:36 pm »
Hi,wanted to know,whether there is some script-module,which replace Napoleon/Wellington etc with General skins. For server I mean,not for personal use.
No, there isn't
I can do paid skin comissions so yeah msg if ya want one

Offline Spoons

  • Donator
  • *
  • Posts: 627
    • View Profile
  • Nick: 33rd_Col_Spoons
  • Side: Neutral
Re: *Scripting Thread*
« Reply #148 on: October 29, 2016, 07:19:11 am »
Hi,wanted to know,whether there is some script-module,which replace Napoleon/Wellington etc with General skins. For server I mean,not for personal use.
No, there isn't

It would be fairly easy to make new general uniforms for a server out of existing NW uniform pieces, in the way that some servers create an 'admin uniform'. I'll happily help with this for free if it would suit your needs - just send me a message.

Offline Mercuri

  • Second Lieutenant
  • *
  • Posts: 346
  • Spanish King's Walloon Guard
    • View Profile
    • Comunidad Gamer Hispana
  • Nick: 2aBH_Mercuri / 5thFL_JacksonTeller
  • Side: Confederacy
Re: *Scripting Thread*
« Reply #149 on: November 01, 2016, 10:32:50 am »
Hello, Im looking for a working script that prevent players to spawn only in their base flags on conquest mode.