Flying backwards! -1 reply

  • 1
  • 2

Please wait...

MARKYNCC

NG-Mods Mission Creator

50 XP

26th May 2009

0 Uploads

148 Posts

0 Threads

#1 8 years ago

Does anyone know if it is possible to make ships fly in reverse?




Johnny1110

Currently: Chillaxin!

50 XP

23rd November 2008

0 Uploads

64 Posts

0 Threads

#2 8 years ago

Im not sure if you actually can fly in reverse but when i tractor a moving ship i think it causes a glitch in my game and the ship i targeted flys in reverse for a few seconds then it continues flying normally. I also happened to me when i got tractor beamed by a borg cube.




Guest

I didn't make it!

0 XP

 
#3 8 years ago

Yes. One is Port the ship with another orientation..

Another with scripting you can make it move backward, up down left right (thruster like) but it's got to be scripted specifically for that using a known orientation of the ship. Scripting can't "find" the Orientation but it can Set it. And it can move a ship in any direction at any speed.




Guest

I didn't make it!

0 XP

 
#4 8 years ago

You will have to get a basic understanding of the Vector 3s to use it. Set Velocity function, it requires a Vector3 (it's a 3 dimensional number, with a X, a Y and a Z component).

I think I tried to explain them to you for something else one time, I figure I should be able to, or maybe get you a sample. That function is in all of my mission scripts and any I do jointly with Chris, because i use it in one of my "across the board" features. It's really not hard to use or give you a sample to work with, just sounds complex.




MARKYNCC

NG-Mods Mission Creator

50 XP

26th May 2009

0 Uploads

148 Posts

0 Threads

#5 8 years ago

Muldrf;5327989You will have to get a basic understanding of the Vector 3s to use it. Set Velocity function, it requires a Vector3 (it's a 3 dimensional number, with a X, a Y and a Z component).

I think I tried to explain them to you for something else one time, I figure I should be able to, or maybe get you a sample. That function is in all of my mission scripts and any I do jointly with Chris, because i use it in one of my "across the board" features. It's really not hard to use or give you a sample to work with, just sounds complex.

Unfortunately 'mathematics' was never my best subject!

I tried setting the 'SetCraftCinematicSpeed' to -30.0f, to see if that would make it fly backwards, but that did not work at all lol

I am really not sure what a 'vector3' actually is, there are a couple of missions I had in mind, where getting a ship to go backwards is part of the story:)




Guest

I didn't make it!

0 XP

 
#6 8 years ago

Like I said it "sounds complicated". It's a 3d number. Meaning it has 3 parts. X Y Z.

An easy way for someone that is used to missions or more correctly "Maps" will see there are 3 numbers for the location of Any Map object That's a Vector 3 basically, One number is it's "Left/Right" position in relation to the map location of 0, another is it's "Top/Bottom" position in relation to the map location of 0, and the last is the Elevation Uo/Down position in relation to the map location. They may not be in that Order, it might be up/down, left/right, top/bottom... I don't know without looking at it.

But that's the same way SetVelocity is, one of the 3 is Left/Right, one is Up/Down one is Top/Bottom. They are in Relation to the "MAP" not the "ship", that's the trick to keep in mind. So if you want the ship to go "backward" have it pointed a certain direction then set it's velocity to go relationally backward.

SetVelocity(40.0, 0.0, 0.0) (That is not full proper santax.. I'd have to look it up to get you the real entry method for the numbers..) would move a ship/object along 1 axis at a speed of 40. Making it "-40" would make that object move in the exact opposite direction.

Keep in mind there is no "Ramp up" with SetVelocity. It goes from 0 to 60 in basically 0 Seconds. There might be a slow "bleed off" of speed, so you might have to refresh it's velocity after awhile if you want it to go backward for a while.

I seriously don't think it's something you wouldn't understand with a proper example, considering how far you came so quickly to start with no background in that kind of coding. Unfortunately it's late and I'm on the laptop just checking messages and don't have sourcecode for it handy on here.




Guest

I didn't make it!

0 XP

 
#7 8 years ago

Proper Code Sample.

DEFINITIONS Position XVector Position YVector Position ZVector

INITIALIZATION XVector.Set(1.0f, 0.0f, 0.0f); YVector.Set(0.0f, 1.0f, 0.0f); ZVector.Set(0.0f, 0.0f, 1.0f);

ACTION SetVelocity(HANDLE, (XVector * 1.0f) + (YVector * 1.0f) + (ZVector * 1.0f));

The above code will make the choosen HANDLE have a positive velocity of 1 in each of the 3 axis. Change the "* 1.0f" in the SetVelocity line to choose different speeds in different directions such as "0.0f" to not move in that one direction at all and "40.0f" to move in a direction at a rate of 40.

It might be possible to do this instead of using the first 6 lines. But I never tried it.

SetVelocity(HANDLE, (0.0f, 0.0f, 0.0f));

In theory this would set velocities in all 3 axis to 0. If it worked that is.




MARKYNCC

NG-Mods Mission Creator

50 XP

26th May 2009

0 Uploads

148 Posts

0 Threads

#8 8 years ago

I think you should be a maths teacher 'muldrf' that does make a lot more sense!!

That is one of the biggest Hurdles with 'scripting', knowing how to arrange the lines of code correctly, I have sometimes spent hours trying to get one thing to work correctly.

Some functions in the 'script interface' dont appear to work:

I noticed this with the 'Damage effects', the only one that seems to work is the 'kDamageType_Photon', the rest dont work for me at all. I wanted to get the appearance of a 'Battle Damaged Ship' without the 'fire trail', so that it appeared as 'old damage'.

eg: The appearance of the Enterprise in ST3 or the appearance of the NX-01 after 'Azati Prime'




Guest

I didn't make it!

0 XP

 
#9 8 years ago

I didn't come up with the code, the vector stuff is from a stock mission I believe originally (the first 6 lines). Was found my RE and been used ever since for a wide range of purposes. I changed the organization a bit for easy reuse. You can put all 7 lines into your action in the order listed, but by placing the top six where I said you get to reuse the vector anytime you want with just 1 line.

--

Ya the Photon effect works, but the phaser one doesn't. The "Fragment" effect works, but it's well a bit different.. Fragment "can" knock off breaknodes from the ship, but it's random if it does or not, and might not knock all of them off the ship. I was dissapointed that phaser didn't work too...

I once used a combination of Photon damages and Fragment damages to create a graveyard of ships. The map never saw release. I was going to go back and make another one someday and still might but I don't have any plans to do so at this time. Actually now that I think of it some of the Target Practice maps in UU2.0 used those functions if my memory serves, but not to the extent I wanted to go sometime.

---

Ya figuring out a function can take a bit, now I haven't found many that don't work once sorting them out. Phaserdamage being one, and I can't think of any others offhand. The first thing to do when you don't know what to do is search the stock missions for examples, but there are many functions that were never used in the stock missions.




MARKYNCC

NG-Mods Mission Creator

50 XP

26th May 2009

0 Uploads

148 Posts

0 Threads

#10 8 years ago

I do think that we could do with a list of examples of how the most commonly used functions can work, and how to arrange the lines of code, but I fear that it would get very complicated, and like a dictionary.

Plus you would constantly need to refer to 'points', 'paths' and 'Handles' for it to make any sense.




  • 1
  • 2