PushActorAway Question...

Post » Sun Nov 28, 2010 10:16 am

I'm trying to make a script that lets the player intentionally throw themselves onto the ground, and PushActorAway seems to be pretty much the only way of accomplishing this. The only problem though, is that this limits the player to collapsing on themselves, instead of say getting propelled forward as they would if they suddenly hit the dirt while sprinting. Now, I want to accomplish this by having the PushActorAway act based on a reference that would always be either directly behind, in front of, or on a certain side of the player. Anyone know of a way of accomplishing this?

I have a feeling I'll have to create Persistent Reference X Marker's and use some combination of GetPos, SetPos, and trig functions (sad face), to get it to work, but I honestly have no idea where to start.
User avatar
Tom
 
Posts: 3463
Joined: Sun Aug 05, 2007 7:39 pm

Post » Sun Nov 28, 2010 7:59 pm

If your pushing the player from behind this seems fairly straight forward, as you can use GetPos to determine where you want to place the phantom NPC. Then MoveTo the NPC into position behind the player, and have it perform the PushActorAway, then vanish the NPC. I don't think you need an XMarker for this, nor would want one as you can set this up to take place anywhere (as the GetPos would work relative to the player position at the time).

Perhaps someone has a few cycles to script this up for you, but if you play around with a really simple script at first, you might just have fun with it. ;)

Miax
User avatar
Mariana
 
Posts: 3426
Joined: Mon Jun 12, 2006 9:39 pm

Post » Sun Nov 28, 2010 9:37 pm

Alright, one thing though, how do I change the returned value from the GetPos on the player to make it a position behind the player?

EDIT: Another thing, how do you get the phantom NPC to be...well...a phantom?

EDIT: Another problem, I'm don't know how to call my phantom NPC, as in, if I want to use MoveTo, how do I apply it to the NPC given that he's in a holding cell, and the player could be in any number of cells....

So far what I have:
scn aaaBRUTEDiveScriptref mySelfint counterfloat playerPosXfloat playerPosYfloat playerPosZBegin GameMode	set mySelf to player	set playerPosX to player.GetPos x	set playerPosY to player.GetPos y	set playerPosZ to player.GetPos z	if IsKeyPressed 14 == 1 && counter == 0	player.PushActorAway mySelf 1	set counter to 20	endif	if counter > 0	set counter to counter - 1	endifEnd

User avatar
MarilĂș
 
Posts: 3449
Joined: Sat Oct 07, 2006 7:17 am

Post » Sun Nov 28, 2010 10:28 am

Would it not be possible to just use `placeatme` and its flags to drop a no damage force only explosion behind the player?

Skykappa
User avatar
Emily Shackleton
 
Posts: 3535
Joined: Sun Feb 11, 2007 12:36 am

Post » Sun Nov 28, 2010 11:27 pm

But then there's also the problem of that explosion affecting nearby NPCs, especially since I would have to force knockdowns with that explosion. Actually, I've figured out something that should work, let me know what you think, I'm going to test it now:

scn aaaBRUTEDiveScriptref mySelfref phantomNPCint counterfloat playerPosXfloat playerPosYfloat playerPosZBegin GameMode	set mySelf to player	set playerPosX to player.GetPos x	set playerPosY to player.GetPos y	set playerPosZ to player.GetPos z +32	if IsKeyPressed 14 == 1 && counter == 0;;14 is the scancode for Backspace	player.PlaceAtMe aaaBRUTEPhantomNPC 	if IsKeyPressed 17 == 1;;Forward (W)		set phantomNPC to player.PlaceAtMe aaaBRUTEPhantomNPC 1 64 1		phantomNPC.SetPos z playerPosZ	endif	if IsKeyPressed 31 == 1;;Backward (S)		set phantomNPC to player.PlaceAtMe aaaBRUTEPhantomNPC 1 64 0		phantomNPC.SetPos z playerPosZ	endif	if IsKeyPressed 30 == 1;;Left (A)		set phantomNPC to player.PlaceAtMe aaaBRUTEPhantomNPC 1 64 3		phantomNPC.SetPos z playerPosZ	endif	if IsKeyPressed 32 == 1;;Right (D)		set phantomNPC to player.PlaceAtMe aaaBRUTEPhantomNPC 1 64 2		phantomNPC.SetPos z playerPosZ	endif	player.PushActorAway phantomNPC 1	set counter to 20	phantomNPC.Disable	phantomNPC.MarkForDelete	endif	if counter > 0	set counter to counter - 1	endifEnd


EDIT: Well, that crashes the game instantly whenever I press Backspace (scancode: 14)
User avatar
*Chloe*
 
Posts: 3538
Joined: Fri Jul 07, 2006 4:34 am

Post » Sun Nov 28, 2010 10:41 pm

There is a check box in the explosions options `push source ref only`Check that when you make the explosion. Since the player if the Ref source of the explosion, it will only effect the player and nothing else. This way will also take less system resources than scripted maths and hidden npcs.

Another way that would take the least possible resources is to play the falling animation on the player. Through a scripted base effect>object effect>some non playable armour.

The way your attempting to to it is such a complicated long way round and which uses much more system resources than is necessary to achieve the same effect.

Skykappa
User avatar
aisha jamil
 
Posts: 3436
Joined: Sun Jul 02, 2006 11:54 am

Post » Sun Nov 28, 2010 11:41 am

But would that method allow for directional falls? Like diving backwards or forwards?

EDIT: Testing this now...
scn aaaBRUTEDiveScriptint counterBegin GameMode	if IsKeyPressed 14 == 1 && counter == 0		if IsKeyPressed 17 == 1			player.PlaceAtMe aaaBRUTEExplosion 1 64 1		endif		if IsKeyPressed 31 == 1			player.PlaceAtMe aaaBRUTEExplosion 1 64 0		endif		if IsKeyPressed 30 == 1			player.PlaceAtMe aaaBRUTEExplosion 1 64 3		endif		if IsKeyPressed 32 == 1			player.PlaceAtMe aaaBRUTEExplosion 1 64 2		endif		set counter to 20	endif	if counter > 0		set counter to counter - 1	endifEnd


EDIT: Alright, as far as the actual diving out of the way, or illusion of doing so, everything works, including direction control, all I have to do now is get the explosion not to cause a massive brightness and loud noise...but I should be able to figure that out.

EDIT: Well the sound and actual visuals are gone, but there's still this massive brightness like a flashbang just went off everytime the player dives, which is especially strange given that the Art File, Light, Enchantment, and Soun fields are all either empty or have NONE selected. :(
User avatar
Juan Suarez
 
Posts: 3395
Joined: Sun Nov 25, 2007 4:09 am

Post » Sun Nov 28, 2010 7:09 pm

Anyone?
User avatar
Solina971
 
Posts: 3421
Joined: Thu Mar 29, 2007 6:40 am

Post » Sun Nov 28, 2010 3:23 pm

What explosion type did you base your aaaBRUTEExplosion from? If the art file is empty, perhaps yours is picking up some default file. Try basing your explosion off one of the "Fake Force" explosions that use "Effects\FXNullExplosionArt.NIF" as the art file.
User avatar
josie treuberg
 
Posts: 3572
Joined: Wed Feb 07, 2007 7:56 am

Post » Sun Nov 28, 2010 12:22 pm

I'll give that a shot. Thanks for the reply!
User avatar
A Boy called Marilyn
 
Posts: 3391
Joined: Sat May 26, 2007 7:17 am

Post » Sun Nov 28, 2010 1:44 pm

Doesn't work, I even tried making an explosion from scratch, there's still inevitably a huge blinding flash of light that totally washes out the screen for a second or two. :(
User avatar
Sara Johanna Scenariste
 
Posts: 3381
Joined: Tue Mar 13, 2007 8:24 pm

Post » Sun Nov 28, 2010 2:50 pm

Has anyone else had any success with this?
User avatar
Chris Johnston
 
Posts: 3392
Joined: Fri Jul 07, 2006 12:40 pm

Post » Sun Nov 28, 2010 7:16 pm

No?
User avatar
Music Show
 
Posts: 3512
Joined: Sun Sep 09, 2007 10:53 am

Post » Sun Nov 28, 2010 10:23 pm

http://geck.gamesas.com/index.php/Explosion - "Ignore Imagespace Swap: Overrides close proximity explosion optimization (which removes the blinding flash from explosions)."

Try toggling this option in your explosion. Good luck :).
User avatar
John Moore
 
Posts: 3294
Joined: Sun Jun 10, 2007 8:18 am

Post » Sun Nov 28, 2010 11:08 am

It's still giving me a blinding flash, whether that's on or off. I've tried pretty much everything...this is killing me!!! :swear:
User avatar
Lisa
 
Posts: 3473
Joined: Thu Jul 13, 2006 3:57 am

Post » Sun Nov 28, 2010 2:09 pm

You can use a static reference as the "pusher" too. I've done a bit of tinkering like this before. You could probably just moveto the reference to slightly behind the player then push him/her.
User avatar
Lisa
 
Posts: 3473
Joined: Thu Jul 13, 2006 3:57 am


Return to Fallout 3