Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Gmod trebuchet tutorial part 2.

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
4,048
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Oct 17, 2008

In this part I show you how to make the auto release. and why you need a sling.

Expression 2 CODING MADE BY MOSSMAN

!!MORE THAN SIGN!! is replaeced with a more than sign K?

If you want the E2 code, here it is:
@name Trebuchet
@inputs
@outputs Grab
@persist Arm:entity
interval(10)
Arm=entity():isWeldedTo()
if(Arm:angles():pitch()!!MORE THAN SIGN!!20) {Grab=0}
if(Button) {Grab=1}

That should work, I havn't tested it though. Incase you're wondering why I didn't put a Gyro input or what the Arm variable does, well, E2 can function as other components. It can get angles, entitys, Vectors, all that good shit. So I just got the entity of the arm and got it's pitch.

Category:

Education

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (DaleSparrow)

  • Ok I got the trebuchet to work at last, auto release mechanism and all, here is what I did for all the others that are stuck.

    1. Sparrows code, I can't get it to work and I believe its wrong. I'm not sure about his expression 1 code but his expression 2 code certainly seems to have something wrong with it.

    I recommend this as expression 2 code, TESTED AND WORKS ;

    @name

    @inputs Button Gyro

    @outputs Grab

    @persist Gyro

    @trigger

    if(Button) {Grab = 1}

    if(Gyro < 20) {Grab=0}

  • @SpinDizzyMR thanks, I did not make the xp2 code but yours is perfect.

  • Well actually my main problem is, everytime I spawn my expression 2 chip, I get an error saying button does not exist.

    Whether the button you make later on is present or not.

  • @SpinDizzyMR Oh ok, i think its because you have not declared it as a variable then. In the inputs thing (@inputs)  you have to declare "button"

  • i have a little problem with the expresion, i'm doing everything right with E2 and all he says is that there is a white space infront of the " : ", but there isn't anything there, some1 pls help

  • @SuperHardstyleaddict You have to delete any spaces on that line. >.> this comment was posted 3 months ago... I never saw it, sorry.

see all

All Comments (62)

Sign In or Sign Up now to post a comment!
  • i got exspetion chip to work but it does not grap the object when i click the button ive tryed toggel an non togel but both dont work i can only get it to grab when i wire it to a constant value with strength set high and wire it stright to the button when its toggeled but if i wire it to the exsption it does not grap??? why is this?

  • how did u get the expression chip

  • i keep getting this thing that says expected (() at (<)

  • A way to use all of the potencial energy of the fridge would be making the pole longer. You need more energy to move an objet longer and there is nothing bad to "waste" the energy of the fridge with a longer pole, since making the pole longer would make the sling go fater. You are actually tranfering the energy to the object and so it will go fater.

  • @DaleSparrow

    After a lot of trail and error, closest I get it to working is, pressing the button makes the grabber grab something, and pressing it again makes it release ti again.

    But the grabber wont autorelease when I make it catapult into the air, prop stays stuck to the grabber.

  • I figured out before you replied that to get the expression 2 chip to function, button needs to be added to the inputs.

    I also figured out that you can use either the expression 1 chip method or the expression 2 chip method, not make both chips, that confused me for a while.

    Still it doesnt help as the grabber simply wont grab anything, I don't know how to make it grab. I assumed if you held something over the white line of the grabber t would automaticly cling to it.

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more