Jump to content

SMB92

Premium Member
  • Posts

    2304
  • Joined

  • Last visited

Everything posted by SMB92

  1. Just thought about your mention to move SpawnEnemyActors to the quest script. While you can do that, as it is it doesn't really matter either way. You'd need to make sure to add an argument to the function so you can pass the marker ObjectReference. Then in the SpawnEnemyActors function change the self in the uses of self.PlaceActorAtMe to the argument variable. My problem with that is, I want to store the array of spawned actors on the local script, so I can clean them up or do other things with them later. As mentioned above though, if it is better to have the Spawn() function on the Quest, I could do that, but I'm not sure what changes would have to be made for the SpawnEnemyActors function on the local script so that all the parameters etc would still be passed etc, or maybe I don't have to do anything at all? So visually (because I'm crap at explaining things lol) the script would look like this? And the quest like this If this just works like this than that's great, but the wikis give me the impression I need to do something else for everything to work properly?
  2. Thanks very much for your help so far BnF, would have still been in the stone age without ya. I'm gonna go do some serious play with it now and start getting things polished/set up. @kitcat81 - thanks for all your help so far as well :) For the random spawn markers, I'd prefer they just run the spawn() function themselves, they fire on a chance variable so not all of them will spawn something. But the code you mentioned there is exactly how I want the Ambush type points to work. There will be more functions and values stored in the main quests relative to each type/system so I'm not really wasting them on just storing arrays. Or maybe it is just better to have the function in the quest, I'm not sure if there is any difference or if I'd need to code it differently to make the SpawnEnemyActors() function in the local script work properly
  3. Done everything like you mentioned and finally, it compiles (Ship Itâ„¢) EDIT: Confirming that the array is no longer a property on the marker script!
  4. type mismatch while assigning to a asc_random#actortypestruct (cast missing or types unrelated) No output generated for ASC_Random, compilation failed. BTW this is the error that I see in the compiler, seems a bit strange to me.
  5. I understand only structs and functions can be imported, thats fine. What I want to do is look at the array in the quest script, have the functions in the local script see and use it, that is all. I don't need to change values in it from the local script. So yeah basically a remote storage so I don't have to define potentially tens of thousands of properties on each marker (imagine updating them omg)
  6. I use Notepad++ with the Papyrus highlights plugin :) I'm quite familiar with all those things in CK, pretty much Notepad++ and CK back and forth, back and forth. I have not tried bothering with the compiler plugin for Notepad++ though, I don't see any need for it (yet). I like this idea you mentioned, I did try sticking the struct along with the array inside a blank script and importing it, I did not think to do what you suggested (struct in blank script, array in quest) but I will do that right now. I was also looking at changing out using an XmarkerHeading for a DefaultActivator (because you can tie the script to the base object) but I am not sure yet if there are any limitations or implications of using an Activator placed in the world ( and using OnCellAtach events etc, will read into it). This was just a backup plan so to speak. I thought about having the Spawn() function on the Quest and having that pass the parameters/values to the marker script for the SpawnEnemyActors() function, but I do not know how to write that up properly just yet, I am aware I would have to code some security measure so that multiple instances of the Marker script couldn't run that function all at one time.
  7. Well regardless of it not compiling, the array showed up on the object script as a property like you suggested, thus defeating the purpose of the whole endeavor to avoid manually filling all the properties. Unless there is some way to copy the array from the quest script to a new one in the marker script, but even then performance would be of concern I'm not sure what else to do other than not use a struct all so I can use autofill, but even then it's gonna be a pain in the ass to deal with. I guess this is why programmers are on the big bucks
  8. Interesting, I was doing it right then to begin with.... However I still get a compiler error, (type mismatch while assigning to a asc_masterrandomquestscript#actortypestruct (cast missing or types unrelated)) when the code looks like this: If I remove the Quest property, I get the compiler error ActorTypes is not an array/ActorTypes is undefined (thats with import still there) Just to note, the ASC_MasterRandomQuest is setup and it's script compiled and ready to go, just in case that could have been a possible cause.
  9. One thing I didn't try yet is using another marker with just the arrays/struct on it script and using that. From what I can tell using a quest is better though. I'll look at using an object now just for fun. EDIT: just saw your post.
  10. What I was thinking, if I had the struct and array on a quest script as the property, I would only need to set the property once, instead of on every instance of the script. And then each marker can look at those properties. Just like you mentioned above. I'm having a hard time grasping how to get the script to get/look at the array out of the quest script though, I tried a few examples from other script but compiler will give me different sort of errors each time, mostly 'ActorTypes is not an array" and "cannot cast, types incompatible". So the quest script is exactly as above: And then the rest on the code runs on the marker I've removed the attempts at casting I tried, but left the quest as a property. On a separate note, when I said above I was looking at having ALL the code run on a quest, I was thinking of having the script do a FindRandomRefOfType (or similar) and run the functions/placeatme on the marker it found. But this poses a limitation in that I'd need lots of arrays to track all the spawned groups, which would end up extremely messy or not possible. If I can just point the script on the marker to the array of structs in the quest script, I can solve that problem and the hassle of filling millions of properties :). I do intend to have multiple arrays of the struct for locations like you said, if I can achieve this.
  11. Is there a reliable way to get the struct/array from another script? I'm guessing no due to the lack of information about it. So if I put just this part of the code in say a quest and have my functions use them as if they were properties on themselves Struct ActorTypeStruct ActorBase LvlActorBase ActorBase LvlActorBossBase GlobalVariable ASC_Allowed GlobalVariable ASC_Allowed_Boss GlobalVariable ASC_Max_Allowed GlobalVariable ASC_Max_Allowed_Boss GlobalVariable ASC_Chance GlobalVariable ASC_Chance_Boss GlobalVariable ASC_Reroll_Allowed GlobalVariable ASC_Reroll_Chance EndStruct ActorTypeStruct[] Property ActorTypes Auto Const Anyway I'm really leaning on making this fully dynamic now, as in have the whole code on a quest, and have the code pick out a marker in the loaded area and run the script on it for a spawn. I really want to use this struct system, but filling the properties is gonna be hell especially with updates.
  12. Didn't see the edit til just now sorry. I'll have a play around with the CK, I see what they mean about special UI now from your video. Thanks for that.
  13. I guess I was seeing things with the structs. Ah well nvm. I was attaching the script to an XmarkerHeading that i duplicated and renamed, although I recently heard placing a script on a static is a bad idea. What I'm thinking now is to just have a master script (probably attached to a quest), with child scripts attached to patrol marker or something getting the already defined info from the master and having the spawn function on the child.
  14. So you wouldn't have this for example: But you'd have this for example: And each Array contains the relevant reference to the global for that type? For that last one, suppose you could pass them as parameters as well, I'm just being lazy here. What I was thinking is, if I had multiple structs in an array, I could remove a whole Actor Type from the array so it would never even be looked at if it were disabled, instead of having say ASC_Allowed_Raider_R1 etc etc etc. So using your analogy, I'll only have the houses I (the user) want present on the street, if that makes sense. That's just the first thing that came to mind when I really looked at it.
  15. Okay I get it now, that little wiki entry threw me off a bit. After posting that I kinda realised that lol. Regarding my other post above with structs etc, I think I realise now this is exactly what you done in that snippet lol. I just sat down (just got my youngest to sleep lol) and looked at writing said code while looking at yours.
  16. Let's see if I'm getting an understanding of things so far. Looking at what you've shown me, I wonder if I can do something like this: (Sorry, haven't time to write it in code right now) Lets say I have a master script that contains a struct for each Actor type. Lets say that this script updates when users update their settings. In this script, all the structs for each Actor Type are defined in an array. So when we do the roll "iWhoToSpawn, we pick out a struct currently present in said array. So in effect, instead of having a check to see if a Actor type is allowed at all, it won't even be present if it's not, then I can purely have the reroll function for what I originally intended for, to emulate a battle (instead of setting up a scene and placing at a point if you get what I mean). I brought in he "reroll on block" as a workaround for the shortcoming in the code that I mentioned earlier. Would it also be possible (I think I might be dreaming a bit here) to get the parameters for each actor type (like you did in your revision of my script) out of the struct which is defined inside the array? I'm a bit cloudy on that one but I'm seeing "something in the distance" so to speak. EDIT: this could potentially make use of "defining parameters out of order" as you mentioned, if I also understand that correctly. Maybe, maybe not necessary. Basically the picture I have in my head is avoiding the 128 (512 bit) limit on these arrays whilst still retaining all my variables. The other thing being, having a single master code for each system would make the whole filling properties easier, only a small script would need be placed on each marker with only that script as a property. Forgive me if I'm going off the beaten track here :wink: Going off of this: Struct ActorTypeStruct ActorBase LvlActorBase ActorBase LvlActorBossBase GlobalVariable ASC_Allowed GlobalVariable ASC_Allowed_Boss GlobalVariable ASC_Max_Allowed GlobalVariable ASC_Max_Allowed_Boss GlobalVariable ASC_Chance GlobalVariable ASC_Chance_Boss GlobalVariable ASC_Reroll_Allowed GlobalVariable ASC_Reroll_Chance EndStruct ActorTypeStruct[] Property ActorTypes Auto Const ; this is const so that any additional entries we put in the array are passed to the script whenever it checks the contents of the array. the only time this will be inaccrurate is if a save was created in the middle of the spawn function running and then the mod updated to have changes to the array. Function Spawn() int iNumSpawnTypes = ActorTypes.Length ; how many types of spawning actors can we support int iWhoToSpawn = Utility.RandomInt(1,iNumSpawnTypes) ; changed to use the size of our array of actor types ActorTypeStruct spawnDetails = ActorTypes[iWhoToSpawn] if (spawnDetails.ASC_Allowed.GetValueInt() == 1) SpawnEnemyActors(spawnDetails.ASC_Max_Allowed.GetValueInt(), spawnDetails.ASC_Chance.GetValueInt(), spawnDetails.LvlActorBase, spawnDetails.ASC_Allowed_Boss.GetValue() as Bool, spawnDetails.ASC_Max_Allowed_Boss.GetValueInt(), spawnDetails.ASC_Chance_Boss.GetValueInt(), spawnDetails.LvlActorBossBase) elseif (spawnDetails.ASC_Allowed.GetValueInt() == 0) && (spawnDetails.ASC_Reroll_Allowed.GetValueInt() == 1) RerollCheck(spawnDetails.ASC_Reroll_Chance.GetValueInt()) ;else ; should there be something to handle a case where we're not allowed and have no reroll allowance? the way this is right now, if both were 0 then nothing would get spawned and the script stalls until the cell unloads and the spawn is called again on the new cell load. endif EndFunction
  17. Just reading the Flags page there on Const properties, I need users Globals to be read at runtime from the save game, otherwise they'd always have the defaults from CK. I think I'll go along the lines of what you mentioned and have an update script, something that looks at version change, and in the mod menu, have a second global that remembers the user settings as well as an extra value that I can return as a bool that says if the user has set custom values outside the presets.
  18. I'm not daunted at all mate, best I study into the advanced subjects now so the full potential can be realised and the direction of the mod decided sooner. My original code has advanced as I have realised more and more optimisations and/or bugs (sometimes false positives lol) and I've pretty much gotten to the stage now, where I feel (keyword there FEEL) I need to explore all the unknowns (which was at the point of studying into arrays and their potential) WOTC uses arrays for pretty much everything, I guess I can understand why now. I had wondered this quite a bit. To clarify the random code itself was meant to hold a lot of different Actor Types/Races, I wasn't intending on removing any for specific locations as this marker is for "generic" locations, where anything on that list could spawn. I wasn't quite happy with how I was cycling through said list, or the whole reroll system (which is currently limited to happening just once, I sorta wanted users to be able to set a limit on that themselves as well, at their own peril lol). However, there a few things that bring that undone already (not even considering "civil war" implementation). The first thing being DLC implementation. I will have to refill all the markers properties anyway when adding the DLC Actor types to the list, which happens that not all markers I want to have DLC spawns at (I had no intention of having Fog Crawlers walking around town, limit them to the coast etc etc). Then as you mentioned, there are points I want to have without certain actor types, and I had planned to attach a customised version of the script. If we start talking about a civil war type system, if I wanted to remove a group from an area, in effect I am also lowering the chances of spawns in an area at all with my current script (but I was kinda letting that happen anyway letting users turn off various actor types, again coming back to me not being 100% happy with the reroll system etc). So with that alone, I realise the coding nightmare you speak of, I stand to lose track of everything very quickly. It's also still in the back of my head, am I better off having this script tied to a quest and run dynamically, which picks out a marker to use as a spawn point as you go (which I spoke about on the other thread), thus making the whole thing dynamic? I'm also sorta wondering if I could use that to have all the other "systems" integrated to the one script (but probably I can't because the script would never be able to know the different types of base markers I'm placing and what I want to spawn there) I'm having a look at those links you posted, I'll do some more reading on some of the other things as well.
  19. Mainly looking at some nice color swaps/matetials for robots to suit varios factions. The ones linked earlier in this thread aren't too bad, but there is Automatron to think about as well. Wouldn't having at least some modded variants for other factions. Theres a nice Vertibird paint job mod that came out recently, I've already asked about that one :)
  20. I've been meaning to make all the weapons from MF standalone in my load order, the mod itself has too many changes for my load order lol but I like the guns
  21. Probably would make them rad resistant lol. I would give them high tiered leveled lists so they'd have these kinds of weapons.
  22. Regarding Q1, what I meant was how does the script fill in all the local variables in the function using the property group and in order? So like, Function Spawn (all properties in order here) All local values filled in order here as per list above? I think I understand what structs do based on your example and explanation, I am a little concerned about fillibg the properties though. This particular script was intended to be attached to a marker, I liked auto-filling as it made the job less tedious since mant many markers will be placed. Its seems like a cleaner system though. Regarding PlaceActorAtMe, I sorta knew it was a bit heavy to use, but it does the job I want it do (I can set the encounter zone and the random difficulty which users can set the values for). PlaceAtMe seems to have CTDs sometimes, I read that actors can spawn under the map with it, but maybe this function is just as heavy anyway. I think I should outline what systems we have planned. There is the random system, which is this script, which is attached to markers. There is then the Ambush system, which will bw similar but have a distance check event and be subject to smaller actor type lists depending on the location of the ambush. We will also have RadRoach infestation points, extra wildlife points that focus only on those types and subject to logical world placement. There is also talk of having a terminator stalk you, which would involve a quest. I'm also considering dividing main facrions from the random script and fiving them their own points and system, but haven't thought much about how that could balance out yet. In the end, all globals I make here can be changed in a menu by the user so they can stuff with as many settings as they like. I wanted that level of customization. You mentioned performance issues with large arrays, the "presets" that i will make will not exceed 20 mist of the time and even then not much more, but users could go and set that to 100, but that is at their own peril. Early talk of some sort of "civil war system" as well, where any faction could vie for control of a region. I am thinking to use a score based system and somehow using the arrays created by each spawn to track who killed who, amongst other relevant variables that could be used to determine "scores". A similar thing has been made in the unreleased beta of War of the Commonwealth which is based on a series of quests and variables for just the main factions alone, but as said its only early thoughts and I haven't studied that too much yet
  23. Ill read over and post any thoughts That is about the best thing anyone ever done for me on the internet, amazing stuff. I think I'm with the program now, I can keep referring back to this when I need. I'm surr many a Nexus user will be happy to read this too, its practically a small wiki! Thank you very much for sharing your knowledge! I'll post some updates on this thread as well at a later stage when I start implementing other systems to the mod as well
  24. Get a hold of people like TrophiHunter, DeadPool2099, Skibadaa, MikeMoore etc just to name a few. Your models look as good a quality as theirs, I'm sure they'd be real interested in your work, its quite exceptional
  25. @BigandFlabby Thanks going out of your way to rewrite that. Just a few questions if you or anyone wants to answer 1. Regarding this: How does this get/list all the variables? Does it just get them in order and when it hits the function fill them automatically? never seen anything like that before, but that's cool if I can do that. That's a shizload of code/functions I don't have to write. There are 12 regions though (so R1 - R12). 2. I've made the Globals themselves not Const - so they are saved in the save game. Doesn't that mean I can't refer to them as Const in the script? Or does it just mean I don't have to force an update script to reset the values (in the case that this was attached to a quest, however this particular script is not, it's meant to be attached to a marker). I recall seeing an error with this at some point and avoided it. 3. Regarding this bit (not really a question): I got the feeling I could do something like this, I didn't understand it well enough so I just went for the "safest" way and iterate through until nothing was left in the way I understood how. I seen a lot of similar things in WOTC. Apart from that, I never really thought to use prefixes like i, b and f for values, that is something I will take up habit of. I haven't studied into structs yet, just some basics that I haven't fully absorbed ( I understand quests are structs etc). If there is an economical way available to use this to store all the main values(settings) that could be faster than using Globals and Get functions, than that would be of interest. Most of the scripts like this one (random spawn code) are designed to be attached to markers though, I wanted to avoid having anything running all the time (well there are a few things that will require this in future features, but as less as possible I guess). I'm positive I've read somewhere that Add() function is fairlylatent, but don't quote me on that.
×
×
  • Create New...