X,Y,Z,Rotation,etc, etc, Need some help!

Post » Thu Nov 11, 2010 1:19 am

Howdy!

Righto. So I am planning to make a couple of custom stuff, mainly magic effects and stuff like that, and I am griping it piece by piece. What I am mostly stumbling upon is a few things really. I will try to make it clear what I want to know ^^

Sticking a plane to 'ya


Okay. Firstly I really don't understand how you are able to make an object stick to the player. Let's say I got this plane with a alpha and a basic color. I want it to stick to the hand of the player, or the head, or whatever. I want it to follow the players movement. So if the player turns around, the plane/beam follows. If the player jumps, the plane/beam follows. If the .... yeah, you get the idea.
I assume I need to constantly check the X Y and Z axis of the player, and having the plane move accordingly. However, I really can't figure out how to do that, and how on earth that will look smooth. Neither can I understand how to figure out where certain bodyparts of the player is =/ I mean, what is the axis of the hand, the head, etc, of the player? how am I suppose to figure out that.


Next:

being stalked by a ring of fire?

right. So let's say I got this fire effect. It is a ring of fire, simply put. The effect is all nice and dandy, a basic script will make it appear at the player and dissapear after a set ammout of time. Now, I want that 'lil ring of fire to follow the player. I mean, let's say I make this protection orb. Won't do me much good if the thing is blocking me and not moving?
Again, I guess I would have to check the axis of the player and move accordingly. I guess having Z to 0 at all times to make it stick to the ground?
And again, I can't see how this will not become buggy. Let's say the script check where the player is every... 0.01 second, it gotta become kinda .. you know ... glitchy? I also don't want to make a script which is eating too much of the game.


3 orbs chasing 1 target

Weee... Just played Metroid prime 1 on the Gamecube and 'boy the Wave beam gave me an orgismic feeling! But ... even if I somehow managed to make thoose 3 orbs, I got no idea how to make them shoot from the players hands, and actually chase the target, then hit them. I mean, how do you do that! I really got no clue here.. would really LOVE answer here. Would open up the door for a lot of effects on my part =)

Here is a link to a picture of the effect, atleast a little of it. You get the point:
http://www.dolphin-emu.com/images/photoalbum/album_1/emu-gc-mp-12.jpg

Hum.... I believe I got more, but can't seem to remember what >.> so, this is what I basically got. Let me sum it up short:

How to make an object follow the player
e.g How to use axis(Z,X,Y) scripts

And

How to make a object stick to the player, like the hand, and move with it
e.g check axis and rotate accordingly, smoothly.




Any information will be great ^^ In the meanwhile I am going to stick to the CS Wiki and experiment with the axis functions ... would still love a good answer here!


Cheers,

Matth
User avatar
Claire Jackson
 
Posts: 3422
Joined: Thu Jul 20, 2006 11:38 pm

Post » Wed Nov 10, 2010 4:30 pm

Right ....
User avatar
Miguel
 
Posts: 3364
Joined: Sat Jul 14, 2007 9:32 am

Post » Thu Nov 11, 2010 4:13 am

using "MoveTo" every 0.1 seconds might be a good idea, effect-speaking, framerate-speaking it might not be a good idea, although I've never tried a script consisting solely of "MoveTo"

I assume that "plane" as in "aeroplane"? Not "plane" as in "Oblivion plane"?

Honestly I don't know if player's hands coordinate is known, so far I know only tracking the player's general position (which I assume is at his/her center), as for the hand itself, I don't know.

As for "chasing the target" I don't believe it's doable. The target might change direction at any moment and I've never seen anything inanimate chasing something, even an animate object might stop due to the way AI works
User avatar
Brooke Turner
 
Posts: 3319
Joined: Wed Nov 01, 2006 11:13 am

Post » Wed Nov 10, 2010 2:03 pm

using "MoveTo" every 0.1 seconds might be a good idea, effect-speaking, framerate-speaking it might not be a good idea, although I've never tried a script consisting solely of "MoveTo"

I assume that "plane" as in "aeroplane"? Not "plane" as in "Oblivion plane"?

Honestly I don't know if player's hands coordinate is known, so far I know only tracking the player's general position (which I assume is at his/her center), as for the hand itself, I don't know.

As for "chasing the target" I don't believe it's doable. The target might change direction at any moment and I've never seen anything inanimate chasing something, even an animate object might stop due to the way AI works


Okay, looks like I need to clear up something ^^

1) By plane I mean a simple plane as in the object. A billboard plane with a texture. It is used to make magic effects, since most of the plane goes invisible. Take a normal lightning effect for instance, that is made using a animated billboard texture on a simple 4-vertex plane. What I am trying to do is placing a plane at the hand/head of the player which will have a texture to look like a beam. The main idea is to make a weapon ( metroid fan. sorry), which will shoot out a magic effect: a laser which says "Boom" when it hits the target. And well, to do that I need to be able to track the players movement/rotation, as well as whatever it hit. Neither I got a clue how to do.


2) By chasing I mean.. well, looks at Midas Magic mod. In one of his videos he got this "shield", a shield which moves with him. I know, I know, I should simply take a look at that script, but I kinda don't understand anything. I gotta learn the basic of scripting with X, Y and Z, and the wiki doesn't really help out too much =/


All in all I kinda need to understand how to script with X,Y,Z and how on earth I am logically able to do this. I know it is possible, as I've seen mods do the same. But looking at a 400 line script having tns of X,Y,Z's in 4 diferent variations REALLY doesn't help me out at all, when I don't got a clue how it works.

Thanks,

Matth!
User avatar
Laura Shipley
 
Posts: 3564
Joined: Thu Oct 26, 2006 4:47 am

Post » Wed Nov 10, 2010 7:22 pm

so.. what's up?
User avatar
sam westover
 
Posts: 3420
Joined: Sun Jun 10, 2007 2:00 pm

Post » Wed Nov 10, 2010 2:37 pm

Another spell in midas magic does almost exactly what you wanted with the wave beam spell. I believe the spell is called Midas Magic Missiles. What it does is create several (3 or 5 i think) small energy balls over the player which track enemies in the area. If you have Midas Magic, it would probably be worth it to look at that one, but all of the spell scripts, since they actually fire an activator instead of a conventional spell, are very heavy in advanced math functions, so if you aren't too good with trig, they won't be of much use.
User avatar
Devin Sluis
 
Posts: 3389
Joined: Wed Oct 24, 2007 4:22 am

Post » Thu Nov 11, 2010 4:22 am

Another spell in midas magic does almost exactly what you wanted with the wave beam spell. I believe the spell is called Midas Magic Missiles. What it does is create several (3 or 5 i think) small energy balls over the player which track enemies in the area. If you have Midas Magic, it would probably be worth it to look at that one, but all of the spell scripts, since they actually fire an activator instead of a conventional spell, are very heavy in advanced math functions, so if you aren't too good with trig, they won't be of much use.


That's my very problem. I could anolyze the scripts part by part and easy figure it out, math is not a problem( hence my name in most games is matth ^^) but I really gotta figure out the very basic of scripting with axis and how they work. I mean, I have found a couple of functions like Getpos, Setpos, and onward, but .. um.. I would love that someone could explain the very basic so I actually got a base to start off with. If I understand atleast what is happening and why, I can easily do some math, as well as figure out the scripts.

Thanks!


Cheers,

Matth
User avatar
Riky Carrasco
 
Posts: 3429
Joined: Tue Nov 06, 2007 12:17 am

Post » Wed Nov 10, 2010 2:09 pm

XYZ scriping eh?

right here goes:

For each object you've essentially got six values. x position, y position, z position, x rotation, y rotation and z rotation.

these values are accessible from any reference with the commands getpos x, getpos y, getpos z, getangle x, getangle y, getangle z

Basically you've got a fairly simple xyz coordinate space in which things are located and rotated. In some cases that space can be very large indeed as it consists of several cells. It's up to you to figure out (mostly by trig) where things have to get moved and rotated.

x,y,z positions of things tend to come from their mesh origins, not usually their centres (though with actors it appears to be the centre for x,y and the base for z).

You can set all these values for any reference with the commands setpos x setpos y setpos z , setangle x setangle y and setangle z

Another really usesful command is getheadingangle:

GetHeadingAngle StrangeStatue

Returns the angle between the caller's heading and the ObjectRefID in a range from -180 to 180.
For example, say the player is facing due north. The object StrangeStatue is due west of the player. The command:
player.GetHeadingAngle StrangeStatue
would return -90.

Finally there's the ever handy getdistance command, though of course it takes all three dimensions into account which is not always what you want.

All these values return as floats.

I think that's probably enough to get you started :)
User avatar
Spencey!
 
Posts: 3221
Joined: Thu Aug 17, 2006 12:18 am

Post » Wed Nov 10, 2010 5:23 pm

Thanks for the input!

Right, half of the reply I didn't get, but I will understand that with time I assume. For now I will focus on the very basic I think.
But, is there any simple exercise to use GetAngle/GetPos? I mean, I can think of a basic message script where the exact coordinates and angle of the player is said, but is there any other use? Would love to have something a little harder to think about while learning X,Y and Z scripting ^^ Before moving into math-scripts. We... lots of fun with Sin, Tan and cos! well, I know the basic of those in basic math, so using them in oblivionish-scriptting is probasbly not too bad.

Cheers,

matth!
User avatar
Rob
 
Posts: 3448
Joined: Fri Jul 13, 2007 12:26 am


Return to IV - Oblivion