+ Reply to Thread
Results 1 to 6 of 6

Thread: Trebuchet w/ Grabber

  1. #1
    Inactive Subliminal268 is on a distinguished road Subliminal268's Avatar
    Join Date
    Jan 2008
    Posts
    42

    Default

    K so I'm making a trebuchet with a grabber that picks up the ammunition. On the main beam of the trebuchet I have a gyroscope, so that when the beam's angle exceeds 45 degrees, the grabber releases.

    I've fiddled around with how to get the grabber to work for several hours now. At the moment, I have a 1x1 PHX plate with a negative forcer attached to the middle, and a grabber just next to the negative forcer. I've linked the grabber to the plate.

    I have the negative forcer wired to the following expression gate:

    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-spacere;overflow:auto'>Button == 0 & Pitch < 45 -> Force = 100000;
    Button == 0 & Pitch > 45 -> Force = 0;
    Button == 1 & Pitch < 45 -> Force = 100000;
    Button == 1 & Pitch > 45 -> Force = 0;
    Button == 0 & Pitch < 45 -> Velocity = -100;
    Button == 0 & Pitch > 45 -> Velocity = 0;
    Button == 1 & Pitch < 45 -> Velocity = -100;
    Button == 1 & Pitch > 45 -> Velocity = 0;</div>

    That seems to be working (it pulls in whatever object i put in range of it).

    Then, I have the grabber wired to the following expression gate:

    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-spacere;overflow:auto'>Button == 0 & Pitch < 45 -> Strength = 100000;
    Button == 0 & Pitch > 45 -> Strength = 0;
    Button == 1 & Pitch < 45 -> Strength = 100000;
    Button == 1 & Pitch > 45 -> Strength = 0;
    Button == 0 & Pitch < 45 -> Grab = 1;
    Button == 0 & Pitch > 45 -> Grab = 0;
    Button == 1 & Pitch < 45 -> Grab = 1;
    Button == 1 & Pitch > 45 -> Grab = 0;</div>

    If you're asking yourself why I have the button in the code at all it's because for some reasonI was going back and forth in my head whether it needed to be there or not to prevent it from grabbing any part of the trebuchet after it had released(im a bit spacy today) and I figured it wouldn't hurt if it was there.

    Anyway... I'm not sure if the grabber is doing anything or not... but I do know that the negative forcer pulls the object in. But, when I release the trebuchet, the object gets released pretty much right away (I'm positive that the beam hasn't hit 45 degrees yet when it gets released).

    Anyone know what I'm doing wrong? I've never worked with forcers or grabbers before so I've just been doing trial and error.

  2. #2
    Lifetime Supporter shadowkeeper will become famous soon enough shadowkeeper's Avatar
    Join Date
    Jul 2007
    Location
    Heffen, Belgium
    Posts
    466

    Default

    try this:

    Code:
    N@Forcer & grabber control
    I@Button Pitch Range
    O@Force Velocity Grab
    Force=(Button & Pitch <= 45 ? 100000 : 0)
    Velocity=(Button & Pitch <= 45 ? -100 : 0)
    Grab=(Range <= 25 & Button & Pitch <= 45 ? 1 : 0)
    
    how this works: as long as the button (or some other input of your choosing) outputs a 1 and the pitch angle is smaller or equal to 45° the forcer will pull anything in and the grabber will hold anything it can see, and that's close enough (use a ranger for that), in place (the reason for this is that you don't want the forcer to try to weld to world, and actually weld to the prop you want to fire)
    now, it might need tweaking but that's up to how it responds ingame
    I am nowhere, yet I am everywhere, I am the eyes that don't see but see all, I am therefore I live


  3. #3
    Inactive Subliminal268 is on a distinguished road Subliminal268's Avatar
    Join Date
    Jan 2008
    Posts
    42

    Default

    alright thanks i can't try it now cuz i gotta go but I'll try it as soon as possible.
    And I just realized something maybe an hour or so ago when i was just thinking to myself how the grabber works. Then I remembered someone saying the grabber welds the object in its range to the object that it's linked to. Then I realized the strength input on the grabber is the same as the strength of a weld, so 0 strength would just mean the weld never breaks due to force. And then I realized maybe the object that the grabber is grabbing has to be in range, and THEN the grab input has to change from 0 to 1 (the way I had it, it was just always 1 when the pitch was below 45 degrees.. and I figured that whenever an object came into the range of the grabber and the grabber was already at 1, it would weld).

    Kind of confusing what i just said.. but basically strength = strength of weld... and to make the grabber grab something, the input must change from 0 to 1 WHILE something is in its range. It can't be at 1 and THEN put something in its range. Is that right?

  4. #4
    Inactive Subliminal268 is on a distinguished road Subliminal268's Avatar
    Join Date
    Jan 2008
    Posts
    42

    Default

    K i've tried it. I adjusted the grabber to release at 87.5 instead of 45 because at 45 the object would go backwards. Tried 85 and the sling released too early and the object went high but not far... at 88 it wouldn't release at all (there's a bar that stops the main beam) so I did 87.5.

    Seems to work well. It launches the small cannonball a distance of approx. 1750 which is not as good as I had hoped for... but for the small size of the trebuchet I guess it's not too bad. Maybe I'll lengthen the main beam a bit and see if that doesn't do help at all

    thanks =)

  5. #5
    Wire Sofaking Whodunnit will become famous soon enough Whodunnit's Avatar
    Join Date
    Jan 2008
    Location
    New Zealand, Ackl
    Posts
    482

    Default

    i had a similar idea using a weldlatch, but this is better , nice!
    ЗАГРУЗКА...................

  6. #6
    Lifetime Supporter shadowkeeper will become famous soon enough shadowkeeper's Avatar
    Join Date
    Jul 2007
    Location
    Heffen, Belgium
    Posts
    466

    Default

    but basically strength = strength of weld... and to make the grabber grab something, the input must change from 0 to 1 WHILE something is in its range. It can't be at 1 and THEN put something in its range. Is that right?[/b]
    that's right, and that's why I sugested the ranger-enabled activation of the grabber

    now what I can suggest is that you have the forcer change from pulling to pushing when you reach the release point, this will push your ammo further, with higher velocity.

    Code:
    N@Forcer & grabber control
    I@Button Pitch Range
    O@Force Velocity Grab
    Force=(Button & Pitch <= 45 ? 100000 : 0)
    Velocity=(Button & Pitch <= 45 ? -100 : (Button & Pitch > 80 ? 100 : 0))
    Grab=(Range <= 25 & Button & Pitch <= 87.5 ? 1 : 0)
    
    details: the moment the trebuchet arm passes an 80° angle the forcer starts pushing on your prop, and once it passes 87.5 the grabber releases the ammo with the extra force applied, might be worth trying
    I am nowhere, yet I am everywhere, I am the eyes that don't see but see all, I am therefore I live


+ Reply to Thread

Similar Threads

  1. Warwick Castle Trebuchet
    By Rimmer in forum Contraptions & Saves
    Replies: 50
    Last Post: 06-17-2009, 05:36 AM
  2. Trebuchet
    By oenmaster in forum Contraptions & Saves
    Replies: 7
    Last Post: 01-16-2009, 04:34 PM
  3. Several trebuchet types
    By xk4melot in forum Contraptions & Saves
    Replies: 15
    Last Post: 01-09-2009, 10:11 PM
  4. Automated trebuchet
    By Lieutent Slappy Moose in forum Contraptions & Saves
    Replies: 11
    Last Post: 07-12-2008, 07:01 AM
  5. Wire release mechanism for a trebuchet
    By Luke_M in forum Help & Support
    Replies: 11
    Last Post: 11-19-2007, 06:35 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