Jump to content

Fallout New Vegas GECK & Scripting Help 101


Recommended Posts

Posted

Well that could've been useful a while ago, can't believe I missed that. I just thought that didn't exist. Maybe I can use that to establish communication between scripts. 

Posted

Seems like this is the most active FO scripting thread in the world, so I will live here =D

And I need some help =\

Trying to rotate player's X angle.

Extremely simple code that will run only for one frame

    if IsKeyPressed 208 != DownArrow
        set DownArrow to IsKeyPressed 208
        if DownArrow
            player.rotate x 1
        else
        endif
    endif
If player's X angle is > 0 - script will work just fine. But if X angle is < 0... player's X will immediately go to 360 degrees, visually everything will be fine though, until I move the mouse. If i will move it - X angle will drop to 90.

 

I recommend you use GetAngle/SetAngle instead. Rotate is.. sketchy.

Posted

I recommend you use GetAngle/SetAngle instead. Rotate is.. sketchy.

 

 

It will be a little bit heavy (sin+cos arctan script =\ )... but yeah, seems like I have no choice. At least it's not my fault that rotate won't work. Thank you!

Posted

If you're trying to just duplicate what rotate does, then you don't need any trig functions, either. Rotate sets a reference rotating at a specific rate in degrees/sec. You can do that with just a timer.

Posted

Rotate works, just probably not the way you think/expect.

 

Yeah, it works just fine with objects, but not with character's X angle (-90 to 90 degrees). Works fine with Z axis though.

Yep, working on timer right now.

Trig functions are used to find X angle.

set iUnits to player.GetDistance ffTarget
set posZ to ffTarget.GetPos Z
set playerZ to player.GetPos Z
set offsetZ to posZ - playerZ
set gg to 0 - (offsetZ/iUnits)
set arctan to tan gg 1
player.setangle x arctan
Guest tomm434
Posted

XIlandro, why do you use GetPos Z? This returns height

And no arctg are needed!

float playerAngle
float NeededAngle

set PlayerAngle to Player.getAngle Z
set NeededAngle to PlayerANgle +- any figure you want (playerAngle +180 will make player turn)
player.setAngle Z NeededAngle
Posted

 

XIlandro, why do you use GetPos Z? This returns height

And no arctg are needed!

float playerAngle
float NeededAngle

set PlayerAngle to Player.getAngle Z
set NeededAngle to PlayerANgle +- any figure you want (playerAngle +180 will make player turn)
player.setAngle Z NeededAngle

 

I'm afraid it's not what I need =) I need angle X with height offset. But thanks anyway)

 

Guest tomm434
Posted

Meanwhile jaam. I'v got GetHairColor working!

(R,G,B )

 

player.gethaircolor 1 wlll return R

player.gethaircolor 2 wlll return G

player.gethaircolor 3 wlll return B

 

But I'm still having trouble with sethair color.

 

Can you please transform any RGB color to the color engine understands? I mean  - what do you do exactly?

Posted

Meanwhile jaam. I'v got GetHairColor working!

(R,G,B )

 

player.gethaircolor 1 wlll return R

player.gethaircolor 2 wlll return G

player.gethaircolor 3 wlll return B

 

But I'm still having trouble with sethair color.

 

Can you please transform any RGB color to the color engine understands? I mean  - what do you do exactly?

 

How about creating an npc with hair color you need (hide it somewhere in the test cell or make new cell for NPCs), then do something like "

set xxColor to NPC.GethairColor

player.sethaircolor xxColor

? It worked fine for me.

Guest tomm434
Posted

How about creating an npc with hair color you need (hide it somewhere in the test cell or make new cell for NPCs), then do something like "

set xxColor to NPC.GethairColor

player.sethaircolor xxColor

? It worked fine for me.

Wow. What is a xxColor? int, float, ref?

 

 

 

 

 

 

Tomm, it doesn't work exactly the same way in reverse? Is it just splitting up the int that you don't understand?

One second please.

Posted

 

How about creating an npc with hair color you need (hide it somewhere in the test cell or make new cell for NPCs), then do something like "

set xxColor to NPC.GethairColor

player.sethaircolor xxColor

? It worked fine for me.

Wow. What is a xxColor? int, float, ref?

 

 

Int, if I remember correctly.

Guest tomm434
Posted

I'll check this out, thanks.

Guest tomm434
Posted

doesn't work

set HairColor to Lunette1Ref.getHairColor

doesn't comply/ I need a number after getHairColor

 

 

pridelsayer, sethaircolor and gethaircolor don't work vice versa

I can't do this

sethaircolor 1 0000011

1 goes for Red

I need a particular color #

sethaircolor 0000011

will comply

Posted

Comply  Compile ;)

 

 

sethaircolor 1 0000011

1 goes for Red

 

Totally guessing here...

 

If 1, 2, and 3 go for R G B, I would think that you'd have a number from 0-255 after that, and that you'd probably have to have 3 sethaircolor statements.

 

sethaircolor 1 0

sethaircolor 2 136

sethaircolor 3 77

 

(don't ask me what color that is ;)  )

Guest tomm434
Posted

Comply  Compile ;)

 

 

sethaircolor 1 0000011

 

1 goes for Red

 

Totally guessing here...

 

If 1, 2, and 3 go for R G B, I would think that you'd have a number from 0-255 after that, and that you'd probably have to have 3 sethaircolor statements.

 

sethaircolor 1 0

sethaircolor 2 136

sethaircolor 3 77

 

(don't ask me what color that is ;)  )

 

 

That's green :D

The thing is :

sethaircolor X Y 

won't compile

SethairColor X 

will compile

 

Would have been too easy

;(

Posted

Goddamnit.  I can't read today.  X P

 

And you've already tried a hexidecimal number for SethairColor X, right?

Posted

The thing is :

sethaircolor X Y 
won't compile

SethairColor X 
will compile

 

Would have been too easy

;(

 

This probably needs bitwise manipulation, storing the 3 ints for the 3 main components (R,G & B ) you got from GetHairColor into one int you need for SetHairColor. Jaam & pride might help you out there; all of that is pretty alien to me.

Guest tomm434
Posted
And you've already tried a hexidecimal number for SethairColor X, right?

yes and the color is  grey. She looks kinda creepy.

 

 

This probably needs bitwise manipulation, storing the 3 ints for the 3 main components (R,G & B ) you got from GetHairColor into one int you need for SetHairColor. Jaam & pride might help you out there; all of that is pretty alien to me.

thanks, I'll wait for them. Google doesn't get me much info on this topic.

Posted

GetHairColor 0

 

is supposed to return the full RGB code as an integer.

SetHairColor takes an RGB color and an optional NPC, but there might an error.

Try the code.

let cc := ((15 * 256) + 240) * 256 + 255
;;; (if I am good cc will be 1044735)

SetHairColor cc
let rr := GetHairColor 1
let gg := GetHairColor 2
let bb := GetHairColor 3

rr should be 15
gg should be 240
bb should be 255


if that's not the case then it would seem there a bug :)

 

EDITed my very bad formula...

 

 

Posted

 

Well the only options to communicate with other plugins are globals and token counting

Ahem.

 

Well, I probably should have stuck the word "other" in there as if you read up a few posts you would have read that he didn't want to use NX :)

I was under the impression UDF's were part of NX but seems they are NVSE, not sure if he wanted to use that either.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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