Results 1 to 10 of 10
Like Tree1Likes
  • 1 Post By Drunkie

Thread: Latest Project (Hover Tank)

  1. #1
    Wire Noob griff's Avatar
    Join Date
    Mar 2010
    Posts
    11

    Default Latest Project (Hover Tank)

    ok so my latest Project is an automatic Hover Tank (because wheels are so last century), but a few issues have arrised with the codeing and i have no idea whats wrong

    first problem i need to sort out is the hovering, atm it just shoots accross the map and into the corner.

    code wise atm i have
    Code:
    @name Hover Hieght Control
    @inputs E:entity RC
    @outputs 
    @persist Mass I Array:array
    
    Array = E:getConstraints()
    Count = Array:count()
    
    while(I < Count) {
    Mass = Mass + Array[I,entity]:mass()
    I++
    }
    
    if(RC > 35) {E:applyForce((E:pos() - E:up())*Mass - E:vel()*1)} else {if(RC < 35) {E:applyForce((E:pos() + E:up())*Mass - E:vel()*1)} else {}}
    
    runOnTick(1)
    E1=entity(),EE=(E1:isWeldedTo() ? E1:isWeldedTo() : E1)
    EA=-EE:angles()*15-EE:angVel()*2
    EV=EE:massCenter(),ER=EE:right(),EF=EE:forward(),EU=EE:up()
    Lev=EE:inertia():length()
    
    EE:applyOffsetForce( EU*EA:pitch(),EV-EF*Lev) 
    EE:applyOffsetForce(-EU*EA:pitch(),EV+EF*Lev)
    EE:applyOffsetForce( EU*EA:roll() ,EV-ER*Lev)
    EE:applyOffsetForce(-EU*EA:roll() ,EV+ER*Lev)
    i have no idea why this isnt working and any sudjestions will be great, even better if they work
    Sorry im a bit of a nub

    Quote Originally Posted by Bull View Post
    Quote Originally Posted by mario972 View Post
    Make 1x1 360 degrees plate
    That's called a circle mario.

  2. #2
    I need scissors. 61 Colonel Thirty Two's Avatar
    Join Date
    Oct 2009
    Posts
    4,186
    Blog Entries
    5

    Default Re: Latest Project (Hover Tank)

    Why applyOffsetForce?

  3. #3
    Ursus maritimus Drunkie's Avatar
    Join Date
    Feb 2009
    Location
    Canada
    Posts
    6,685
    Blog Entries
    1

    Default Re: Latest Project (Hover Tank)

    He didn't make it so he doesn't know any better.

    It's obvious that Chinoto made this, his coding style is all over it.
    chinoto likes this.

  4. #4
    Wire Sofaking thetree's Avatar
    Join Date
    Oct 2009
    Location
    England
    Posts
    946

    Default Re: Latest Project (Hover Tank)

    He code is the stuff above runOnTick(1)

  5. #5
    Wire Noob griff's Avatar
    Join Date
    Mar 2010
    Posts
    11

    Default Re: Latest Project (Hover Tank)

    everything above runOnTick(1) is mine
    that applyOffsetForce is to prevet from filping over (which i edited from the E2 Wiki). or at least thats wat its supposed to do and before you say i tryed without it as well, same thing happend.
    Sorry im a bit of a nub

    Quote Originally Posted by Bull View Post
    Quote Originally Posted by mario972 View Post
    Make 1x1 360 degrees plate
    That's called a circle mario.

  6. #6
    Wire Sofaking thetree's Avatar
    Join Date
    Oct 2009
    Location
    England
    Posts
    946

    Default Re: Latest Project (Hover Tank)

    Quote Originally Posted by griff View Post
    everything above runOnTick(1) is mine
    that applyOffsetForce is to prevet from filping over (which i edited from the E2 Wiki). or at least thats wat its supposed to do and before you say i tryed without it as well, same thing happend.

    Just use applyAngForce() to stop it flipping.

  7. #7
    Wire Noob griff's Avatar
    Join Date
    Mar 2010
    Posts
    11

    Default Re: Latest Project (Hover Tank)

    that bit doesnt even matter, i just put that in to try solve the problem. didnt work
    Sorry im a bit of a nub

    Quote Originally Posted by Bull View Post
    Quote Originally Posted by mario972 View Post
    Make 1x1 360 degrees plate
    That's called a circle mario.

  8. #8
    Wirererer crichards's Avatar
    Join Date
    Aug 2010
    Location
    NC
    Posts
    293

    Default Re: Latest Project (Hover Tank)

    What is RC...?

  9. #9
    Wire Noob PointMan's Avatar
    Join Date
    Nov 2010
    Posts
    4

    Default Re: Latest Project (Hover Tank)

    I would suggest....tutorials! The applyAngForce/applyForce video tuts might actually make you understand what is going on
    Video Tutorial of applyAngForce and ApplyForce <Masogir's video tut....it's a must see!

  10. #10
    I need scissors. 61 Colonel Thirty Two's Avatar
    Join Date
    Oct 2009
    Posts
    4,186
    Blog Entries
    5

    Default Re: Latest Project (Hover Tank)

    Code:
    E:applyForce((E:pos() - E:up())*Mass - E:vel()*1)
    Not sure what you are trying to do here. You never want to applyForce by a position, unless you subtract another position from it first (forming a vector).

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
unnecessary
unnecessary
unnecessary
unnecessary
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots