Placing objects on the ground with a shot arrow

Post » Thu Jun 21, 2012 9:46 am

Hey all.

I'm currently working on a mod that adds several different types of arrows to the game. One particular arrow I want to add is an arrow that creates an oil slick at the area that it hits. I was able to figure out how to get it to place the oil slick on impact by creating an "explosion" and telling it to place the "BFXTrapOilPoolPermanent01". It actually works, but not perfectly. It seems as though the oil puddle is placed parallel to the arrow, so depending on which angle the arrow lands at, the oil pool lands at the same angle meaning it doesn't lie flat on the floor.

Another issue is that if the arrow is shot at a wall, the oil slick will be placed exactly where the arrow hits, meaning it'll float several feet above the ground. I would post pictures of the problem I'm having but the forum doesn't allow me to post links.

So basically my issue is trying to figure out if there's some way to get the oil slick to spawn directly on the nearest ground plane to where the arrow hits. I'm not sure if there's an easy way to do it or if it's possible at all. Other than that the oil puddle behaves the way it should, igniting when hit with a fire spell and everything. It's just the placement that's giving me trouble. I simply want it to lie flat on the ground where the arrow hits.

Also, another related question; is there any way to make it so that if an actor walks onto the oil puddle they slip and fall? I wanted to make this oil arrow a way for the player to create a slipping trap for NPCs like the oil flasks in Thief: Deadly Shadows. Is there some sort of slipping effect in the game? Or some way to make it so the NPC ragdolls to the ground when they step onto the oil puddle?

Thanks.
User avatar
Jessie Rae Brouillette
 
Posts: 3469
Joined: Mon Dec 11, 2006 9:50 am

Post » Thu Jun 21, 2012 10:37 am

have you tried checking the Always use world orientation checkbox?

this should solve your ground placement problem. i had a "ninja vanish" spell that would create a dust cloud before turning invisible, and the dust cloud would always appear aligned to the ground after that checkbox was checked.
User avatar
Matthew Warren
 
Posts: 3463
Joined: Fri Oct 19, 2007 11:37 pm

Post » Thu Jun 21, 2012 8:20 pm

Hey, that seems to have fixed the orientation problem! The oil puddle is now always placed straight horizontal. That solves one of the issues I was having. The only problem left is that the oil puddle is still placed floating in the air if the arrow is shot into a wall above the ground. I'm not sure if there's some way to make it so that the oil puddle is dropped to the ground when the arrow hits a wall or something to that effect. If I can solve this problem then I should be good to go. Then it's just a matter of figuring out how to make actors slip when they walk over the puddle.

Thanks for your help.
User avatar
flora
 
Posts: 3479
Joined: Fri Jun 23, 2006 1:48 am

Post » Thu Jun 21, 2012 10:05 am

That problem seems quite tricky. You could place an invisible havoked object instead first and after some time, maybe a second or so (using the wait function), place the pudle in the possition ocupied by the object, now that it has drop to the ground (don't forget to delete it now that you didn't need it, to avoid cluttering).
User avatar
naana
 
Posts: 3362
Joined: Fri Dec 08, 2006 2:00 pm

Post » Thu Jun 21, 2012 9:50 pm

You could have the arrow place an invisible activator that points itself straight down and casts a "Target Location" spell that has the "Snap To Navmesh" option checked, and have the spell be what actually places the oil slick... Rube Goldberg Creation Kit strikes again! Amgepo's suggestion is less unruly. Otherwise you can just live with the player having to be careful how he aims the oil slick arrow;

As for the slick itself... check out some of the Trap scripts for examples of how to make an object do stuff to a target when touched, or you can have the slick activator check for NPC within a certain area every 0.1 seconds and apply the effect to them. To make NPCs slip on it you could do a PushActorAway with a value of 0. This drops them on flat on their back without applying any actual force or damage (and looks comical, too). Or, you could get the NPC's position on each trigger, calculate their vector and combine the PushActorAway with a TranslateTo function to make it look like they're slipping and skating across it.
User avatar
jessica Villacis
 
Posts: 3385
Joined: Tue Jan 23, 2007 2:03 pm

Post » Thu Jun 21, 2012 10:05 pm

Hmm... interesting ideas. I'm a total scripting novice and have very little knowledge of the commands I can use. Is there any object in the game that I can look to for reference on how to do what you're suggesting? The invisible object dropping to the ground and spawning the oil pool idea might work, but I'm not sure how I would script that to occur.



EDIT: Alright I was able to figure out how to make an object spawn the oil pool after a second and then disable itself. The problem, however, is that when the object drops to the ground it rolls around and causes the oil slick to spawn at whatever angle it was at when the script spawned it. So now I'm back to the previous problem I was having. Is there a way to have the oil puddle spawned through the script use the world orientation like before?
User avatar
..xX Vin Xx..
 
Posts: 3531
Joined: Sun Jun 18, 2006 6:33 pm

Post » Thu Jun 21, 2012 3:06 pm

Try with an object that with a flat surface that won't roll ( a shield maybe? ). If you only disable the object it won't cease existing, you must delete it also.
User avatar
ijohnnny
 
Posts: 3412
Joined: Sun Oct 22, 2006 12:15 am

Post » Thu Jun 21, 2012 10:24 am

Alright, I was able to get it working properly. The invisible dummy object is spawned, drops to the ground, spawns an oil pool, and then deletes itself. The oil pool is always facing horizontally when the object drops, even if the object is laying on its side. So it pretty much works the way it should now. There's two problems I'm encountering now, however. The first is that since the dummy object is still an object, it makes noises when it hits the ground and stuff. Is there a way to stop it from making any noises when it hits surfaces?

The other problem I'm encountering is that if the player is quick enough, he can actually pick up the dummy object before it deletes itself. Since it deletes itself it's not added to the player's inventory anyway, but there must be some way to stop the player from being able to pick it up entirely. I tried to make it a moveable static but it doesn't look like scripts can be applied to those, so I'm guessing it needs to be an actual item but there doesn't seem to be any way to make the item unplayable.
User avatar
Antonio Gigliotta
 
Posts: 3439
Joined: Fri Jul 06, 2007 1:39 pm

Post » Thu Jun 21, 2012 10:14 pm

not sure about the collision sound, but you can get rid of the ability to interact with the item by deleting its visible name in the base object editor
User avatar
Horror- Puppe
 
Posts: 3376
Joined: Fri Apr 13, 2007 11:09 am

Post » Thu Jun 21, 2012 11:39 pm

Alright I've got the oil pool spawning to work relatively well. It's not perfect, and it's still a bit glitchy. I can't help but feel like there's probably a better way to do what I want to do, but I have no idea. I'm curious if there's some way to replicate the rune spells to place the oil slick on the ground properly, but I'm not sure if such an effect can be attached to an arrow.

The problem I'm having now is trying to figure out how to get the slipping effect to work. I'm completely unfamiliar with Papyrus and my efforts have been unsuccessful. I tried to follow Verteiron's advice and use PushActorAway but I'm not sure of the proper way to use that command. I'm going to do some research and try to learn a bit more about Papyrus to see if I can figure it out.
User avatar
Setal Vara
 
Posts: 3390
Joined: Thu Nov 16, 2006 1:24 pm

Post » Thu Jun 21, 2012 7:59 pm

Sorry for bumping this topic but I'm currently messing around with another idea I had to try and make this work. I took a look at some of the rune spells that are in the game and it seems like that would probably be the best way to do what I want to do with these oil puddles. Since the runes use decals they conform to whatever surface they're placed on. It'd be possible, then, for me to replicate these rune spells and make my own oil puddle decal to replace the rune decal and then modify the rune's effects to replace the explosion with the slipping effect. What I'm trying to figure out now is whether it's possible for an arrow to place a rune when it hits a surface. It doesn't seem like the runes function the same way as other objects so they can't simply be placed by an explosion as far as I can see. I might need to do this through some sort of script. Anyone know if this is possible?
User avatar
Maria Garcia
 
Posts: 3358
Joined: Sat Jul 01, 2006 6:59 am

Post » Thu Jun 21, 2012 7:10 pm

I've had a BUNCH of experience in 'ground-detection' in my recent modding. To eliminate the havok-bounce sounds, try using an actor instead. An added bonus is that they seem to spawn at ground level already (though I could be mistaken). Before I found a better way to detect collision, I used an invisible chicken (the most simple actor I could find... doesn't even have a skeleton).

So you would spawn an invisi-chicken at your arrow, perhaps do a wait(x) if need be, spawn your oil slick at the chicken's position... then delete the chicken. Alternatively, you could script the oil slick to setAngle to 0x and 0y.

I actually use the suggested 'script a spell to cast downward' technique for causing an explosion when my Gokstad ship beaches, but it took a little tweaking to get it working as expected.. even then it kinda misfires an the rare occasion (though the most recent version I think I ironed that out). My point is that you may be able to get THAT method to do your bidding. I wound up having to script a ref to move a couple hundred gu underneath my ground detector, then move the actual detector UP (to account for variations in the terrain, and/or position at the time of detection), THEN cast the spell at the 'underground' target.

As for runes... I dunno but I'd like to find out. I tried for half a second, but quickly found that runes are NOT as simple as I had hoped... and bailed on the idea for something else.
User avatar
Rex Help
 
Posts: 3380
Joined: Mon Jun 18, 2007 6:52 pm

Post » Thu Jun 21, 2012 8:12 pm

Yeah that's the problem I'm running into right now. It almost appears as though the rune decal is totally separate from the actual trigger/explosion for the runes. There doesn't seem to be a reliable way to "place" one at a given location since there isn't an actual rune object, and the arrows seem to be extremely finicky when I try messing with them to spawn the runes. I've tried replicating the rune projectiles and applying those properties to my arrows but that just ends up breaking the arrows altogether. It seems like the only way this might work is if I can find out how to script it so that the arrow or dummy object casts a rune spell at the location it hits. Are there any existing scripts in the game I can reference to find out how to do that?

Clever idea with the invisible actor though. If the rune idea doesn't work out I'll probably use that in place of my current invisible havok object setup. That's already working relatively well, but not as well as the rune solution would work if I could find a reliable way to pull it off.
User avatar
Chloe Yarnall
 
Posts: 3461
Joined: Sun Oct 08, 2006 3:26 am


Return to V - Skyrim