Arma Reforger | Scripting Tutorial | Spawning AI

Поделиться
HTML-код
  • Опубликовано: 6 сен 2024

Комментарии • 51

  • @RickOShay
    @RickOShay 4 месяца назад +1

    Your videos are very useful - thanks. You just need to zoom the code so it's readable on a smaller screen. I'm nearly going blind here trying to follow you 😅
    As an Arma 3 modder and scripter with over 34000 hours in A3 - I'm amazed at how you've managed to figure all this out given the very limited Reforger documentation out there. Keep up the good work.

    • @rabid-squirrel
      @rabid-squirrel  Месяц назад

      Apologies... when I get back into Reforger code again (and start making more tutorials) I'll zoom it all the way in 🤣

  • @dauslan3339
    @dauslan3339 2 года назад +4

    nice and neat code, easy to understand.
    can you do tutorial how to spawn random loot in any crate?.

  • @invert6actual585
    @invert6actual585 4 месяца назад

    Nice tutorial, hope to see more tutorials and examples!

  • @user-im1gk1uw7b
    @user-im1gk1uw7b 2 года назад

    Cool manual. Thank you very much. Hope you don't stop and will going on!

  • @blackheart_six
    @blackheart_six 2 года назад +1

    RS, Thank you SO much. I like your methodology. I am a beginner to OOP and you make it easy to understand. I was a successful first time go at this station, and your code ran without error.
    I am very interested in your Hunter Killer script, and randomized spawning. It would work very well in many scenarios. A tutorial on implementing that script would be great.
    I have a feeling this is building towards it. Keep up the great work. I've posted links to here and your github on the BI Arma Reforger forums.

  • @TheIrishAce
    @TheIrishAce Год назад +3

    Good intro into the workbench coding side of things thanks. Pretty useful for myself even as a Software Engineer in my day job.
    One issue I've noticed though is in game with the AI not executing the move order. They spawn in and stand still.

  • @joshuaheathcote2116
    @joshuaheathcote2116 2 года назад

    We're going to drill down. This now apart of my lexicon.

  • @user-im1gk1uw7b
    @user-im1gk1uw7b 2 года назад +1

    In the banner of Arma Reforger tools (top area of steam window) you can see legenar USSR cigarettes: "White Sea Channel". My father smoked them...

  • @tilaniebresler3047
    @tilaniebresler3047 2 года назад +1

    Thank you! This is incredibly helpful!

  • @degeneratesmilsimgroup4398
    @degeneratesmilsimgroup4398 2 года назад

    Love it! Your a great teacher! Would love to understand how to incorporate triggers as an activation method, for ambushes. Scripting is a completely new concept for me and you were absolutely amazing at being able to follow along and to understand,

    • @rabid-squirrel
      @rabid-squirrel  2 года назад

      I'm glad you're understanding! I do have triggers planned for an upcoming tutorial already :)

  • @TCPTGamingKanal
    @TCPTGamingKanal 2 года назад

    Thank you so much. You really clear the fog over reforger scripting. I still have problems with triggers, f.ex. starting a script in a trigger or to generate a new trigger or new task by reaching or completing an existing trigger or task. But thanks anyway, go on that way. Any topic you`ll choose will be hot for us 🤩❤‍🔥

  • @Rbajter
    @Rbajter 2 года назад

    Excellent! Just what I needed.

  • @Cthulhu1546
    @Cthulhu1546 2 года назад +1

    Hi RS, the tutorials are great. I do understand OOP and the concept behind it (at least the basics), but i really have a hard time understanding all the steps you have besides spawning. For example, what is a „ressource“ in enforce script terms or why do i have to transform the spawn params to world etc, (why isn‘t it as simple as sqf createunit? ;-) ) This may blow up the scope of the video for sure, but i‘d really like to know these things, since i feel these are the stoppers that keep me from doing such stuff for myself.
    Another feedback: i feel the resoultion makes it pretty hard to read, since it‘s very small on my screen, maybe you could give up some of the free real estate on the right side of the screen to zoom in? :-)

    • @rabid-squirrel
      @rabid-squirrel  2 года назад +2

      It's on my list to cover some of the individual topics in smaller clips. I'll adjust my cropping template to zoom the code in some more :)

    • @Cthulhu1546
      @Cthulhu1546 2 года назад +1

      @@rabid-squirrel some other suggestions which are very important for scenario editing from my experience in Arma mission editing: I) in which order do mission files initialize, II) understanding clientside/serverside, III) editing scenarios for dedicated/hosted servers IV) Mission Logic Setup for a simple coop Conquest scenario (do you know the old evolution maps from Arma? ;-)) etc. Got a lot of ideas :-)
      another idea for seasoned sqf sceipters like me: how do sqf commands (like createVehicle) work in enforce script :-)

  • @hypoxic125
    @hypoxic125 Год назад +1

    Hey man! Thanks for the tutorial! Where can I get a list of game methods/functions and what each of them do with args/params?

    • @rabid-squirrel
      @rabid-squirrel  Год назад +1

      There isn't one yet unfortunately, you have to look through all of the methods to figure it out unfortunately.

  • @snipermakedonski
    @snipermakedonski Год назад +1

    May i ask how you learned all of this? I am trying to learn to script and mod for reforger (and actually for arma 4) but dont really know where to start.

    • @rabid-squirrel
      @rabid-squirrel  Год назад +3

      My day job is software development, so a load of the skills are transferable. But honestly, it's mostly trial and error, exploring the code, seeing how the devs themselves did things and then fiddling myself to see what works and what doesn't.

  • @MadCheese
    @MadCheese 2 года назад

    Instantly goated

  • @kawikaharper1579
    @kawikaharper1579 5 месяцев назад +1

    Can you make a tutorial placing a campfire from inventory, as a script?

  • @sparkyxbeats6539
    @sparkyxbeats6539 Месяц назад

    There are elements like hitreg manager and tag manager that are no longer available to put into the world, does that affect the basis of the tutorial?

    • @rabid-squirrel
      @rabid-squirrel  Месяц назад

      I can't say for certain as I haven't really coded in the Reforger space for quite some time, but I suspect it won't be a problem. BIS is usually pretty good at supporting backwards compatibility.

  • @dylanc1266
    @dylanc1266 Год назад

    I have a error it reads Undefined function 'GameMode_Plain1_Class.CreateWayPoint' anyone know what is wrong?

  • @aderftard
    @aderftard 2 года назад

    Thanks for taking the time to make tutorials. I'm new to Enforce Script, so I have a question about this code: when you create an instance of EntitySpawnParams inside GenerateSpawnParams, you do so without using the "new" keyword - is this intentional and if so, why? Thanks.

    • @rabid-squirrel
      @rabid-squirrel  2 года назад

      I wouldn't say it is specifically intentional outside of following the convention in all of the core script files. I suspect if you used the "new" keyword that it would not change the functionality in any meaningful way.

    • @aderftard
      @aderftard 2 года назад

      @@rabid-squirrel It seems to work in your example, so that's one difference I've learned between Enforce and C# :). Thanks for the response, I'm having a slow time coming up to speed on Enforce.

    • @rabid-squirrel
      @rabid-squirrel  2 года назад

      @@aderftard I get it, my day job is C# so sometimes I catch myself doing things that would be fine there and not working in Enforce. The lack of string interpolation gets me a lot.

  • @jasondonavich2758
    @jasondonavich2758 2 года назад

    I have question, from a thought I had. Would this script work by spawning weapons or would that require a different script?

    • @rabid-squirrel
      @rabid-squirrel  2 года назад

      You could definitely use SpawnEntityPrefab to spawn weapons, I cover a similar concept in my "Random Supply Boxes" tutorial. You would need to tweak how it works a bit, remove the waypoint specific stuff and so on, but it's definitely doable.

  • @smokeflypaperCZE
    @smokeflypaperCZE 2 года назад +1

    hello and thank you for your tutorial it is very helpfull sir! (Subscribed + bell)... And because you asked for it i have the request for you. >>> I am looking how to force Ai with 100% skills to board an armed vehicle BTR / UAZ / JEEP / HUMVEE, which will be ready at the position. It is necessary for Ai to get into the gunner's seat in the vehicle. In case that Ai is killed, a new Ai will come to replace him.

  • @Shadow_TA
    @Shadow_TA 2 года назад

    Привет

  • @Lucas-no6bl
    @Lucas-no6bl 2 года назад

    💕 ρяσмσѕм

  • @basil3970
    @basil3970 5 месяцев назад

    this game is such dogshit compared to arma 3, what the fuck have they been doing the last 11 years

    • @650VersatileGameplayAndMusic
      @650VersatileGameplayAndMusic 4 месяца назад +1

      the same thing they've been doing since their inception, their primary by millions in comparison to what the game sells - Virtual Battlespace Systems 1-4, had access up to 1-3 but 4 requires active service. They contract the engine out for military simulation more targeted towards virtual headset meets real built housing etc for practice breaches. With each greater success of the engine since Flashpoint (ArmA:CWC) they have always been contracted for use by most if not all NATO and Australian forces - what they were working on Post ArmA3 was the Enfusion engine, it didnt require the game aspects though - but they were contracted for 10-12 years, during which they cant release a public "game" version.
      The reason the contract was so much more value this time, and why it was even tighter held from public eye is that the Envision Engine was used with combined satallite imagery and down at ground level google maps visuals, with VBS4 (ArmA: Reforger) they're rewriting the entire base of the game, thank fuck - 20+ years of janky animations and bullshit that made sense for milsim movement but not for players lol. But yeah VBS4 recreated the entire world for them to practice anywhere in.
      They also released the developer tools for Reforger as they know that the community is the best way to get it's new engine to best state for the players if it's mostly encourgued and built by the players. There's talks of modding and missions things of unique DLC value being able to be voted to a level of the creator getting similar to Valve with Counterstrike, a 75% cut off each sale and BI taking 25% for providing complete unlocking of the engine.
      What theyve done with reforger is massively misunderstood, it's such a leap to a new engine yet remain the same feeling of old, the quality of life improvements on a basic level are great, game-master is one of the best features if people know how to use it, although it's not as good as EDEN Editor as they simply haven't managed to port that completely - though I suspect they will, scripting with the developer tools is a headache to be honest even for simple things. I've a bunch of things to bring back from the 2001 era that I know players and twitch streamers are gonna drool over, have considered just going and finding a small team as the projects themselves are very basic and extremely popular missions throughout ArmA history, they just need to be individually commericalised. Example did you known that Unknown from PUBG got the Battle Royale game-type from? His days playing it in OFP1/ArmA:CWC - personally have known him for quite a while, funny enough the guy hates the fact it became so popular cause its all that followed were clones.
      But if there's any game developers, graphic artists, coders, any talent in the obvious areas that would be interested in two-three profitable projects I've got going atm we need a few more people, and it will sell that I gurantee - alot of its very basic clones of old popular maps, because once somethings is popular in one generation, it will be in the next and the things I'm trying to bring back don't exist at all in towards market, but fit the twitch streaming / fun game genres of today - if interested I can fill you in on the projects more later.
      There's also one for ArmA:Reforger right now that is going to outright ruin ELAN life - as those guys seriously love copy paste coding and are the monolith of RP Life maps at the moment, but trust me we could pump out something more appealing than it in a week with vastly more features. Hit me up in PM's etc if interested. Peace! - V
      Source: Known quite a few of BI Devs / Owners since 2001, Alpha Tested Arma 1&2 / Used the software while in unit.

    • @invert6actual585
      @invert6actual585 4 месяца назад

      ​@@650VersatileGameplayAndMusic I definitely appreciate your explanation. Tossing up a custom map now called Smithton USA. Small 4km training map to be easier on xbox. big WIP tho. Not at the experience to take on any professional projects, still learning C++ and C# to help learn the enfusion scripting better. Though my basic knowledge in UE5 blueprints is helping a lot too.

  • @generalchAOS
    @generalchAOS 2 года назад

    Are you chewing gum?

    • @rabid-squirrel
      @rabid-squirrel  2 года назад +1

      Afraid not, I have had a lot of Sinus lately, maybe that's what you're hearing?

    • @generalchAOS
      @generalchAOS 2 года назад

      @@rabid-squirrel Eh might have been distorted clicks and keypresses, either way awesome video really enjoyed it, any idea how to put it on a timer instead of on game start? So they spawn every x minutes, don't see the point in having them spawn on game start, you could just spawn them statically and not see a difference.

    • @rabid-squirrel
      @rabid-squirrel  2 года назад +1

      @@generalchAOS you can use a handler to watch until they're dead to start the spawns, or elongate the timing mechanism or spawn them via a trigger or any other number of mechanisms. I just tried to approach this first tutorial in the simplest manner possible to get people new to scripting acustomed with the basic principles of spawning AI. I will be going over more practical examples of scripted spawning in a later tutorial :)

  • @jasondonavich2758
    @jasondonavich2758 2 года назад

    I'm having issues you line 86, string spawnGroup = "{DDF3799FA1387848}Prefabs/Groups/BLUFOR/Group_US_RifleSquad.et";
    the error reads Broken expression (missing ';'?) but it looks identical to yours so not sure why its giving that error, any ideas?

    • @rabid-squirrel
      @rabid-squirrel  2 года назад

      Could you share more of the code? Usually that kind of error implies that there's a different line that's missing the semi-colon.

    • @jasondonavich2758
      @jasondonavich2758 2 года назад

      @@rabid-squirrel sorry for it being a lot to look through, I've been back over the tutorial and corrected any errors but i honestly cant see where its missing from.
      class GameMode_Plain1_Class: SCR_BaseGameMode
      {
      // user script
      protected void AISpawner(string spawnGroup, vector spawnPosition, string waypointType, vector waypointPosition)
      {
      // Generate the Resource
      Resource resource = GenerateAndvalidateResource(spawnGroup);

      if (!resource)
      {
      print(("[AI Spawner] Unable able to load resource for the spawn group: " + spawnGroup), LogLevel.ERROR);
      return;
      }

      // Genrate the spawn parameters and spawn the group
      SCR_AIGroup group = SCR_AIGroup.Cast(GetGame().SpawnEntityPrefab(resource, null, GenerateSpawnParameters(spawnPosition)));

      if (!group)
      {
      Print("[AIpawner] Unable to spawn group!", LogLevel.ERROR);
      return;
      }

      // Create a waypoint for this group
      CreateWayPoint(group, waypointType, waypointPosition);
      }

      protected void CreateWaypoint(SCR_AIGroup group, string waypointType, vector waypointPosition)
      {
      // Generate the resource
      Resource resource = GenerateAndvalidateResource(waypointType);

      if (!resource)
      {
      print(("[Create Waypoint] Unable able to load resource for the waypoint: " + waypointType), LogLevel.ERROR);
      return;
      }

      // Generate the spawn parameters and create the waypoint
      AIWaypoint waypoint = AIWaypoint.Cast(GetGame().spawnEntityPrefab(resource, null, generateSawnperameters(waypointPosition)));

      if (!waypoint)
      {
      Print("[Create waypoint] Unable to create waypoint!", LogLevel.ERROR);
      return;
      }

      // Assign the waypoint to the group
      group.Addwaypoint(waypoint);
      }

      protected Resource GenerateAndValidateResource(string resourceToLoad)
      {
      // Load the resource
      Resource resource = Resource.Load(resourceToLoad);

      // Validate the Prefab and show an appropiate error if Invalid
      if (!resource.IsValid())
      {
      Print(("[generate And Validate Resource] Resource is invalid " + resourceToLoad), LogLevel.ERROR);
      return null;
      }

      // Return the resource
      return resource;
      }
      protected EntitySpawnParams GenerateSpawnParameters(vector position)
      {
      // Create a new set of spawn Parameters
      EntitySpawnParams params = EntitySpawnParams();
      params.TransformMode = ETransformMode.WORLD;

      // Assign the position to those parameters
      params.Transform[3] = position;

      // return this set of parameters
      return params;
      }
      override void OnGameStart()
      {
      super.OnGameStart()

      // String variables for our resources
      string spawnGroup = "{DDF3799FA1387848}Prefabs/Groups/BLUFOR/Group_US_RifleSquad.et";
      string waypointType = "{750A8D1695BD6998}Prefabs/AI/Waypoints/AIWaypoint_Move.et";

      // Entity variables for our postions
      IEntity spawnPostion = GetGame().GetWorld().FindEntityByName("US_AI_Spawn1");
      IEntity waypointPostion = GetGame().GetWorld().FindEntityByName("US_AI_WayPoint_Move");

      // Execute the AI spawning using a delayed call
      GetGame().GetCallqueue().CallLater(AISpawner, 10000, false, spawnGroup, spawnPostion.Getorigin(), waypointType, waypointPostion.GetOrigin());
      }
      };

    • @rabid-squirrel
      @rabid-squirrel  2 года назад

      @@jasondonavich2758 super.OnGameStart() should be -> super.OnGameStart(); in the override void OnGameStart() method

    • @jasondonavich2758
      @jasondonavich2758 2 года назад

      @@rabid-squirrel I cant thank you enough for finding that out, i must have spent like an hour just going over it.