+ Reply to Thread
Page 11 of 75 FirstFirst ... 9101112132161 ... LastLast
Results 101 to 110 of 749
Like Tree5Likes

Thread: Cronus: The Ultimate Drone

  1. #101
    Wiremod Helper Lyinginbedmon's Avatar
    Join Date
    Mar 2009
    Location
    England
    Posts
    2,659

    Default Re: Cronus: The Ultimate Drone

    Quote Originally Posted by jperr15 View Post
    if a server has the wired wirer how you get it to set the outputs and inputs to wire with out first finding, what the entity's I/O names are?
    It can only wire to Wire entities, which all have the same inputs. Every Wire Turret has a Fire input, every Wire Prop Spawner has a Spawn and Undo input, for example.

    Quick code check folks while I toil away with the body part filter.[highlight=E2]if(BCheck){
    E = Props:entity(Check)
    if(!E:isFrozen() & !E:hasConstraints()){ #Not constrained/frozen
    Box = E:boxSize()
    L = Box:x() #Prop length
    W = Box:y() #Prop width
    H = Box:z() #Prop height

    Bod = Body:vector(Pierre)
    BX = Bod:x() #Body length
    BY = Bod:y() #Body width
    BZ = Bod:z() #Body height

    #Checking if the prop has lengths in the right ranges
    if(L < BX+GT & L > BX-GT){Pos++}
    if(W < BY+GT & W > BY-GT){Pos++}
    if(H < BZ+GT & H > BZ-GT){Pos++}

    #If the entity exists, the prop gets ++ if the ID is different
    #If the entity doesn't exist, the prop gets ++ by default
    if(Skull){ #Check against Skull ID
    if(E:id() !=Skull:id()){Pos += (1/7)}}
    else{Pos += (1/7)}

    if(Torso){ #Check against Torso ID
    if(E:id() !=Torso:id()){Pos += (1/7)}}
    else{Pos += (1/7)}

    if(Pelvis){ #Check against Pelvis ID
    if(E:id() !=Pelvis:id()){Pos += (1/7)}}
    else{Pos += (1/7)}

    if(Arm1){ #Check against Arm1 ID
    if(E:id() !=Arm1:id()){Pos += (1/7)}}
    else{Pos += (1/7)}

    if(Arm2){ #Check against Arm2 ID
    if(E:id() !=Arm2:id()){Pos += (1/7)}}
    else{Pos += (1/7)}

    if(Leg1){ #Check against Leg1 ID
    if(E:id() !=Leg1:id()){Pos += (1/7)}}
    else{Pos += (1/7)}

    if(Leg2){ #Check against Leg2 ID
    if(E:id() !=Leg2:id()){Pos += (1/7)}}
    else{Pos += (1/7)}

    #If the entity meets criteria, it gets assigned as per Pierre
    if(Pos == 4){
    if(Pierre == 2){
    Skull = E
    SiD = E:id()}

    Colors:setVector(2,Skull:getColor())
    Skull:setMaterial(Skins:string(Pierre))
    }
    elseif(Pierre == 3){
    Torso = E
    TiD = E:id()

    Colors:setVector(3,Torso:getColor())
    Torso:setMaterial(Skins:string(Pierre))
    }
    elseif(Pierre == 4){
    Pelvis = E
    PiD = E:id()

    Colors:setVector(4,Pelvis:getColor())
    Pelvis:setMaterial(Skins:string(Pierre))
    }
    elseif(Pierre == 5){
    Arm1 = E
    A1iD = E:id()

    Colors:setVector(4,Arm1:getColor())
    Arm1:setMaterial(Skins:string(Pierre))
    }
    elseif(Pierre == 6){
    Arm2 = E
    A2iD = E:id()

    Colors:setVector(5,Arm2:getColor())
    Arm2:setMaterial(Skins:string(4))
    }
    elseif(Pierre == 7){
    Leg1 = E
    L1iD = E:id()

    Colors:setVector(6,Leg1:getColor())
    Leg1:setMaterial(Skins:string(Pierre))
    }
    elseif(Pierre == 8){
    Leg2 = E
    L2iD = E:id()

    Colors:setVector(7,Leg2:getColor())
    Leg2:setMaterial(Skins:string(Pierre))
    }

    Pos = 0
    Check = 0
    BCheck = 0
    }
    else{
    Pos = 0
    if(Check != Props:count()){Check++}
    else{Check = 0,BCheck = 0}
    }
    else{Check++}
    }[/highlight]Apparently there's an improperly-placed or missing "}" bracket here, because the validation says that the last else needs to be part of an if statement, but I've been looking over it for a little while now and I can't find it anywhere.

    The Feint subroutine will function much like the Stealth subroutine, except it'll turn the Motion controls for the body props off and only stealth the E2 chip.

    And something actually useful: The Stealth subroutine.[highlight=E2]if(Stealth)
    Part = Bparts:entity(Mark)

    Part:setMaterial("models/shiny")
    Part:setColor(0,0,0,0)

    SMark++

    Part = Bparts:entity(Mark)

    Part:setMaterial("models/shiny")
    Part:setColor(0,0,0,0)

    SMark++

    Part = Bparts:entity(Mark)

    Part:setMaterial("models/shiny")
    Part:setColor(0,0,0,0)

    SMark++

    Part = Bparts:entity(Mark)

    Part:setMaterial("models/shiny")
    Part:setColor(0,0,0,0)

    SMark++

    Part = Bparts:entity(Mark)

    Part:setMaterial("models/shiny")
    Part:setColor(0,0,0,0)

    SMark++

    Part = Bparts:entity(Mark)

    Part:setMaterial("models/shiny")
    Part:setColor(0,0,0,0)

    SMark++

    Part = Bparts:entity(Mark)

    Part:setMaterial("models/shiny")
    Part:setColor(0,0,0,0)

    SMark++

    Part = Bparts:entity(Mark)

    Part:setMaterial("models/shiny")
    Part:setColor(0,0,0,0)

    SMark = 1}
    else{
    Part = Bparts:entity(Mark)

    Part:setMaterial(Skins:string(Mark))
    Part:setColor(Colors:vector(Mark),255)

    SMark++

    Part = Bparts:entity(Mark)

    Part:setMaterial(Skins:string(Mark))
    Part:setColor(Colors:vector(Mark),255)

    SMark++

    Part = Bparts:entity(Mark)

    Part:setMaterial(Skins:string(Mark))
    Part:setColor(Colors:vector(Mark),255)

    SMark++

    Part = Bparts:entity(Mark)

    Part:setMaterial(Skins:string(Mark))
    Part:setColor(Colors:vector(Mark),255)

    SMark++

    Part = Bparts:entity(Mark)

    Part:setMaterial(Skins:string(Mark))
    Part:setColor(Colors:vector(Mark),255)

    SMark++

    Part = Bparts:entity(Mark)

    Part:setMaterial(Skins:string(Mark))
    Part:setColor(Colors:vector(Mark),255)

    SMark++

    Part = Bparts:entity(Mark)

    Part:setMaterial(Skins:string(Mark))
    Part:setColor(Colors:vector(Mark),255)

    SMark++

    Part = Bparts:entity(Mark)

    Part:setMaterial(Skins:string(Mark))
    Part:setColor(Colors:vector(Mark),255)

    SMark = 1}[/highlight]I'm thinking of changing the active section to a looping sequence that randomises the actual colour (Not the alpha), so they opponents can't just have an auto-turret look for anything black and invisible. 255x255x255 equates to about 16.5 million possible colours (~4,230.25 million if you include alpha, but that would defeat the stealth aspect).

    EDIT: And so I did [highlight=E2]#Stealth subroutine
    if(Stealth){
    timer("stealth",10)
    if(clk("stealth")){
    X = round(random(0,255))
    Y = round(random(0,255))
    Z = round(random(0,255))

    Col = vec(X,Y,Z)

    Part = Bparts:entity(Mark)

    if(Part:getMaterial() != "models/shiny"){Part:setMaterial("models/shiny")}
    Part:setColor(Col,0)

    if(Smark != Bparts:count()){Smark++}
    else{Smark = 1,DSmark = 1}}
    else{ #Aka the Destealth subroutine
    timer("destealth",10)
    if(clk("destealth")){
    Part = Bparts:entity(Mark)

    Part:setMaterial(Skins:string(DSmark))
    Part:setColor(Colors:vector(DSmark),255)

    if(DSmark != Bparts:count()){DSmark++}
    else{DSmark = 1,Smark = 1,stoptimer("destealth")}}}[/highlight]New variables: Stealth, Smark, DSmark
    Last edited by Lyinginbedmon; 06-23-2009 at 03:08 AM.

  2. #102
    Spucatum Tauri Bull's Avatar
    Join Date
    Jun 2008
    Location
    Finland
    Posts
    6,010

    Default Re: Cronus: The Ultimate Drone

    Quote Originally Posted by Lyinginbedmon View Post
    [highlight=E2]
    if(E:id() !=Skull:id()){Pos += (1/7)}}
    else{Pos += (1/7)}[/highlight]
    IF E:id() is NOT equal THEN Pos += (1/7)
    ELSE Pos += (1/7)
    When it doesn't do anything different either way, isn't the whole IF statement pointless then?

    Quote Originally Posted by Lyinginbedmon View Post
    [highlight=E2]
    Pos = 0
    if(Check != Props:count()){Check++}
    else{Check = 0,BCheck = 0}
    }
    } # <-- I seem to miss this one
    else{Check++}
    }[/highlight]
    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.

  3. #103
    Wiremod Helper Lyinginbedmon's Avatar
    Join Date
    Mar 2009
    Location
    England
    Posts
    2,659

    Default Re: Cronus: The Ultimate Drone

    If the Skull entity is true, then it only gets the +1/7 if it's ID is not the same as the Skull entity's ID. If the Skull entity is false, then by default the ID is not the same as the Skull ID.

    Note that the first line of that quoted code chunk ends in a pair of curly brackets, you snipped off the first If statement

    That whole segment was rewritten that way so I could be 100% certain it wasn't the part that was messing up the code.

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

    Default Re: Cronus: The Ultimate Drone

    Meh, you code crappy :P
    Code:
    if(Skull){     #Check against Skull ID
        if(E:id() !=Skull:id()) {
            Pos += (1/7)
        }
    }
    else{
        Pos += (1/7)
    }
    Much easier to read.
    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. #105
    Wiremod Helper Lyinginbedmon's Avatar
    Join Date
    Mar 2009
    Location
    England
    Posts
    2,659

    Default Re: Cronus: The Ultimate Drone

    Personally I find[highlight=E2]if(Skull){
    if(E:id() != Skull:id()){Pos += (1/7)}}
    else{Pos += (1/7)}[/highlight]to be easier to read. Either way I can easily cut that whole chunk back once I'm certain it's not interfering with the filtration process.

  6. #106
    Master of Mars Magos Mechanicus's Avatar
    Join Date
    May 2008
    Posts
    852

    Default Re: Cronus: The Ultimate Drone

    Trying to get the animation on the road; still needs some time apparently. My first tests with scaling the drone up/down depending on the props it has look good, though

    The arms look a bit weird since the same orientation puts the longest dimension in a different direction, but otherwise it's matching quite well.
    Attached Thumbnails Attached Thumbnails Cronus: The Ultimate Drone-gm_construct0025.jpg  
    I can wire anything directly into anything! I'm the Professor!
    -Professor Hubert Farnsworth

  7. #107
    Wiremod Helper Lyinginbedmon's Avatar
    Join Date
    Mar 2009
    Location
    England
    Posts
    2,659

    Default Re: Cronus: The Ultimate Drone

    I've noticed the orientation of that method is a bit lackadaisical, which is probably due to a low multiplier in the offset code.

    I know it exists so does anyone know the formula for finding the right multiplier for a given mass value? Presumably it exists in a god chair or anti-grav field code but I've yet to find one with the code readily available for perusal.

    Hmm...as far as Superllama goes in this thread, it's simply E:mass(), but to get rapidly responsive action on a red cargo container I had to use 80,000 and it's mass is only 10,000 so that seems fairly cavalier.

    Additionally: Your current base orientation code has all the props at a 90-degree angle and several units away from the orienting chip. Ideally it should orient from the Skull prop (Or it's hypothetical position) so that the chip is free to do what it needs to.
    Last edited by Lyinginbedmon; 06-23-2009 at 06:52 AM.

  8. #108
    Wirererer malum's Avatar
    Join Date
    Feb 2009
    Posts
    217

    Default Re: Cronus: The Ultimate Drone

    mass * 8? xD

  9. #109
    Wiremod Helper Lyinginbedmon's Avatar
    Join Date
    Mar 2009
    Location
    England
    Posts
    2,659

    Default Re: Cronus: The Ultimate Drone

    Quote Originally Posted by malum View Post
    mass * 8? xD
    Which would make sense, but it flies counter to the god chair equation of just E:mass()

    I've also been doing some work on the standard hurl-body-parts-at-it-until-it-dies code and I've come to the conclusion that we'll definitely need flipswitch variables to disable and enable the standard body positioning as regards each individual body part.

  10. #110
    Wire Noob kebab123's Avatar
    Join Date
    Dec 2007
    Posts
    23

    Default Re: Cronus: The Ultimate Drone

    From what I've heard you should always be using inertia and not mass to adjust the force. Not sure about how, though. What I usually do is just play with multiplying my base vector and dividing the velocity.

    I'm quite interested in your angle modifying code, Magos. I have looked over it some and I'm wondering if you know of an easy way to force certain angles? I have gotten my own applyOffsetForce code to follow the angles of my view or another prop, but I still haven't found a good way to lock a rotational axis at a set angle or just to stop it from moving around.

+ Reply to Thread
Page 11 of 75 FirstFirst ... 9101112132161 ... LastLast

LinkBacks (?)

  1. 03-01-2010, 04:44 PM
  2. 02-02-2010, 03:00 PM

Similar Threads

  1. Ultimate Rave Machine
    By Error 404 in forum Finished contraptions
    Replies: 11
    Last Post: 04-20-2009, 06:46 PM
  2. The ultimate commanders chair
    By Shadow7 in forum Ideas & Suggestions
    Replies: 7
    Last Post: 02-11-2009, 10:03 AM
  3. Ultimate Gmod Pack
    By -Gamah in forum Off-Topic
    Replies: 21
    Last Post: 08-28-2008, 05:37 AM

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