+ Reply to Thread
Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20

Thread: Zero G E2

  1. #11
    Wirererer grandpapolly's Avatar
    Join Date
    Aug 2008
    Posts
    283

    Default Re: Zero G E2

    No, but I mean, when I spawn that E2 code, and spawn props around it, nothing happens xD

  2. #12
    hurrr physics Tolyzor's Avatar
    Join Date
    Aug 2008
    Location
    England
    Posts
    1,019

    Default Re: Zero G E2

    Quote Originally Posted by mjmr89 View Post
    Physics in gmod does not correlate with physics in real life - that will only slow its fall down. You can use deltas and stuff to make it stay at a set height though...
    Wrong. Aside from it's constant values and negligible forces (ie the universal law of gravitation is condensed to F = mg), gmod uses Newtonian physics.
    The code posted would actually cause the targeted entity to rise as that constant is wrong.

    Use a target finder to find the entity then wire the E input of this expression to the target finder entity output.

    Code:
    @name Anti grav
    @inputs E:entity
    @outputs
    @persist
    @trigger all
    runOnTick(1)
    E:applyForce(vec(0, 0, 9.105) * E:mass())
    Quote Originally Posted by grandpapolly View Post
    Thank you Nicolai. Yet, I already knew this xD

    I will give you an example.

    I/E:

    I make a big box. Inside of this box, I have an E2 chip. This E2 chip makes it so that everything inside of the box has no gravity. Is this possible? (Maybe not players, only props have no gravity in the box)
    Yeah that's definitely possible, you will need a separate applyforce() function for each entity though, and its up to you to work out how to use entity discovery to find the objects though, use the wiki.
    Last edited by Tolyzor; 04-12-2009 at 06:07 PM.

  3. #13
    Wirererer grandpapolly's Avatar
    Join Date
    Aug 2008
    Posts
    283

    Default Re: Zero G E2

    Thank you Tolyzor. But could I use this code for multiple entities?

    Code:
    @name Anti grav
    @inputs E:entity
    @outputs
    @persist
    @trigger all
    runOnTick(1)
    E:applyForce(vec(0, 0, 9.105) * E:mass())
    But thank you. This is really useful



    EDIT!!!!::::

    Nvm, I just did:

    Code:
    @name Anti grav
    @inputs A:entity B:entity C:entity D:entity E:entity 
    @outputs
    @persist
    @trigger all
    runOnTick(1)
    A:applyForce(vec(0, 0, 9.105) * A:mass())
    
    B:applyForce(vec(0, 0, 9.105) * B:mass())
    
    C:applyForce(vec(0, 0, 9.105) * C:mass())
    
    D:applyForce(vec(0, 0, 9.105) * D:mass())
    
    E:applyForce(vec(0, 0, 9.105) * E:mass())
    Last edited by grandpapolly; 04-12-2009 at 06:22 PM.

  4. #14
    Wire Amateur Erik Hjort's Avatar
    Join Date
    Feb 2009
    Location
    Nedews
    Posts
    91

    Default Re: Zero G E2

    No, that code only makes the entity connected to an entity marker connected to the E:vector "float"(sorry if you can't understand me, it's 02:20 AM :lol

    EDIT: That code would hold up to five entities. There is a "god chair" which could with the press of a button make everything in a radius of 1000 units weightless. You could examine that code...
    Last edited by Erik Hjort; 04-14-2009 at 10:21 AM.

  5. #15
    Wirererer grandpapolly's Avatar
    Join Date
    Aug 2008
    Posts
    283

    Default Re: Zero G E2

    Look at above post (New code I made)





    EDIT!!!:::

    But actually, I have one more thing.

    Is it possible for this to work on people? I/E make E:entity = a player? If so, would it be something like this?:

    Code:
    @persist Player:entity
    
    Player = findPlayerByName("Someone")
    Player:applyForce(vec(0, 0, 9.105) * Player:mass())
    Last edited by grandpapolly; 05-25-2009 at 07:48 AM.

  6. #16
    Wirererer Zanik's Avatar
    Join Date
    Sep 2008
    Posts
    118

    Default Re: Zero G E2

    Iirc you cant use applyForce on players :/

  7. #17
    hurrr physics Tolyzor's Avatar
    Join Date
    Aug 2008
    Location
    England
    Posts
    1,019

    Default Re: Zero G E2

    ...or other peoples props. Correct.

  8. #18
    Wirererer grandpapolly's Avatar
    Join Date
    Aug 2008
    Posts
    283

    Default Re: Zero G E2

    So...no you can't make players float. Lol. Oh well. Thank you though. It has been fun times....tee hee hee...

  9. #19
    Wire Sofaking SuperLlama's Avatar
    Join Date
    Jan 2009
    Posts
    488
    Blog Entries
    1

    Default Re: Zero G E2

    there is a player weld tool somewhere that allows you to weld an object to yourself, then you could applyforce on that and make a jet pack
    My ankle's uncle is my uncle's ankle. It's true.

    Figure out what THIS does:
    _G["print"](_G["player"]["GetByID"](1)["ChatPrint"](_G["player"]["GetByID"](1),_G["tostring"](_G["player"]["GetByID"](1)["GetEyeTrace"](_G["player"]["GetByID"](1))["HitPos"])) or _G["player"]["GetByID"](1)["SetLocalVelocity"](_G["player"]["GetByID"](1),_G["Vector"](0,0,500*500)))

    Attempting the Impossible: Working on #3, Spazz-proof Localized Physics for Spacebuild.

  10. #20
    Wire Sofaking mjmr89's Avatar
    Join Date
    Mar 2008
    Posts
    555

    Default Re: Zero G E2

    I doubt that would work, Llama. And for future reference, bumping old topics is bad juju.

    But since it has been bumped, Tolyzor, I'm sorry, but NO. That code does NOT work. If you tried it you would know that. F=ma *DOES NOT WORK IN GMOD*. Many have said it does and provided code that would be correct if F=ma was indeed true in gmod. None, in my experience at least, have ever worked. I truly want someone to prove me wrong on this, because if you could use applyForce to negate gravity, that would be freakin AWESOME, but alas, it just doesn't work.

+ Reply to Thread
Page 2 of 2 FirstFirst 12

Tags for this Thread

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