Jump to content

how to get the weapon's Angle?


blueshadowlaser

Recommended Posts

HI everyone, I want to write a mod to throw a realy grenade. I use a staff magic mod to realized the mod but it's not perfectly

 

Scriptname BallThrower6 extends activemagiceffect

MiscObject Property BallBowl auto

Event OnEffectStart(Actor Target, Actor Caster)

ObjectReference Ball = Caster.PlaceAtMe(BallBowl,1,false,true)
Ball.MoveToNode(Caster, "RollerNutTriggerCtrl")
Ball.Enable()
while(PokeBall.is3DLoaded() == false)
Utility.wait(0.05)
endwhile
float anglePercent = (89 -(89 + Caster.GetAngleX() - 15 ) ) / 89
float x = Math.Sin(Caster.GetAngleZ())
float y = Math.Cos(Caster.GetAngleZ())
float h = ( anglePercent * Ball.GetHeight() )
float impact = ( 0.7 * 400)
Utility.wait(0.05)

Ball.ApplyHavokImpulse(x, y, anglePercent , impact )
Ball.RegisterForSingleUpdate(3)

EndEvent

 

Because the target sight is not correctly. So I want to write a crossbow script. But it is really hardly.

First, the function GetAngleX adn GetAngleY and GetAngleZ is only available for Actor or ObjectReference. How could I get the weapon model's angleX and angleY and angleZ? Event OnEquip only indicated the Actor who equip the weapon. Otherwise, which event could I use for the fire action?

Edited by blueshadowlaser
Link to comment
Share on other sites

I'm guessing you would have to make a dummy ObjectReference set your angle calls to that.

Then create a on equip event, tied to the current crossbow to the dummy reference ...

 

Not sure what you're asking here ... is this any crossbow or only one ...

 

Maybe add the crossbow as an Objectreference

Maybe add a script to the crossbow tied to a global

Angle =(Self.GetAngleX())

Edited by NexusComa
Link to comment
Share on other sites

I'm guessing you would have to make a dummy ObjectReference set your angle calls to that.

Then create a on equip event, tied to the current crossbow to the dummy reference ...

 

Not sure what you're asking here ... is this any crossbow or only one ...

 

Maybe add the crossbow as an Objectreference

Maybe add a script to the crossbow tied to a global

Angle =(Self.GetAngleX())

How to make a crossbow as an Objectreference? Use Load3D()? Could You given an Example or given a link to the guide of adding a dummy weapon?

 

And I use this code need an event of fire action, just like the Iskeypressed function. So did I must use an quest to accomplish it?

Edited by blueshadowlaser
Link to comment
Share on other sites

Grenade MOD from Magic?

 

Thats Cool.

 

Meybe set CastingArt as Static Nif, but seems need script to disable it.

 

The Projectile is easier, with certain Gravity,speed,and timing explosion.

 

I will Create it for my Rifles MOD

 

Thx :happy:

Link to comment
Share on other sites

Grenade MOD from Magic?

 

Thats Cool.

 

Meybe set CastingArt as Static Nif, but seems need script to disable it.

 

The Projectile is easier, with certain Gravity,speed,and timing explosion.

 

I will Create it for my Rifles MOD

 

Thx :happy:

 

These script is not perfect because the shoot angle is not straight with the player's sight, So many time it will fly away from your front sight.

 

This mod script is not the Projectile. Projectile in skyrim has not the Havok effect, and could not sprang on the target location. I want to made a timing Grenade.

 

So, Did you know how to add a dummy weapon model then I could get the angle of this model? And I use this code need an event of fire action, just like the Iskeypressed function. So did I must use an quest to accomplish it?

Edited by blueshadowlaser
Link to comment
Share on other sites

 

Grenade MOD from Magic?

 

Thats Cool.

 

Meybe set CastingArt as Static Nif, but seems need script to disable it.

 

The Projectile is easier, with certain Gravity,speed,and timing explosion.

 

I will Create it for my Rifles MOD

 

Thx :happy:

 

These script is not perfect because the shoot angle is not straight with the player's sight, So many time it will fly away from your front sight.

 

This mod script is not the Projectile. Projectile in skyrim has not the Havok effect, and could not sprang on the target location. I want to made a timing Grenade.

 

So, Did you know how to add a dummy weapon model then I could get the angle of this model? And I use this code need an event of fire action, just like the Iskeypressed function. So did I must use an quest to accomplish it?

 

 

There is a Magic MOD that create Fireball fall down due to gravity.

And My rifle projectile meshes has colission in it, its bounce for few times when impact occurs.

 

Your script is confusing, its going too far with quests. And I don't recognize such dummy to any equiped weapons.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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