Jump to content

anaximandross

Member
  • Content Count

    80
  • Joined

  • Last visited

  • Medals

Everything posted by anaximandross

  1. I'm sure this has been asked a million times, but I can't find a solution. I'm trying to take a global variable that is declared in init.sqf, get its value in a separate script, and then change that global value. However, anytime I do that I get an error saying Local Variable in Global Space. How do I fix this? Thanks in advance To be clear, this is a PvE mission, so all players should be able to have access to the public variables. Init.sqf (I commented out my initial global declaration) if (isServer) then { fn_getBuildingstospawnLoot = compile preProcessFileLineNumbers "LootSpawn\fn_LSgetBuildingstospawnLoot.sqf"; LSdeleter = compile preProcessFileLineNumbers "LootSpawn\LSdeleter.sqf"; execVM "LootSpawn\Lootspawner.sqf"; []execVM "dynamix\dynamix.sqf"; []execVM "VehicleSpawn\vehiclespawner.sqf"; missionNamespace setVariable ["GLOBALFOOD",20,true]; missionNamespace setVariable ["CURRENTBASENUMBER",0,true]; }; // GLOBALFOOD = 20; // publicVariable "GLOBALFOOD"; // CURRENTBASENUMBER = 0; // publicVariable "CURRENTBASENUMBER"; BaseClaim.sqf (where the fun happens) if(!isServer) exitWith{}; params ["_marker", "_foodCost","base_num"]; //Counts number of enemies around the desired marker _units = allUnits select {side _x == east && _marker distance2D _x < 100}; _cnt = count _units; private _globalFood = missionNamespace getVariable GLOBALFOOD; //checks to see if the area around the base is clear if(_cnt > 0) then { hint "Clear the area to claim this base!" } //if the area is clear, this allows the player to claim the base else{ if(_gobalFood > _foodcost) then { //calculates the amount of food remaining in food stores _foodremaining = _globalfood - _foodcost; hint format["You have %1 food remaining!",_foodremaining]; GLOBALFOOD = _foodremaining; missionNamespace setVariable ["GLOBALFOOD",_foodremaining,true]; //determines the current base number to be used for other things CURRENTBASENUMBER = base_num; publicVariable "CURRENTBASENUMBER"; //creates a marker at the current base. This is used for AI targetting deleteMarker "CurrentBase"; _currentBaseMarker = createMarker["CurrentBase", getMarkerPos "_marker"]; "CurrentBase" setMarkerColor "ColorBlue"; "CurrentBase" setMarkerText "Home Base"; } };
  2. I wrote a script that allows the user to access a terminal and spawn in a multitude of facility plots. Each of these plots is represented as a blue arrow which is hidden by default, and then deleted when the plot is spawned in. However, when I try to run this script, I'm getting an error now saying that the array I'm passing in is an object, not an array. Here is this init of the terminal: hideObjectGlobal this; _plotArray2 = [b2_p1,b2_p2,b2_p3,b2_p4,b2_p5, b2_p6,b2_p7,b2_p8,b2_p9,b2_p10]; this addAction["Place Facility Plots","BaseFunctions\CreateBasePlots.sqf",[_plotArray2,b2_term]]; And here is the script CreateBasePlots.sqf if(!isServer) exitWith{}; params ["_markerLocationArray","_target"]; hint "Welcome to the baseplot maker"; _target removeAction 0; { //gets position of current array value _position = getPos _x; //builds yellow square on current array position _veh = "VR_Area_01_square_4x4_yellow_F" createVehicle _position; _cut = "Land_ClutterCutter_large_F" createVehicle _position; _postPole = "Land_VergePost_01_F" createVehicle _position; // //Adds 5 actions to each item to allow various things to be built // _postPole addAction ["Build a Small Farm (15 Scrap)", "Compositions\assembler.sqf",[_position, "foodS"]]; // _postPole addAction ["Build a Large Farm (45 Scrap)", "Compositions\assembler.sqf",[_position, "foodL"]]; // _postPole addAction ["Build a Small Workshop (25 Scrap)", "Compositions\assembler.sqf",[_position, "workshopS"]]; // _postPole addAction ["Build a Large Workshop (45 Scrap)", "Compositions\assembler.sqf",[_position, "workshopL"]]; // _postPole addAction ["Build a Storage Facility (100 Scrap)", "Compositions\assembler.sqf",[_position, "storage"]]; _postPole addAction ["Build a Small Farm (15 Scrap)", {[_this,"foodS"] execVM "Utility\BoxScrapper.sqf"}]; _postPole addAction ["Build a Large Farm (45 Scrap)", {[_this,"foodS"] execVM "Utility\BoxScrapper.sqf"}]; _postPole addAction ["Build a Small Workshop (25 Scrap)",{[_this,"foodS"] execVM "Utility\BoxScrapper.sqf"}]; _postPole addAction ["Build a Large Workshop (45 Scrap)", {[_this,"foodS"] execVM "Utility\BoxScrapper.sqf"}]; _postPole addAction ["Build a Storage Facility (100 Scrap)", {[_this,"storage"] execVM "Utility\BoxScrapper.sqf"}]; this addAction["Recycle Items",{_this execVM "Utility\BoxScrapper.sqf"}]; deleteVehicle _x; } forEach _markerLocationArray; Here is my .rpt section: I have the top half commented out because I am trying to solve another issue. This script is being used at 4 other locations, so I'm defining the plot locations at each base as the base number_plot number (in this case b2_p1, etc). The issue is that I need to get the location of the object calling the assembler script that spawns in the composition, and i'm sure of how to do this. I was going to try passing _this as a parameter, but I have no clue if that will work. If anyone has any suggestions on how to do this better, any suggestions are accepted! Here is the assembler.sqf: Thanks!
  3. You asked for it, and here it is! State of Chaos has been reworked to be fully integrated with Ravage Mod. The Island of Malden has been overwhelmed by an unknown plague, turning the local populace into mindless killing machines. Local military forces were quickly overwhelmed, leaving only a handful of survivors behind. As one of those survivors, you must quickly scavenge for resources, secure a base, and begin to clear out the island. But be careful: this is a fight for survival, and you never know who you will run into on a scavenging run. Features: -Custom base system allows for several different custom bases around the map to be claimed -Each base features several types of facilities that can be built, including farms, workshops, and storage units -Globally defined food and scraps - work with your team to collect more food and scraps. Food allows you to capture new bases, while scraps allow you to build new facilities. Farms produce food, and workshops provide scrap every day. -Custom hunter system - watch your back in the field! You may find that you aren't the only hunter in the field. -Custom horde system - Be careful about how quickly you grow - you may find your base targeted by a horde. Hordes scale based on the number of players in the game. -Custom recycle bins - have too many items or weapons? Place them in a recycling bin located at each base to get some scrap back from them! -Dynamically spawned loot - loot spawns all over the map as you travel around. The type of loot that spawns changes based on building type. Civilian buildings have limited loot, while military bases have significantly better weapons and optics. -Random vehicle spawns - vehicles spawn all over the map, and some will require massive repairs. ....and much more! Food and Scrap System Overview: Currently, your team starts off with a total of 25 food, and 25 scrap. Food is used to claim new bases, while scrap is used to build facilities. There are two ways to get food:building small or large farms, or claiming random supply crates that spawn around the map. Scrap can be gained by building workshops, or by bringing any sort of inventory item to the recycling bin in your base. At the end of each day, the total amount of food and scrap you produce from your farms and workshops will be added to your balance. Claiming Bases: To claim a base, drive up to a marker on the map. At that location, there will be a flagpole that you can interact with. Claim the base, and then look around. There will be a laptop or tablet on a table outside that allows you to construct facility plot poles. Once these poles are placed, you can build facilities at them. ---------------------------------------------------------------------------------------------------------------------------------------------------------- This mission is my take on a PvE game mode that I'd like to continue to grow and work on. The goal if this is to work together, not against. I may eventually make a PvP version, but currently I'm going to focus on this. There will be bugs! Please report them below, and I'll do my best to fix them. Planned Features: -Recycling vehicles for scrap -More AI Missions -Production of weapons and ammo at small workshops -Production of base items at large workshops (No idea if this is possible). -Dialogs (GUI) for better base interaction -More base facilities -Server persistence - and whatever else i can come up with! Please, feel free to request features below! THIS MISSION IS DESIGNED AROUND MULTIPLAYER. IF YOU DON'T HAVE A SERVER, THAT IS OK, JUST HOST IT AS A LAN MISSION ON THE MULTIPLAYER MENU! THIS MISSION WILL NOT WORK IN SINGLEPLAYER!!!! Finally, if you'd like to collaborate on this, shoot me a message, or leave a response below. I'm currently working alone, and would love some help! =============================================================================== Downloads: Steam: https://steamcommunity.com/sharedfiles/filedetails/?id=1649084632 Google Drive: https://drive.google.com/open?id=1PrE26tGB273tVYnjWETWTd369ucY7mi0 =============================================================================== Finally, i'm running a dedicated server with this mission on it for a limited time. If you'd like to join, just let me know!
  4. Hmm, I had the hammer out, but It was being sort of weird. Maybe I was just having trouble following what was going on. Still, great concept and has a lot of potential!
  5. anaximandross

    [MP][COOP 1-10] State of Chaos [Ravage Edition]

    Version 2 of State of Chaos has been released! New features include: -Test version of server persistence. You can now save your mission progress and reload at your desire. This was achieved with GRAD Persistence. Read more about it here -First version of base building has been implemented, this will allow you to pick up and buy many types of fortifications, such as sandbags, H-barriers, etc. -New money system has been added, with each player's money being individually tracked. -New store has been added to the trader depot. Interact with the crate at the top of the stairs using ACE Interaction, and you will see weapons, grenades, ammo, and a few vehicles for sale (still a WIP). -Multiple bugs have been fixed in the scripts To Do: -I will be redoing the base building system to allow players to build their base anywhere on the map, instead of them simply being placed statically. -I'm investigating the possibility of switching everything from being globally defined to individually, or rather, making this be a potentially individual mode, instead of a forced co-op for everyone on the server. Thanks, and I hoe you all enjoy!
  6. Ah ok, that could be it! I was on Altis, but I was looking at some of the smaller formations. Perhaps that was the issue. I was also having some sort of graphical issue regarding the menu system. It wasn't popping up at all for me.
  7. @Vandeanson I've been developing a mod/mission called State of Chaos, its a zombie apocalypse survival mode. I'm incredibly interested in integrating this in, and I'd be more than happy to help you with any testing that you need (I have a dedicated server and some scripting experience). Feel free to DM me if you're interested Also, I can't seem to get the stones to mine correctly. Are there specific rocks?
  8. Hello all, So I'm writing a script that will be used as a function to create groups of units. The issue I'm having is that every single group that I create, needs to have a dynamic variable name, since if I use _group = createGroup in a script it will just keep creating the same group ID. I was going to try to use Format to name the groups, but I haven't used it before, and I got a little lost in the syntax. This is what I have so far: Thanks in advance!
  9. I guess I got my commands backwards! I thought I saw it in their example code on the BIKI, but I was wrong. Good catch!
  10. Ok, i will try this out and see how it works! And the createGroup command can use either true, false, 0, or 1 for the final argument to it. IIRC, in Boolean ogic, true =1, false = 0, so they're interchangeable.
  11. Hello all! SO I was recently working on a port for a popular game mode that utilizes a large number of custom positions related to static structures on the map. I got tired of manually placing the the markers, so instead I created something to do it for me! This script goes through the map you're on, and it creates dynamically named markers at the location of the desired buildings. Currently, I have the script configured to mark: -Radio Towers -Certain Military Buildings -Industrial Facilities -Certain Port components -Airfields Once the building is created, the script will create a marker at the location of the building. This marker is then stored in an array with a relevant title (_factoryArray, _militaryBaseArray, _portArray, _radioArray, and _airfieldArray. These arrays are stored as _markername_position.This script is very easily configurable to search for whichever building you want to find, as well as change the color of the markers (currently all set to blue), the type of marker (depends on the building type), etc. This mod is compatible with all Vanilla Maps, as well as the major CUP maps (I didn't add in the small maps, but they are simple to add in. Open the script and scroll to the near bottom. Simply add a case for the map name you want). All you need to do is add the script and initServer.sqf to your mission file, load it up, and you're good to go! I already configured the script to search for the specific CUP buildings, but it is possible that I missed a few. If so, please let me know, or you can also add them in the script manually. I provided comments to guide you along. Credits: Full credit goes to @Asaayu for doing the heavy lifting on the script! Permissions: Anyone is welcome to use this script, just please provide credit and/or a link back to this page. Download: https://github.com/Anaximandross/DynamicMapIndexer Happy hunting!
  12. Ya know... I think it was how I was originally going to write it, and then I just got focused on that method and didn't think about it. Regardless, it runs once at the beginning and that's it, so its light on performance
  13. anaximandross

    [MP][COOP 1-10] State of Chaos [Ravage Edition]

    @Wei Zhao I've only made it on Malden for the moment. In the future I intend to expand it, but at this very moment, I'm taking a break from development to tend to other aspects of my life
  14. anaximandross

    Mission Collection

    Hello everyone! I created a new mission that utilizes Ravage. It features things such as claimable bases, constructable base facilities to produce scrap and food, and much more! Here's a link to the forums topic:
  15. Hello all! So i've been writing some scripts for multiplayer missions, but I'm having some trouble understanding locality. I have two questions: 1.) How do I decide if something if something needs to be done client side or serverside? 2.) How do I ensure that my scripts will work for both a player host and a server host? would something like if(!isServer || !isDedicated) exitWith {}; give me the desired effect? I've read through BI's page on locality, but I don't really understand it.
  16. The Island of Malden has been overwhelmed by an unknown plague, turning the local populace into mindless killing machines. Local military forces were quickly overwhelmed, leaving only a handful of survivors behind. As one of those survivors, you must quickly scavenge for resources, secure a base, and begin to clear out the island. But be careful: this is a fight for survival, and you never know who you will run into on a scavenging run. Current Features: -Custom base system allows for several different custom bases around the map to be claimed -Each base features several types of facilities that can be built, including farms, workshops, and storage units -Globally defined food and scraps - work with your team to collect more food and scraps. Food allows you to capture new bases, while scraps allow you to build new facilities. Farms produce food, and workshops provide scrap every day. -Custom hunter system - watch your back in the field! You may find that you aren't the only hunter in the field. -Custom horde system - Be careful about how quickly you grow - you may find your base targeted by a horde. Hordes scale based on the number of players in the game. -Custom recycle bins - have too many items or weapons? Place them in a recycling bin located at each base to get some scrap back from them! -Dynamically spawned loot - loot spawns all over the map as you travel around. The type of loot that spawns changes based on building type. Civilian buildings have limited loot, while military bases have significantly better weapons and optics. -Random vehicle spawns - vehicles spawn all over the map, and some will require massive repairs. ....and much more! This mission is my take on a PvE game mode that I'd like to continue to grow and work on. The goal if this is to work together, not against. I may eventually make a PvP version, but currently I'm going to focus on this. There will be bugs! Please report them below, and I'll do my best to fix them. Planned Features: -Recycling vehicles for scrap -More AI Missions -Production of weapons and ammo at small workshops -Production of base items at large workshops (No idea if this is possible). -Dialogs (GUI) for better base interaction -Reworked vehicle spawn system -More base facilities -Server persistence - and whatever else i can come up with! Required Mods: -ACE -ACEX -RHS ACE Compats -RHS AFRF -RHS USAF DOWNLOADS: https://steamcommunity.com/sharedfiles/filedetails/?id=1646860085 https://drive.google.com/open?id=1PrE26tGB273tVYnjWETWTd369ucY7mi0 Please, feel free to request features below! THIS MISSION IS DESIGNED AROUND MULTIPLAYER. IF YOU DON'T HAVE A SERVER, THAT IS OK, JUST HOST IT AS A LAN MISSION ON THE MULTIPLAYER MENU! THIS MISSION WILL NOT WORK IN SINGLEPLAYER!!!! Finally, if you'd like to collaborate on this, shoot me a message, or leave a response below. I'm currently working alone, and would love some help! Credits: Loot spawner: Full credits go to: Ed! (404Forums) and [GoT] JoSchaap (GoT2DayZ.nl) for the loot spawning Dynamix AI Spawns: Full credit goes to @X Pro Octane for his Dynamix script, which can be found here. Finally, I'd like to say thank you to all of the forums users that have helped me with my scripts!
  17. anaximandross

    [MP][COOP 1-10] State of Chaos

    I have delivered in a time frame faster than anticipated!
  18. anaximandross

    Locality issues

    Yea, turns out this is a pretty complicated subject, and the entire answer to just about every locality question is, "It depends". If you look at the Biki though for every command, it'll tell you whether it has local or global parameters ad effects.
  19. I created a simple dialog using a listbox, two buttons, and a frame in the GUI Editor, and when I exported that, it gave me this: But I have absolutely no idea where I go from here. I'm looking to create a list of weapons that the user can select from, which will then call a script to "build" the weapon, and add it to a crate. I've read through KK's tutorials but they didn't seem applicable to this, and I don't understand what any of the documentation for ListBox means. Can anyone help me out?
  20. anaximandross

    Where to go next with creating a dialog?

    Yea that's a good point. If you had told me two weeks ago I would have done all the scripting I have in that time, I would have laughed. Unfortunately at this point I'm just not sure I WANT to take on the dialogs lol. I'd rather find a team😆
  21. anaximandross

    Where to go next with creating a dialog?

    Wow! This is an incredibly in depth process. It's very overwhelming to look at from the front end. I imagine its pretty tedious all the way through. Thanks for all the help everyone
  22. anaximandross

    [MP][COOP 1-10] State of Chaos

    It'll probably take me a week or two to get it converted over, but it should be doable! Hardest thing for me is saying goodbye to my beloved Ace 😔
  23. anaximandross

    [MP][COOP 1-10] State of Chaos

    I'm actually going to work on integrating this next. Ravage actually overhauls many of the key systems that I wanted to fix anyway, such as zombie spawns and vehicles spawns. Thanks for the tip!
  24. anaximandross

    [MP][COOP 1-10] State of Chaos

    It seems that some people have been issues with Zombies and Demons lately, so I'm definitely going to look into some other mods. Thankfully this was set up in such a way that it will be fairly easy for me to switch the content out. And thanks! I remember playing Overpoch and I used to LOVE the idea of going out and picking up weapons and then taking them back and selling them. This, to me, just adds purpose to scavenging and keeping what you find. I'm planning on adding in a vehicle scrapping script as well, but I was having a little more trouble with that.
  25. anaximandross

    [MP][COOP 1-10] State of Chaos

    Thank you! It's been a long couple of weeks pushing for a release!
×