im back... and noobier than ever :)

Hello
I was TRYING TO make a simple I-16 fly about 2 months ago. I had to quit for a while ;), but now i want to finish it.:spin:

Heres what i’ve got- a medium poly UV I-16, with IPO’s for the ailerons, elevators and rudder. I was stuck on the part where i wanted my propellor to switch meshes 3 seconds after it was turned on (this being done by a bool prop called “ig” which played an IPO when changed) but i didnt get far with that.:confused:

Basically, i need someone to gimme some advice on how to ‘cleanup’ my sim and to actually make it fly. Apparently it sinks into the ground when you start it, and :rolleyes: doesnt move properly, and i need to get the script sussed. And if someone could tell me how to make it look all nice in Apricot, that would be good as well.

I know that all this is no use without an upload:p and here it is:

http://www.uploading.com/files/I8413S8P/i16fly.zip.html

I hate those crappy upload sites…
It makes me wait one minute.
Here’s a good one that delta gave me:
http://uploader.polorix.net/

Take a look at this for helping you improve your flight sim. XJazz is creating a script to accurately replicate the flight of a plane. So far, it works very well.

peace,
-nick

i find all that maths greek:no:
im still a yr 9 teen, so i havent learnt trig and all that:confused:
thanks for the help, ill try to make it work.

Note: my problems are not with the scripting (yet:spin:)
i need the startup system to work properly first:)

anyone that can help me fix this up?

ok ive got this so far for the throttle and startup system:


co = GameLogic.getCurrentController()
o = co.getOwner()

# Local sensor import
t_up = co.getSensor("throttleup")
t_down = co.getSensor("throttledown")
ig = co.getSensor("ig")
prop = co.getSensor("prop")
prop1 = co.getSensor("prop1")


# Actuator import


# throttle setup

if ig.isPositive() and prop1.isPositive():
    o.ignition = 1

if ig.isPositive() and prop.isPositive():
    o.ignition = 0

if t_up.isPositive():
    o.throttle += 1

if t_down.isPositive():
    o.throttle -= 1

if o.throttle > 100:
    o.throttle = 100

if o.throttle < 0:
    o.throttle = 0
    
if prop1.isPositive():
    o.throttle = 0
    o.timer = 0

this works pretty well, except that when u press ‘i’ it keeps on toggling between ‘true’ and ‘false’, so u have to press it 2 or 3 times to get the right timing

i also need to know how to play an IPO actuator with script:D, and how to replace mesh with that after the ipo’s played

now no2 on the agenda
i need to know how to get other objects with only one script

i tried this:

i16p = ob.Get("i16_p")

which got the propellor object but i dont know now how to get actuators on OTHER objects and how to use them

i want everything in one super-script, you see:confused:

k… it seems as if noones gonna post here

anything to do with the name?

  1. Try using polorix. People usually dont like to wait to download files, especially when they’re trying to help someone else.

  2. The script you posted isnt even in the blend. So now I cant see if there are any errors in the console when you run the game and I’m not going to add it in and dig through the script to find the properties necessary for the script just to help you out. That’s a bit much to ask for.

  3. Some of the things you’re asking for are way too general. Such as the following: “if someone could tell me how to make it look all nice in Apricot, that would be good as well.” Nobody is going to answer that one for you, unless you ask about something more specific.

So aside from all that, here’s what I CAN help you with until you post a new blend with the script you presented and all the necessary properties.

You asked how you can access another object within your scene.

Here’s the answer:


objList = GameLogic.getCurrentScene().getObjectList()
objCube = objList["OBCube"]

Note: Make sure you have “OB” in front of the object’s name or else it wont work.

I would like to help you, despite the name (maybe try “SeagullStrike” and see if you get more replies) but sadly, my computadora is being repaired. I get it back on monday. I’m typing this all out on a PSP. Which explains the effed-up spacing in my recent posts. OK, ignoring my little rant, I think you should get your .blend as far as you can take it on your own, then upload it with everything in it, and tell exactly what you were trying to do when you got stuck.

The damn PSP type pad wouldn’t let me fit anymore text in my last post, so I’ll finish here. Your “i key” problem. You can make a simple switch with a Boolean property. Go Always > And > Property=True. Then go Ikey > And > Property=False. Slap on “and Property = True” right after the “ikey” part of your script. That way it will activate only during the single frame that the key is depressed AND the property is True. It will naturally reset when you release the key, rather than just alternating each frame.

thx
no point with that, cos i want it to toggle between ‘true’ and ‘false’
got a new prob tho
i want to centralise all the different parts of my aircraft in a single script

what i want to know is how to control other objects and get actuators from them with only one script in the main aircraft body

apparently there are two ways to get other objects:

Blender.Get("yourobject")

and

Get object List:
yourobject = ObjList["OByourobject"]

i need to know which one i should use

what i want is to get all the other parts and the ipo actuators with them, and then play them (with flipper) when certain keys are pressed

ill upload when i fix up my mess a little:)

Hmm I’ve never heard of the first way, have you actually got it to work?
I’d stick with the second way though because most people use it so they can understand your script and it’s one less module to import.

yeah the first way works exactly like the other way
i still haven’t fixed anything… that burst of genius that got me this far in 1 hr as i hadn’t in 3 days is probably dead :frowning:

Delete the prop sensors, add a timer property called “timeIgnition” WITH THE “I” ON CAPS and use this instead:

co = GameLogic.getCurrentController()
o = co.getOwner()

# Local sensor import
t_up = co.getSensor("throttleup")
t_down = co.getSensor("throttledown")
ig = co.getSensor("ig")
prop = co.getSensor("prop")
prop1 = co.getSensor("prop1")


# Actuator import


# throttle setup

if ig.isPositive() and o.ignition == 0 and o.timeIgnition>0.3:
    o.ignition = 1
    o.timeIgnition = 0

if ig.isPositive() and o.ignition == 1 and o.timeIgnition>0.3:
    o.ignition = 0
    o.timeIgnition = 0

if t_up.isPositive():
    o.throttle += 1

if t_down.isPositive():
    o.throttle -= 1

if o.throttle > 100:
    o.throttle = 100

if o.throttle < 0:
    o.throttle = 0
    
if prop1.isPositive():
    o.throttle = 0
    o.timer = 0

And stop making those u no real short text shortenin thingy

thanks that helped alot
ive figured how to connect my ailerons to an ipo actuator that sets itself by a property, which will give my aircraft a joystick like feel (the property will also set the roll rate, and turn speed)

im trying to get a mouse to work now, prob is that i need to figure out how to add or subtract off a property everytime the mouse moves

hi guys UPDATE i managed to solve my mouse prob:


wd = Rasterizer.getWindowWidth()
hg = Rasterizer.getWindowHeight()

if mouse.isPositive():
    x = wd/2 - mouse.getXPosition()
    y = hg/2 - mouse.getYPosition()

o.x = (o.x+(x/10))
o.y = (o.y+(y/10))

Rasterizer.setMousePosition(wd/2, hg/2)

this will let me track mouse movement and use it to set the frame for my ailerons

only 1 more thing i need to know how to get other objects and their actuators from this script and im near done! :slight_smile:

Ok, use this function to get objects by their names. You can put it at the top of your script.

def obj(objectname):
    """Returns an object. Be sure to put the name of the object without
     OB when using the function."""
    return GameLogic.getCurrentScene().getObjectList()["OB"+objectname]

To get actuators from other objects, just shift-select (select more) objects and in the logics panel connect the wires to your script brick.

Thx that works for my propeller ipo that plays a little charge up animation, but not for my ailerons that set themselves with the properties and the replace mesh propeller actuator :frowning:
heres an upload:
http://www.wikiupload.com/download_page.php?id=55553

over one hour later
my propeller turning problem is solved, just needed to fix it up a little, along with the numerous errors telling me to define integers…
now its only the ailerons and elvator animation i have to worry about…

(BTW, can someone explain servos for me? and can u use angular velocity on them?):slight_smile:

ive gotten this far thanks to ur support, so thx alot guys