Jump to content

Dielos

Supporter
  • Posts

    42
  • Joined

  • Last visited

Everything posted by Dielos

  1. For a short scene, I'm trying to get the player to play dead for a short while, but I'm failing miserably. I can't find any idle that works. I tried with idles, but those that seem to do what I want don't seem to work with the player. I also tried PushActorAway, and although it works, the player character stands up straight away even when controls disabled. I found in the player actor window, animations tab, a havok anim file called DeathPose2.hkt, which would be perfect for what I need, but I just can't figure out how to force it to play. Any idea how I could do this?
  2. I'm also having problems with these types of functions. I initially used FindAllReferencesWithTypeFromRef, but as it always returned "none", decided to change to FindClosestReferenceOfAnyTypeInListFromRef, as for me it's enough if it just finds the nearest. It still doesn't work though... This is how I'm calling it: Closest = Game.FindClosestReferenceOfAnyTypeInListFromRef(pSPETypesAvoidanceList, PositionMarker, 1500.0)My suspicion is that if it works for Reneer, then the function should plainly work and we are doing something wrong. Probably the types we are looking for? In my case I'm trying to find if there is any type of actor or creature nearby. In my case pSPETypesAvoidanceList points to a form list that contains types of most creatures and humanoids. Maybe I'm choosing the wrong types to detect? These are the contents of the FormList (Keywords): ActorTypeAnimal ActorTypeBug ActorTypeCreature ActorTypeDog ActorTypeFeralGhoul ActorTypeGhoul ActorTypeHuman etc... I'm moving the player to a random location nearby (PositionMarker), but cancels if Closest is not "none". It always returns "none" and I'm often moved right in the middle of a group of ghouls, which can get quite unpleasant. A distance of 1500 should still be within the loaded area, so I guess this shouldn't be the problem?
  3. Yesterday was a bad day... I also didn't read the description of the function too well. I think GetSafePosition is more oriented to find a safe position for a bigger object, like the landing spot for a vertibrid. MoveToNearestNavmeshLocation is probably better suited for actors, as they don't need that much space. In GetSafePosition you can define a radius, and I thought this would be useful for me, but it isn't, that radius is just for max distance, so it always finds the nearest. I need to find a random position inside a radius with a minimum and maximum distance from origin. For this I will have to find the position by math (hope google helps) and then probably use MoveToNearestNavmeshLocation from that position with help of a marker... By the way. Amazing mod Scavver!
  4. Doh! Mayor fail... Corrected the typo and works straight away, of course... Way too many hours in front of the PC! Thanks, viennacalling!
  5. Thanks for the answer. I tried with Player assigned to a variable as well and got the same errors. Might try using a marker to see if I get it working with it. I was aware of MoveToNearestNavmeshLocation, but it doesn't allow for a radius, so I expect that as the player is already in a navmeshed location, that it will probably just return that. Will test it nevertheless. Another option is to just find a location a distance away and try MoveToNearestNavmeshLocation from there. Will play around with these options...
  6. Thanks a lot. Very useful information. Didn't know this! With all the crashes this will reduce modding time by quite a bit then!
  7. Anybody know how the function GetSafePosition() works? I might be implementing it wrong, as I get that this function does not exist when compiling. I'm calling it from a quest script, could this be the issue? I'm trying to find a safe location not too far from the player and move him over there. I'm calling it like this: float[] safeLocationArray = Game.GetPlayer().GetSafeLocation(2048.0,50.0) I get the following errors when compiling: GetSafeLocation is not a function or does not exist type mismatch while assigning to a float[] (cast missing or types unrelated) Although the type mismatch error description sounds quite enlightening, I just don't get it. :huh:
  8. Thanks a lot for your dedicated help, Reneer! I have decided to circumvent this problem rewriting everything from scratch. I will create a controller object that runs the script and spawns everything from within. I shouldn't have this problem again through this. I just have to make sure that the controller object persists no matter what. It's a bit frustrating hitting problems like this, although most probably it's an error on my side.
  9. Well, there has to be certainly a problem with Self... Now I tried this: Boat01Obj.SetPosition(GetPositionX(), GetPositionY(), GetPositionZ()) Boat01Obj.SetAngle(GetAngleX(), GetAngleY(), GetAngleZ()) Boat01Obj.attachTo(Self) The object moves correctly to the new position, but it does not attach...
  10. Well, there is certainly something amiss here... You are right though and Self seems to work properly, but I'm doing something wrong anyway. I included these traces on the script to test: debug.trace("Empty Self is in: " + GetPositionX() + GetPositionY()) debug.trace("Self is in: " + Self.GetPositionX() + Self.GetPositionY()) debug.trace("HeadingMarker is in: " + HeadingMarker.GetPositionX() + HeadingMarker.GetPositionY()) debug.trace("Boat01Obj is in: " + Boat01Obj.GetPositionX() + Boat01Obj.GetPositionY()) This is what I got, so Self is being detected fine: [07/15/2016 - 04:42:37PM] Empty Self is in: 69658.73437543368.886719 [07/15/2016 - 04:42:37PM] Self is in: 69662.01562543370.992188 [07/15/2016 - 04:42:37PM] HeadingMarker is in: 69682.85156343382.910156 [07/15/2016 - 04:42:37PM] Boat01Obj is in: 68750.00000042800.000000You will see that there is a substantial difference in position between the HeadingMarker and Self to the Boat01Obj. The "ghost object" remains in it's original position and only the 3D mesh tags along. As soon as the original cell unloads, my boat unloads as well. That's why I need to update it's position manually. I still don't understand why MoveToNode doesn't work. I also made a test using PlaceAtNode, basically creating just more copies of the object, and that worked fine and they appeared in the expected position. The difference between MoveToNode and PlaceAtNode is basically that in the first I need Self, as I need to pass a parameter, while in the second I dont. I called them like this: Boat01Obj.moveToNode(Self, "FloatingPlatformHelper01") Boat01Obj = PlaceAtNode("FloatingPlatformHelper01", pAASLBoat01, 1, true, false, false, true) I also tested the same moveToNode but with myself (game.getplayer()), and I got moved to the center of the map along my boat. If there is any idea why this is failing...
  11. No, Self in this case should be the Objectreference, not the script.Good to know, although I'm at a complete loss then on why this isn't working. I guess then that I could use only "Self", and "Self as ObjectReference" is not needed? Does your object model / NIF have those nodes inside it? There are just a few variables here that need to be sussed out. The NIF has that node, it's the main one. I can use SetPosition as well, that works, but the object then jumps and it's quite jarring for the player. The single call of PlaceAtNode is much cleaner for an object that is moving. That said, I will make a couple of checks with the PlaceAtNode funtion to see if this might be indeed failing in some way.
  12. Boat01Obj is a ship attached to a PlatformHelper. It spawns and tags along with the PlatformHelper just fine. The object I'm trying to retrieve is the PlatformHelper, which is the object with this script attached. The TranslateToFunction is applied to the PlatformHelper, and the GetPosition calls are running as both the PlatformHelper and the ship move as intended. I have "debug.trace("Self is: " + Self as ObjectReference)" in the OnInit() event, and it returns the following: [07/15/2016 - 02:02:50PM] Self is: [AASLFloatActBoat01Script < (FF000F34)>] -- I understand this to be the script itself, right? PlaceAtNode could be failing indeed, but with the trace line there I have been blaming Self. The PlaceAtNode call actually sends my boat to Four Leaf Fishpacking Plant... Beats me why, as I'm nowhere near it nor is the PlatformHelper. But I do get from this that the call works, and it's just the Self failing. My guess is that if PlaceToNode has a "none" in the function, it might just be sending my boat to the center of the map.
  13. Sorry, thought the question was clear... I need the reference of the placed object, and I need to retrieve it from it's own script. Might be pretty simple, but I'm failing horribly. This is the script in question: Scriptname AASLFloatActBoat01Script extends ObjectReference STATIC Property pAASLXMarkerHeading Auto Activator Property pAASLBoat01 Auto ObjectReference Boat01Obj ObjectReference HeadingMarker float GameAngleZ float TrigAngleZ Event OnInit() CreateShip() Utility.Wait(15) debug.trace("Self is: " + Self as ObjectReference) TranslateStraigth() EndEvent Event OnTranslationAlmostComplete() UpdateGhostPositions() TranslateStraigth() ;debug.notification("Translation almost complete, updating translate function...") EndEvent ;------------------------ F U N C T I O N S ------------------------------------- Function CreateShip() Boat01Obj = PlaceAtNode("FloatingPlatformHelper01", pAASLBoat01, 1, true, false, false, true) HeadingMarker = PlaceAtMe(pAASLXMarkerHeading, 1) EndFunction Function TranslateStraigth() SetDestMarkerPos() TranslateToRef(HeadingMarker, 120) EndFunction Function SetDestMarkerPos() GameAngleZ = GetAngleZ() - 90 if ( GameAngleZ < 90 ) TrigAngleZ = 90 - GameAngleZ else TrigAngleZ = 450 - GameAngleZ endif Float posX = GetPositionX() + 1100 * Math.Cos(TrigAngleZ); Float posY = GetPositionY() + 1100 * Math.Sin(TrigAngleZ); Float posZ = GetPositionZ() + 1; Float angX = GetAngleX(); Float angY = GetAngleY(); Float angZ = GetAngleZ(); HeadingMarker.SetPosition(posX, posY, posZ) HeadingMarker.SetAngle(0, angY, angZ) EndFunction Function UpdateGhostPositions() Boat01Obj.moveToNode(Self as ObjectReference, "FloatingPlatformHelper01") EndFunction All works fine in this script, apart from the last line. In the function UpdateGhostPositions(), Self as ObjectReference returns "none", and Self alone returns the script itself. I need to catch the spawned object this script is attached to, not the base object. I might need to define a property for it? [EDIT]: Forgot to add that the object this script is attached to was spawned from another script with this line: PlatformHelperObj = pXMarkerPosBoat01.PlaceAtNode("MarkerX", pAASLFloatingPlatformHelper01, 1, true, false, false, false)
  14. Hello. Finding myself with a stupid problem that I'm not managing to understand... I have an object spawned through script. There is another script attached to the base object of this newly spawned reference. Everything works great in the newly placed object, but I just can't get the object reference of the placed object from within it's own script. It seems I'm missing to understand something... After two days trying, I found out that "Self" does not point to the objectreference, but to the script itself, so how would I get the objectreference this script is running from? I tried Self and Self as ObjectReference, but none work. Do I have to define a property for this, and how to link it to the object?
  15. It sure is an interesting suggestion and worth a try... I will try that, thanks. And yes, the object is working as a token. The other option I was thinking, but don't know if it would work, is to put all the NPC's I need inside a FormList, instead of giving them tokens, and loop that FormList looking for dead references. Don't know if this is too complicated though...
  16. viennacalling, I'm trying to check for an object in the killed NPC's inventory. If the NPC has the object, and was killed by the player, then the player gets an xp boost or something... luthienanarion, I tried that option, but still didn't work. It seems that iskiller doesn't really do anything in the dialogue conditions. I'm not sure, maybe iskiller gives only a result under the ondeath block and right at the moment of death. If this is the case, then it will probably never fire here, as I assume that the script runs, just after he has been killed. The death topic let's the killed NPC say something while dying, but for the engine, he might be dead already while he says his sentence. I don't know...
  17. Hello, I need to detect player kills and check the killed actor's inventory. I have read quite complicated ways of doing this, and I wanted to know if there is an easy and reliable way. At the moment I'm detecting the death of any NPC succesfully through an empty dialogue topic "Death" under the combat tab with empty conditions (runs on everybody). The script is set to run on "Result Script (Begin)" and fires every single time correctly. But this detects every death, it doesn't matter from what they died. If I try something like if iskiller Player ;Do something here endifthe code in the "if" doesn't run. So my guess is that the iskiller command only works correctly on the exact moment the NPC dies? I also tried setting iskiller as a condition for the death topic to run, with Target Subject, Function Name iskiller, Function Info PlayerRef, Comp ==, and Value 1. The topic never fires... Any easy way of doing this or a different method or command that can work in the dialogue other than iskiller? Thanks in advance for any help...
×
×
  • Create New...