Jump to content

Ref Walking Issue - Need Script Guru


lorenzo19

Recommended Posts

Ran into another problem with the ref walker. Its not actually the ref walker this time. The walker found a couple of nuka colas in the potomac. So one of my team went out to get them. She got one but got hung trying to get the other one. Turns out there is a whole island in the potomac that is not navmeshed (potomacmirelurknest02). The second bottle was close enough to the island that she couldn't get to it. I could navmesh the island or move the colas further away from the island. I hate navmeshing though. (moved the bottles a little bit into a navmeshed section. fix it. she dont get hung now)

 

We have the same problem with the teleporting. I just tried to drop a follower on a slight incline and she fell through the ground. I raised the z axis displacement 10 units and that fixed it. But still, I drop them 64 units in front of me and there a chance they might get dropped through a wall or rock if I'm standing a bit too close.
I could drop them right on me, and fix it, but that gets a little strange looking sometimes (due to the automatic collision) and not very realistic.

 

Your hat thingy must be getting behind or under the geometry. If it is just close to a wall, the collision engine should bounce you back into nav space. I seem to recall seeing some path finding functions someplace. Can't find them now. Maybe that was in the navmesh testing part? A path finding test could work to see if the hat is in nav space.

 

Have you tried making the hat bigger. At least as big as an actor, maybe twice as big. That way the center of the hat will be well into nav space while the enlarged boundary of the hat will cause a better collision to bounce it back into nav space. I might need to do something like that to fix my problem.

 

I know you are not actually shooting the hat (unless you have it configured as ammo, lol) . I'm not actually carrying my team either. You are spawning the hat at the point of the explosion. Instead of using the point of an explosion, i calculate a point in front of me. You could configure the hat as ammo. The Rock-it Launcher shoots teddy bears. hehe. Have you tried something like that? If you shoot a teddy bear at the ceiling it bounces off, not cling to it like an explosion will.

 

I'm going to play around with GetLOS too. If I can see it then it not behind geometry. that wont be a 100% fix for you though. Projectiles travel in a parabolic curve (I assume in the game too) so the hat might be in nav space but behind something so you cant see it. Making the hat bigger could help with that, maybe. The game probably calculates LOS from the center of the object. But still, if the hat is bigger, its center will be higher off the ground. Also switching to 3rd person, for a couple seconds will give you a better LOS, cause GetLOS uses the camera position to calculate LOS.

Edited by lorenzo19
Link to comment
Share on other sites

I think I got a solution to our little problem. I tested it and works great for me. I created a token 'aaTeleportToken', armor. Set the world model to be a bottle cap. I have one script that places the actor a bit in front of me. But I changed it to place this token first, at the desired teleport position, and then check the result before placing the actor. I don't know how to post script all fancy, like you do, sorry.

 

SCN aaTeleportTokenScript

int iDepth
ref rSelf
int bLOS
float fTimer

;actor carry token script (OnDrop) places this token then waits for a positive result
;before actually moving actor to prevent actor being dropped inside the geometry
;I suppose I could use the actor carry token to do this, but this script is mostly just a proof of concept


BEGIN OnLoad

SetValue aaTeleportToken 0 ;initialize Value - use this to return a result - 0 is pending condition - 1 in LOS - 2 not in LOS - 3 is error

if IsInInterior
Set iDepth to 0
else
Set iDepth to 2
endif

Set rSelf to Pencil01
Set rSelf to GetFirstRef 24 iDepth 0 ;24 armor
Label 1
if rSelf
if rSelf.GBO != aaTeleportToken
Set rSelf to Pencil01
Set rSelf to GetNextRef
Goto 1
else
Set bLOS to PlayerREF.GetLOS rSelf
if bLOS
SetValue aaTeleportToken 1
else
SetValue aaTeleportToken 2
endif
endif
else
SetValue aaTeleportToken 3 ;probably a script error
endif

Disable ;i think this needs to be after GetLOS. It works before GetLOS but I think it might intermittently give a false result

Set fTimer to GetSecondsPassed
Set fTimer to 1.0 ;the timer is to give the other script a bit of time to check the result - otherwise it not needed.

END OnLoad

BEGIN GameMode

Set fTimer to fTimer - GetSecondsPassed
if fTimer <= 0.0
SetValue aaTeleportToken 0 ;reset result for next time
MarkForDelete
endif

END GameMode

 

I might change it to use a persistent reference token. I think that might simplify it a bit for my purposes. You might want to wait a sec or two for your hat to hit the ground before doing the LOS test. (nix that. my token hovers in the air.) Or use a larger world model. IDK. I'm going to tweak my script a bit so it nudges the teleporttoken up a little then rechecking LOS, once or twice, before giving up. Like I said before you might shoot your hat behind something, like a rubble pile, and still be in a valid place and fail LOS. You could display a message or play a fail sound if LOS fails. Then they just shoot again. At least they don't end up inside a bulkhead. Reminds me of a Star Trek episode. hehe.

Edited by lorenzo19
Link to comment
Share on other sites

Figured out why I was intermittently getting a false negative.

 

1) This would affect your gun. I had to do a PlaceAtMe to spawn the token and a MoveTo to position it correctly. Well the game ignored the MoveTo and calculated LOS from the PlaceMe position. If I wasn't looking almost straight down I would get a negative. I changed it so the MoveTo is in the next frame after PlaceAtMe. Changed the token script to account for the new timing. Game is calculating LOS from the MoveTo position now.

 

2) Probably not an issue for you. I am placing the token pretty close to the player and low to the ground. So again, if I am not looking down I get a false negative. That was easy to fix. I just make look down when the routine runs.

 

It working pretty solid now. I still going to tweak it a bit so the routine bumps the Z up a few times to try and get a positive. Just in case I want to drop her on a car or something.

 

Got another problem with my ref walker. This time its a path finding problem. The game is not rock solid in it's path finding routines. Cherry was trying to get a cola on the edge of a pier. Even though there was navmesh on the pier, she went down into the water and tried to get the cola. She stood right next to it but it was too high for her to reach.

 

Trying to find arbitrary items is fraught with little problems. I'm probably going to have to put in a fail safe timer so they don't get hung up on something they cant get to.

Edited by lorenzo19
Link to comment
Share on other sites

"going to have to put in a fail safe timer so they don't get hung up on something they cant get to."

 

This is a good idea. You are always going to run into little idiosyncrasies with the game.

 

When I was working on my teleport gun, I had thought that giving the hat marker an exceptionally large collision frame might help to consistently place it in valid world space. Never being good with modeling programs, like Blender, I never did this. I am not likely to ever do it either as I have moved on from Fallout and am currently modding Skyrim.

 

There is a setting somewhere that controls path finding. A larger number (nodes?) takes longer to process but also lets the game use larger areas for calculating the best path. I think it was accessible from the launcher - though I can't verify this as I can't seem to locate my original disc(s). I've installed FOMM and the GFWL bypass so I don't ever need the CD to play. But IIRC somewhere around where you configure your video card settings there is also a path node setting.

 

Oh yeah, one last thing...

 

I am pretty sure that LOS is calculated between NIF origins. The thing is, the 'center' of a NIF varies from NIF to NIF. It is not always where you would think it should be (like in the middle or on the bottom, etc...) as it is arbitrarily defined by the NIF model designer.

Edited by pkleiss
Link to comment
Share on other sites

You don't need blender. Just use a bath tub instead of a hat. lol. But, you probably don't need that. I'm just using a bottle cap nif and its working fine for me.

 

I tweaked it so the test position is 15 units farther than the final position. I found that in certain situations the actor would be partially inside a boulder. That fixed it. I also added some script to bump the Z offset from 0 to 200, in 10 unit increments. I can stand at the base of a cliff now and throw them on top. hehe. That was unrealistic so i knocked down the max to about 140. I might get fancy and calculate the max with a formula that includes the player's strength and the actors weight + inventory. What's really funny is throwing them off of cliffs. hehe. I got to fix that so if they fall too far they get hurt or killed. Someone is going to do that for kicks, and they got a surprise coming.

Edited by lorenzo19
Link to comment
Share on other sites

Exactly what criteria are you using to determine that the teleport location is within valid world space before you use placeatme? Is it strictly LOS - meaning that if LOS returns true, by definition the token is in valid world space?

 

 

Why not make a video and post to youtube!

Link to comment
Share on other sites

I'm not using placeatme. the optional paramaters for it don't seem to work. And i don't need to spawn a token cause I already carrying a token and drop it. That triggers all the rest of the script and the script just moves that token to the various test positions, using moveto with optional displacement parameters. For you, you would need placeatme, then use the set functions to test for a valid position. moveto might work too IDK, you have to experiment with it.

 

But yeah I only using GetLOS to test for a valid position. GetLOS has a lot of limitations but when used with the player it seems to be rock solid. hehe. pun. The only tricky part is that after moveto you have to wait a frame before doing GetLOS.

 

What video should I do? Throwing them off a cliff. lol.

Edited by lorenzo19
Link to comment
Share on other sites

Discovered another quirk with ref walking.

 

It finds items in containers but wont find items carried by a dead actor (or a live one), even if the taken flag is set and ownership is ignored. The Find package will find items carried by dead actors.

 

I want to find everything. So I'm going to have to do a multi level search. Ref walk actors, then if they dead, examine their inventory. Be a pain to duplicate the search for inv items then dead actors carrying inv items. I might try to do it all in one ref walk.

Link to comment
Share on other sites

I was thinking that wasn't a quirk, but maybe it is. After all, what is a dead body if not a container? I know some people used to load up a corpse with loot then carry the body back home so as not to be encumbered themselves - though I always found that to be a bit more work that it was worth.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...