Jump to content

SMB92

Premium Member
  • Posts

    2304
  • Joined

  • Last visited

Everything posted by SMB92

  1. I saw your post in my email, I had a 10 hour day at work today, but I do watch them all equally. If thats true what you said about the markers than I might just attach my scripts straight on the patrol markers since I'm building a physical network of them anyway. In saying that you might recall I mentioned on the other thread about a marker/script complaining in the papyrus log after I removed the mod, but fixed it by leaving the area then saving (unloading it). I didn't pop up in the next log, but not to say it's not still there. Unless you deleted your post because you found info to the contrary?
  2. I use the CK and Notepad++. I've looked at some suggested programs but i like to keep it simple. I'm glad the compiler tells you, or at least mistly hints where you went wrong or any mistakes you made, otherwise I think this would suck :D. No problems for off topic, doesn't phase me at all.
  3. Yeah I generally dislike using Globals if possible. But in Papyrus GlobalVariable is something actually global to the game not the script. So it's a little different context. Then you have "local script variables" which are global to any functions in the script. Then there's local function variables. Which are exactly as it sounds. I was bored so I took the last piece of code and did some refactoring to make it a bit smaller. This is the refactored code. Also grouped the properties. If we wanted to get more advanced you could define a struct then pass an array of the struct then have the script loop the array of struct to decide what to spawn rather than having to hard code each type individually. The changes to the script aren't all that complex but having to re-input everything in the plugin would be tedious. The benefit to do this would be that adding additional spawn types later would be as easy as just setting the variables in CK. No script changes needed since it pulls it all from the vars. I'd also like to point out that the code originally (and still) uses the same lvl list to spawn both regular and boss actors. For future use you'd probably want to add additional boss lists. I also converted all the properties to const. This way if the plugin was ever updated the values would pass to the script. Otherwise when the script first fires and starts running it saves all those values inside the save file. If it's attached to a quest then it would never terminate and restart unless the quest was stopped and then restarted. This is as much of the original code in tact with the refactor and the redundant stuff commented out for reference. I did group the properties though. Very informative. I didn't mean to sound like I criticize because ... honestly this is only like a partial code of something much larger, looking at this part of the code tells me nothing. Very soon I will get around to scripting. Are all the scripters here with computer science background? I can't imagine anyone with zero programming skill to start writing scripts like this, overwhelming would be an understatement. What program do you use to write these scripts? Or just simple notepad? Or there are dedicated setup with proper compilers? Does the CK help? To this day I still don't know what CK looks like because that thing always crash on me no matter how many times I installed. I have very little programming experience apart from some HTML and PHP/Wordpress crap that I have to deal with at work, along with the SQL databases a lot our server applications rely on for various departments, like HR and Accounting. Otherwise my talents lie in hardware and mechanics. I started learning to write Papyrus code 3 weeks ago, when I decided that the only way to find out what was wrong the original War of the Commonwealth mod was to learn how to write it myself. I am trying to write a system that is non reliant on threading, something that just "works". I could read most code and understand what it is doing, just never wrote anything complex before. But I like to think I'm not a complete idiot ;). My use of many Global Variables is because users can define all the settings in this mod, absolutely all of them. I figure having many globals is overall safer than having a looping array/script that keeps these variables alive, but that does come at the cost of having them in the save game always (which for them is not so bad compared to other things like objects of sorts). At some point tonight I'll review the codes posted at see what I can learn from them. Thanks a bunch for this. I will credit every member in the final product at the top of the page who ever helped me.
  4. Just to note the code is well and truly beta, lot of test variables there (like the timer and lvl lists etc, thats to be cleaned up the final solution is decided). Still reading through comments
  5. Thanks for replies folks Im just reading through it all now. Big day at work, the stars must be lined up wrong because PCs are failing at all the different companies today...
  6. Compiler carried on it wasn't a known function lol. So I done it like how you see above. I'm glad you mentioned the SetLinkedRef thing, because this Array is not working properly. It's not setting the LinkedRef to None. It's saying the Index is out of range in papyrus logs as well. Perhaps I should be declaring it as an array property, maybe it's not saving at the end of the function. Edit - maybe because I have declared it at a size of 0. Maybe i should declare it at the max spawn size first, and use the groupmember int to get where its actually filled to. That kind seems like its not a dynamic array though to me. Name of topic lol.
  7. Okay so learned the hard way Add() and Remove() no work on these arrays lol. Anyway this is the new script (compiled) for anyone interested:
  8. Not al all. Just note that setting linked ref creates persistence. And keeping/storing actors as variables makes them persistent too. You can`t delete a persistent ref while something keeps it persistent. It will get "D" flag (deleted) and it might become invisible, but it will be still be there untill you clear  the variable or remove something that keeps it in the world.Ah very good! I'll unlink them as well, I would of missed that :P
  9. I link them to a patrol marker dynamically and they start patrolling the network of markers I have in place. Some spawns that I don't want to patrol will not have this code. Reason why I have made this network is that it is strongly noted by users of WOTC patrol AI was broken at some point. I was hoping that doing this would ensure it worked well always, and provided a patrol marker network other modders could use as well. And yes, I will probably want to run other functions later on, it will definitely be handy. Thanks for the optimization there too
  10. Cool so my method of destroying (assigning none) to each member of the index will destroy it in the end, but I could make it faster by addressing them all. That's great news (I was a bit worried it would hang around and keep everything persistent) Another thing I might find useful in this method of using an Array later, is tracking who killed who between groups, and devise some sort of "score" system for the "civil war/regional control" type of feature that users are asking for. Regarding the PlaceActorAtme, according to this Talk on the Wiki they do not become persistent. The reason I want to use this function is 1. I plan Encounter Zone features, and 2. It seems more reliable at placing the spawn than PlaceAtMe (I am sure I read somewhere that you have to put your spawnpoint in the air because it is possible for actors to end up half in the ground, falling through the map, which might explain some CTDs I saw with it ages ago). However worth noting, if I select one of my spawned NPCs in game, I get the "ff" formID, but with the [PP][T] flag on all of them. I assume this means Permanently Persistent, Temporary. I don't really know what the [EP] tag is some other things found in game means and this sorta doesn't make any sense to say Permanently and then Temporary, I just thought maybe thats how it flags it or something. Maybe it means something else entirely, never found a good explanation on Google. Thanks for the post, clarification is a great thing some times.
  11. Just wanted to see if anyone with experience was around to maybe make some suggestions. I wrote the array part of the code today at work ;) (damn its hard life, IT, lol). Gonna give it a test soon, just got home after the TimeTarget crisis made me work late. Edit - from my experience, I wouldn't need the array if I mark the DeleteWhenAble before I reset spawn to None. Or maybe it doesn't work that way like SetLinkedRef does (they patrol even after I've dumped the NPC as a variable and got another).
  12. Suppose that would be the easier way if it works :D Still wouldn't mind having the array around though, this is handy for the Vertibird tracking script that is currently implemented in WOTC by Engager. It sorta rolls the dice on a group and possibly has a Vertibird intercept them (I think vanilla is like this too in some RETrigger spawns)
  13. I was looking at a way to dynamically get my spawn node but the functions involved aren't all that great in terms of performance (at least I get the impression). This script is actually attached to the node so I don't need to find it, nor does the node need to be persistent (an earlier error on my part lead me to believe they were permanently persistent but that's not the case) The spawncounter has an absolute limit defined before the counter starts, so that's fine too. It's the count backwards on the array, removing and destroying it upon completion is what I'm unsure about at this point. Few articles I have seen have good examples on that, unless I'm just not understanding them well. I got the impression the CK thread wasn't looekd at so much, so I just posted in here for the time being. I'm still at work too so one is all I can handle right now :D. Especially now the login system for all the employees for one of our companies just crashed, right in time for knock off D:
  14. Just to post a bit of an update, I've consolidated some of the code so now only 1 script need be applied to all random spawnpoints, at the cost of making a makeshift "border" of trigger boxes around each region to tell the game what region you are in. I figure this will make working on all systems a bit quicker down the track as well.
  15. Â Yeah wasn't planning on using youtube videos if I had any other option. Â Can AfterEffects take processed audio and then dissect it down to the individual tracks? Â I'm pretty sure at this point I'd be better off trying to find the sound effect libraries they used for the show than actually trying to rip them from the show itself and have to do all the extra work. I'm not sure if AE can save them as individual tracks or not nor if it can convert/save as a certain format. I'm sure there'd be some audio pro on this board who might know.
  16. Theres an online youtube to mp3 converter, but I'm not sure the legal implications of that with the youtube videos. Maybe you already know that, but thought I'd give it a mention. My brother uses Adobe AfterEffects to extract sound from one thing to place in some videos he makes but no idea on that myself.
  17. Well Im working on a spawns mod, and one of the discussions is around creating a "civil war" type scenario where various groups may vie for control over certain regions etc. I've already made the random spawns code and decided on the system to use for that (which doesn't involved any long running code) but I'm open to ideas on how this could be implemented, most hopefully using said system. I currently have ownership of the War of the Commonwealth mod as well, so I'm looking at that for ideas on systems to use. If that motivates you we can talk more about it.
  18. Hi folks. I'm doing some study into using arrays with Papyrus, currently I'm looking at how I can use a dynamic array to do what I want. I've got a bout 6 or so wiki pages up that I've been reading through, as well as various example code I've looked at in War of the Commonwealth. I was hoping to get some advice on what I've learnt so far. First I'll say what I want to do with this and then I'll post the example code I just made. What we want to do is, dynamically create a list of Actors that spawn at a spawn point (that I've made) so I can do things with them later, such as disable them/delete them when they have been unloaded for some time. And I also want to destroy the array in that particular case so it's not making my spawnpoint persistent forever. You might say I can do that with PlaceAtMe function, but I need to use PlaceActorAtMe function, so I need to do this instead. Here is example/test code I wrote, with commentary: Event OnCellAttach ;Do what I need to do to get to Function Spawn(), if we do Spawn() EndEvent Function Spawn() if (WhoToSpawn == 1) && (1S_Allowed_Raiders_R1.GetValueInt() == 1) ;1 = Raiders, and are we allowed to spawn Raiders according to user settings SpawnCounter = 1S_Max_Allowed_Raiders_R1.GetValueInt() ;Maximum allowed units to spawn while (SpawnCounter > 0) if (Utility.RandomInt(1,100) >= 1S_Chance_Raiders_R1.GetValueInt()) ;Chance of a unit actually spawning (makes the spawn amounts a bit more dynamic) Actor[] SpawnList = new Actor[0] ;The list of Actors that will be controlled, maybe I should make this straight after the function call instead of in this block Spawn = Self.PlaceActorAtMe(LvlRaider, Utility.RandomInt(1,Difficulty), R1_EZ) ;Place the spawn Spawn.SetLinkedRef(PatrolMarker) ;Set the NPC to use the Patrol marker network I've created, there is a starting marker next to each point (we use GetClosest function rather than property) SpawnList[GroupMembers].Add(Spawn as Actor) ;Add the spawnpoint to the array, GroupMarkers is a declared Int starting at 0. Not sure if this is correct method but for example only GroupMembers = GroupMembers + 1 ;Increment the index number + 1 SpawnCounter = SpawnCounter - 1 ;Lower spawn count remaining Spawn = None ;Ready for next actor SpawnSuccess = True ;This value is used for another function else SpawnCounter = SpawnCounter - 1 ;Lower spawn count on unsuccessful dice roll for dynamic group size endif endwhile endif EndFunction Event OnCellDetach SpawnPointLoaded = false Utility.Wait(10) if (SpawnPointLoaded = true) && (Player.IsInCombat == true) ;I'll figure out how to loop this efficiently eventually elseif (SpawnPointLoaded == false) && Player.IsInCombat == false) ;We can disable/delete or do stuff to the Actors in array if true) while GroupMemebers > -1 ;Not sure if this is what you do here SpawnList[GroupMembers].Remove() ;Remove the highest index actor from the list GroupMembers = GroupMembers - 1 ;And count down until the list is empty endwhile ; Whats the best way to destroy the array here so it's not saved endif EndEvent
  19. Just running some tests for the last hour or so with timer and 2 random groups, now it's working just fine, with points placed right next to each other in same cell, and one in cell next to it. Going to enable the reroll dice chances now and see what happens.
  20. Yes, but that doesn't explain the timer issues you are experiencing. I haven't used a timer on the markers since I moved to using a formlist with an individual timer, I'll test that again this afternoon. With them I had 2 markers with same script (at the time script was very very basic), but only one ever pushed out an NPC, I kinda figured because timerIDs are the same (On wiki it reads they are individual per script, but I just assumed that meant the one script and not individual to multi instances.)  I did not mean to use randomfloat instead of randomint. But creating a random pause before running randomint fixed me hairstyle script. Just in this case randomint does not fire in the exactly same moment.  So do you think randomfloat would do the same? I like your timer workaround but I feel like users would still make bug reports about it happening from time to time. On a separate note, the FindRandomReferenceOfTypeFromRef, if I make my own marker will it pickup any ref with my base marker or will it pick up any marker. From the wiki I assume it will get my base object not just the type in general (which is what i want.) Might as well ask seems educated people are here :)
  21. Yes, but that doesn't explain the timer issues you are experiencing. I haven't used a timer on the markers since I moved to using a formlist with an individual timer, I'll test that again this afternoon. With them I had 2 markers with same script (at the time script was very very basic), but only one ever pushed out an NPC, I kinda figured because timerIDs are the same (On wiki it reads they are individual per script, but I just assumed that meant the one script and not individual to multi instances.)
  22. Has to be that randomint firing at the same time. But will randomfloat do the same thing? All thats in there is the globals for the script, xmarkerheading I duplicated to attach it to, and a quest for the startup message boxes. I'll upload the esp when i get home from work.
  23. Then that would explain a lot of things. The variables that I store to get the amount of npcs and types of npcs are randomint determined. Not sure what to say about the timers i seen doing the same (cancelling each other to favor only one). Timer idea is great but I still suspect I will see said bug :(
×
×
  • Create New...