+ Reply to Thread
Results 1 to 10 of 10

Thread: Need help making a chip orbit

  1. #1
    Wire Noob crafton's Avatar
    Join Date
    Nov 2008
    Posts
    14

    Default Need help making a chip orbit

    Well. Chinoto helped me out to make a chip that floats above my head, spins, and attacks on crouch. I added setColor and setMaterial for looks but I wanted to make it orbit around my head sorta like a planet around the sun. I tried figuring it out and someone told me I need to know trig so i gave up. But i was wondering if anyone here could help me out. and what value do i change so it goes faster when attacking?


    E2 Code:
    Code:
    @name Craftons
    runOnTick(1)
    EE=entity() #Expression Entity
    Owner=owner()
    setMass(1000)
    MyHeight=vec(0,0,125)
    Target=(!Owner:isCrouch() ? Owner:pos()+MyHeight : Owner:aimPos())
    applyForce(((Target-EE:pos())*10-EE:vel())*EE:mass())
    applyAngForce((-(EE:angles()*5):setYaw(360*2)-EE:angVel())*EE:inertia():length()/sqrt(3))
    EE:setColor(0,0,255)
    EE:setMaterial("Models/Debug/Debugwhite")
    Last edited by crafton; 07-02-2009 at 04:19 PM.

  2. #2
    billywitchdoctor.com Whosdr's Avatar
    Join Date
    Dec 2008
    Posts
    2,300

    Default Re: Need help making a chip orbit

    Code:
    entity():applyForce(-entity():pos() + -entity():vel() + vector(sin(curtime()*100)*50),cos(curtime()*100)*50),120) + owner():pos())
    ---------------------------------------------------------------------------------------------------------------^this is height
    .siht daer ot gniyrt emit detsaw ev'uoY

  3. #3
    Wire Noob crafton's Avatar
    Join Date
    Nov 2008
    Posts
    14

    Default Re: Need help making a chip orbit

    1. where do i put that
    2. how do you do a code box

  4. #4
    Spucatum Tauri Bull's Avatar
    Join Date
    Jun 2008
    Location
    Finland
    Posts
    6,009

    Default Re: Need help making a chip orbit

    Look at my signature.
    Or select the code and hit the # in the toolbar... that will do the [ code ] [ /code ] for you.
    My signature has a point.
    Quote Originally Posted by Squeakyneb View Post
    when l3ulletje says do it, do it.
    That

    Quote Originally Posted by Anticept View Post
    By the way, Bull is in charge.

  5. #5
    Wire Noob crafton's Avatar
    Join Date
    Nov 2008
    Posts
    14

    Default

    Thank you.

  6. #6
    Wire Noob crafton's Avatar
    Join Date
    Nov 2008
    Posts
    14

    Default Re: Need help making a chip orbit

    I tried putting that line you posted at the end and it said i need a comma or whitespace at line 12, char 110. and i put a comma or whitespace and it still reported an error

  7. #7
    Wire Tutor chinoto's Avatar
    Join Date
    Apr 2008
    Location
    Brooklyn Park, MN. Lost my thumbdrive yet again...
    Posts
    1,983

    Default Re: Need help making a chip orbit

    Code:
    @name Craftons
    runOnTick(1)
    EE=entity() #Expression Entity
    Owner=owner()
    setMass(1000)
    MyHeight=vec(0,0,125)
    Target=(!Owner:isCrouch() ? Owner:pos()+MyHeight+vec(0,50,0):rotate(0,curtime()*180,0) : Owner:aimPos())
    applyForce(((Target-EE:pos())*10-EE:vel())*EE:mass())
    applyAngForce((-(EE:angles()*5):setYaw(360*2)-EE:angVel())*EE:inertia():length()/sqrt(3))
    EE:setColor(0,0,255)
    EE:setMaterial("Models/Debug/Debugwhite")
    Just added +vec(0,50,0):rotate(0,curtime()*180,0) to target calculation. Add me to friends if you want quick help, Steam Community :: ID :: [GME].<{BT}>.Chinoto
    (\__/) Expression 2 Resources: E2 Beginner's Guide | E2 Formatting Guide | E2 Function Reference | E2 Examples | Me
    (='.'=) PM me code and I'll send it back optimized if possible. (I find it fun dammit!)
    (")_(") Drunkie referring to an E2: "It's obvious that Chinoto made this, his coding style is all over it."

  8. #8
    Wire Noob crafton's Avatar
    Join Date
    Nov 2008
    Posts
    14

    Default Re: Need help making a chip orbit

    I added you and I still get the same error from that code you posted

  9. #9
    Wire Sofaking Echo51's Avatar
    Join Date
    Feb 2009
    Location
    Denmark
    Posts
    1,489

    Default Re: Need help making a chip orbit

    Update your wiremod... then tell us the excact code you used, and the error it gives..
    Proud of my non-existant life...
    In russia, Expression 2 codes you!
    Quote Originally Posted by Snowden42 View Post
    Nooblishious? That's a signature keeper.

  10. #10
    Wire Noob crafton's Avatar
    Join Date
    Nov 2008
    Posts
    14

    Default Re: Need help making a chip orbit

    No, this one was my bad. I pasted a code I'd previously copied instead of the one chinoto posted.
    Last edited by crafton; 07-02-2009 at 04:20 PM.

+ Reply to Thread

Similar Threads

  1. Help with orbit
    By sadow200 in forum Expression 2 Discussion & Help
    Replies: 11
    Last Post: 05-03-2009, 03:14 PM
  2. Cam Controller Orbit
    By Techni in forum Installation and Malfunctions Support
    Replies: 4
    Last Post: 09-21-2008, 08:35 AM
  3. Orbit?
    By -|Raveness|- in forum Installation and Malfunctions Support
    Replies: 1
    Last Post: 04-11-2008, 07:18 PM
  4. Automated satellite Orbit Guidence System?
    By Locklear in forum Installation and Malfunctions Support
    Replies: 3
    Last Post: 11-26-2007, 03:09 PM
  5. Making a random chip give out only one random number?
    By BAZ in forum Installation and Malfunctions Support
    Replies: 6
    Last Post: 05-27-2007, 01:02 PM

Bookmarks

Posting Permissions

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