-
Posts
63 -
Joined
-
Last visited
Everything posted by SameOldBard
-
Safe height to spawn around the Outpost
SameOldBard replied to SameOldBard's topic in Starfield's Discussion
In the end, it did work. But even with a high fall height it still had a success rate of 76%. I tried it a 1000 times to get a proper valid percentage. I am not interely sure why that is so. I was at 1 side of the Outpost and had them being dropped at random places around the Outpost, basically at the border area. I also set their HP to 1 before dropping. Maybe those that did not die where at an area that maybe was not fully loaded or something? Does anyone know? Anyway, with a couple of retries I could have a 100% success rate, so, it worked for my mod needs. I should have replied before, but I've been playtesting it while working on my other mod which I'm planning to release together with the one using this system. Here's a snippet with how I have it set up here. Maybe someone can spot why I have the 24% failure to die rate (Sorry, I don't follow Bethesda's scripting coding pattern): ScriptName SomeScript ; Using the player as the spawner Actor Property PlayerRef Auto Const mandatory ; A minibot, specifically: 0x000C1F4F Form Property MarkerRef Auto Const mandatory ; Field set by the OnDeath event Form _deadMarker ; Amount of time we want to wait for the Marker to die int _timesToTryAgain = 15 Actor function SpawnActor() ; I am not stashing the Beacon as the player may want to remove it while this script is running. So we can have a way to fail if that happens ObjectReference workshop = GetWorkshop() if(workshop == NONE) Trace("SpawnActor: Could not get a Workshop") return endIf float buildRadius = workshop.GetValue(OutpostBuildAreaRadius) ; We ask for a Marker to be placed at the same Height as the Outpost Radius, should be 150 by default Actor marker = GetSpawnMarker(buildRadius) ; Waits for a few seconds to allow it to bounce Utility.Wait(10) ; Creates an actor at the Marker position disabled so we don't see it beside the player Actor actorSpawned = PlayerRef.PlaceActorAtMe(actorToSpawn as ActorBase, 4, None, true, true, false, NONE, false) ; Moves to the Marker position and enables it actorSpawned.SetPosition(marker.GetPositionX(), marker.GetPositionY(), marker.GetPositionZ()) actorSpawned.Enable(true) ; Get's rid of the Marker marker.DisableNoWait(false) marker.Delete() return actorSpawned endFunction Actor function GetSpawnMarker(float height) int timesAwaited = 0 int retries = 0 ; Tries to get a marker right away Actor spawnMarker = GetDeadDrop(height) ; Repeats until we have a marker dying while(_deadMarker != spawnMarker) ; Checking every second Utility.Wait(1) timesAwaited += 1 ; If we waited for more than the maximum amount of time (15 seconds) if(timesAwaited >= _timesToTryAgain) timesAwaited = 0 ; Clear the data of the marker that failed to die and delete it ClearRegisteredEvents(spawnMarker) spawnMarker.DisableNoWait(false) spawnMarker.Delete() ; Drop a new marker and retry spawnMarker = GetDeadDrop(height) retries += 1 endIf endWhile ; We got a marker, let's clean up and return the object _deadMarker = NONE ClearRegisteredEvents(spawnMarker) return spawnMarker endFunction Actor function GetDeadDrop(float height) ObjectReference workshop = GetWorkshop() if(workshop == NONE) Trace("SpawnActor: Could not get a Workshop") return endIf float xPos = workshop.GetPositionX() float yPos = workshop.GetPositionY() float zPos = workshop.GetPositionZ() float buildRadius = workshop.GetValue(OutpostBuildAreaRadius) ; Let's get a random point in the circle of the outpost border float angle = Utility.RandomFloat(0.0, 359.999) float newX = xPos + (buildRadius * Math.cos(angle)) float newY = yPos + (buildRadius * Math.sin(angle)) float newZ = zPos + height ; Create the marker, wait for it to load and set it's alpha to 0. Not exactly transparent but good enough Actor spawnMarker = PlayerRef.PlaceActorAtMe(MarkerRef as ActorBase, 0, workshop.GetCurrentLocation(), true, false, false, NONE, false) spawnMarker.WaitFor3DLoad() spawnMarker.SetAlpha(0, False) if(!spawnMarker.Is3DLoaded()) Trace("3D is not loaded!") endIf ; Get ready for it's death RegisterForRemoteEvent(spawnMarker, "OnDeath") ; Set's health to 1 and drop it from the wanted position! spawnMarker.SetValue(Game.GetHealthAV(), 1) spawnMarker.SetPosition(newX, newY, newZ) ; Waiting again, in case there is some loading to be done at the other side of the map. spawnMarker.WaitFor3DLoad() return spawnMarker endFunction function ClearRegisteredEvents(Actor actorRef) ; Clean up! UnregisterForRemoteEvent(actorRef, "OnDeath") endFunction event Actor.OnDeath(Actor deadActor, Actor akKiller) UnregisterForRemoteEvent(deadActor, "OnDeath") ObjectReference workshop = GetWorkshop() if(workshop == NONE) Trace("OnDeath: Could not get a Workshop") return endIf if(deadActor.HasKeyword(MarkerKeyword)) ; Yay! We got a dead one! _deadMarker = deadActor return endIf endEvent Cheers, OldBard -
Safe height to spawn around the Outpost
SameOldBard replied to SameOldBard's topic in Starfield's Discussion
What if the marker is not dead when dropped and I register to it's OnDeath event before moving it to a high position? I'm guessing the position it will have by the time I get the event will be precise enough hehe. So, the solution is a bit dead rat hehehe -
Woo. Thanks. That certainly will do.
-
Apply shader effect to a static ObjectReference
SameOldBard replied to SameOldBard's topic in Starfield's Discussion
Hmm, I tried that, but nothing happened. Maybe because it is a rock? It does not fade when disable, for example. -
Safe height to spawn around the Outpost
SameOldBard replied to SameOldBard's topic in Starfield's Discussion
It seems dropping a Marker could be the only option at this moment. I do have one, which is not a dead rat. And how would I detect that it reached the ground? By checking the height as it bounces? hehe -
Safe height to spawn around the Outpost
SameOldBard replied to SameOldBard's topic in Starfield's Discussion
Indeed. That's not a solution. Any suggestions? -
Last noob question of the day, I promise. How can I figure out the level of a perk an Actor has through code? Thanks, SameOldBard
-
Apply shader effect to a static ObjectReference
SameOldBard posted a topic in Starfield's Discussion
Hi, I want to apply a shader effect to a rock. What is the proper way of doing it? I want to have it playing something of a desintegration shader and although I could use the one I did by calling AddSpell on an Actor, but I am not sure how to have the same working on a non Actor. What am I missing? Thanks, OldBard -
Hello, I am trying to spawn an Actor outside the Outpost build zone above ground, and I tried using MoveToNearestNavmeshLocation but I only got errors. I guess there are none in the planet area. doh Anyway, how can I find that? I've been checking on the DefaultGroupSpawnQuestScript but the way it spawns the enemies is a bit odd. Thanks, SameOldBard
-
Hi, I am having a weird situation happening when I set a forced reference to an alias. I am getting some references for a quest using a: Game.GetFormFromFile(objective.FormID, RequiredDLC) as ObjectReference Which is properly filling the form. I then set the objectReference to an Alias by doing a ForceRefTo.The alias is properly filled and I get a quest objective and a marker in the map. If the target is in the map, it properly shows the correct location and all works fine.If I do it in an interior cell it seems to work, with a marker pointing to the closest door. The issue comes when I enter the interior cell. Sometimes it shows the proper marker, sometimes it doesn't. And even then it populates the local map with pointers which should only shown on the exterior map, as it points to the objects outside. Any idea about what is going on and what am I doing wrong? Why would it work sometimes but not always? Thanks,SameOldBard
-
Game.GetFormFromFile with variable
SameOldBard replied to SameOldBard's topic in Fallout 4's Creation Kit and Modders
Sorry for taking this long to reply, real life demanded some attention. I had something similar to that already working, but again, it was hard coded. What I managed to get working was to have the int var in my struct and store the value in there as decimal. So, basically I get the 6 digits hex (last 6), convert them to decimal and stores in my struct at the Creation Kit. It would be great if it was possible to have some editor scripts in the Creation Kit as we have on Unity3d, but that's something for a different discussion. Anyway, thanks for the answer @Carreau as it put me in the right track to find the solution I needed. Cheers -
Hi! I got another basic (noob) question to which I could not find a proper answer in the forums. I have to get some forms from a DLC and to do that I would do something like: target.FormID = Game.GetFormFromFile(0x0001F0E6, RequiredDLC) as Form Which works quite well. The thing is, this is hard coded, specific per object and prone to error. I would prefer to do something like: target.FormID = Game.GetFormFromFile(target.refId, RequiredDLC) as Form Where refId is (I guess), an int. If we go for the 0x08DIGITS format we can pass hexa values without issue. But not with ints. I tried converting the value to decimal and it did not work properly. I also considered using a string which would have the "0x0001F0E6" value. But I don't think it would work. So, how is the proper way to store this at editor time so I can parse it at runtime?? Thanks, SameOldBard Edit. Fixed weird format
-
Start quest silently
SameOldBard replied to SameOldBard's topic in Fallout 4's Creation Kit and Modders
Hmm, interesting. I will try it tonight with the preparations for the next update. Thanks! -
Weird situation with an array
SameOldBard replied to SameOldBard's topic in Fallout 4's Creation Kit and Modders
Well, I can confirm, it is like that. I wish I have known that before. I did the test and a different one, to have a non const to do the same thing and it seems that it is like that indeed. Thanks for info. Lot's of learning with this mod. Cheers, SameOldBard -
Hello there, I am having a very weird situation happening to me. I have a Quest[] which is exposed to the editor, so it is a property auto const. I can add things through the editor and everything is ok. But since I am working on an update, I am adding new items to that array through code. Not much, I am still well under the 128 limit. So I do my Add calls and everything is fine and nice. I can access the new data through the array normally. I do a quick save and a quick load and the items I added are gone. Is it because it is a const? If that is the issue, I find it quite weird. What I expect from a const array is that the object itself cannot be changed, but that data inside can. That is the behaviour I have on c#. Can anyone confirm that his is how the consts works here? Thanks, SameOldBard
-
Looking for a suggestion on a mod feature
SameOldBard replied to SameOldBard's topic in Fallout 4's Discussion
That's kinda what I did SKK50. I have 2 objectives. I think it is a bit weird to point to Boston Airport, but that's how I did for one item in my first version. The issue becomes really bad when the Institute is involved. Where should I put the first one? To the Cambridge area? To the currently incompleted main quest? To the hidden entrance to the institute? I think that one way or another it will be a bit weird for the player. But I can't find a good option. Do you have a good suggestion for the Institute marker? On my previous version, as there is a magazine in the institute, it is currently pointing to a bush that is kinda close to the Institute. =/ -
So, I am working on an update on my mod, which is a mod which helps the players to get unique items, PAs, magazines, bobbleheads and etc. (If you are curious the link for the mod is at my signature) I am currently adding unique weapons to this update. The issue is that some weapons can be found at the Prydwen. The issue is that I cannot create a marker there, as it would be in the middle of the sky and a spoiler. So, what I can do is to only show the marker and objective once the player has completed a specific quest. For example. As soon as Reunions is completed and the prydwen is at the commonwealth, I can enable the objectives to buy things in there. So. The issues I have: If I don't show anything to the player before the Prydwen arrives, he might not know that there is a weapon missing. But if I am to show him something, I need to place a marker in the map. It would be quite weird to have a marker at the airport pointing to nothing. For the Institute it is a bit worse. Where could I place it? What I can do is to write all about it at the mod's page. But the player is most likely going to ignore it. So this is where the suggestion might be helpful. Anyone got any? I thought about creating a board in the middle of nowhere with "Go to the Institute!", or "Complete Reunions". But that would be a bit absurd. Thanks for any suggestion which might come. SameOldBard
-
What can I change when updating my mod?
SameOldBard replied to SameOldBard's topic in Fallout 4's Creation Kit and Modders
Well... that certainly complicates things for me. My idea is to update my mod with specific parts as to avoid taking too long to come up with eveything until I would reach 1.0. That would be when the mod would be feature complete. I am testing now the first update after adding the needed data and a few minor features, but for it to work properly I need to add a float field to my target Struct... if it can be a problem for it, it might be for the rest of the data of the future updates as well. I just did not want to have to consider all possible issues now for all said modules as it will take me way more time. =/ -
What can I change when updating my mod?
SameOldBard replied to SameOldBard's topic in Fallout 4's Creation Kit and Modders
Unless another mod used " gold" before you hehe. Cool, I will read the link -
What can I change when updating my mod?
SameOldBard replied to SameOldBard's topic in Fallout 4's Creation Kit and Modders
Again you have lot's of very helpful information. Thanks SKK50. Regarding the very specific case of the structs. You think there is risk if I add a field, let's say a float, to a Struct while updating the mod? Of course I will test it a lot. But have you done that in the past and had issues? -
What can I change when updating my mod?
SameOldBard replied to SameOldBard's topic in Fallout 4's Creation Kit and Modders
I don't know, if you can extend functions parameters on runtime. Ok, I will avoid doing it anyway. Though I might try and make some tests with it. Hmm. Would that cause some case issues? That's kinda, hmm curious. Anyway, the strings thing were just examples. I am just worried that I can modify existing function to improve performance, fix issues and add new situations as the mod grows. -
What can I change when updating my mod?
SameOldBard replied to SameOldBard's topic in Fallout 4's Creation Kit and Modders
Also, let's say I have a function like: Function ConcatStrings(string a, string b) And I add a param string C. Would it cause issues? -
What can I change when updating my mod?
SameOldBard replied to SameOldBard's topic in Fallout 4's Creation Kit and Modders
Ok. That makes sense. So changing logic which is not based on stored that works. How about adding fields to the model? Is it ok to add a field to a custom struct? And thanks for the answer so far! -
What can I change when updating my mod?
SameOldBard replied to SameOldBard's topic in Fallout 4's Creation Kit and Modders
So, If I have a function which prints "ABC" at version 1.0. and I change it so it prints "DEF" at 1.1, it would still print "ABC" or what would happen? -
So, I am working on my mod first update. What can I change on it to make it still compatible with the previous installed version? I am testing it locally and etc. But I would like to know what I can and can't do. Can I change a function parameters? Or do I need to keep the same function signature? I guess I can change what I am doing inside a function and that I should not change event's callbacks. Can I add new fields to my structs? What else I must not do? My mod makes no changes to cells or world data. It only adds new forms, mostly quests, globals and terminals. Thanks a lot! SameOldBard