+ Reply to Thread
Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 31

Thread: Builder Buddy (WIP)

  1. #21
    Wirererer Zantier's Avatar
    Join Date
    Feb 2008
    Posts
    333

    Default Re: Builder Buddy (WIP)

    might want to stick a lower() in there, but yes =p

  2. #22
    Wire Sofaking Rybec's Avatar
    Join Date
    Apr 2008
    Location
    Denver
    Posts
    648

    Default Re: Builder Buddy (WIP)

    Not to mention none of that fits into the format the rest of the system uses, lol.

  3. #23
    No u Divran's Avatar
    Join Date
    Jul 2008
    Location
    Sweden
    Posts
    4,582

    Default Re: Builder Buddy (WIP)

    Quote Originally Posted by Rybec View Post
    Not to mention none of that fits into the format the rest of the system uses, lol.
    The way I used is the best way I've found so far. I'd recommend using it, unless anyone has a better way.

    Sometimes I make variables such as:
    Code:
    M = lastSaid():explode(" ")
    M1 = M[1,string]
    M2 = M[2,string]
    If I use M1 and M2 very often, because it's shorter to write than M[1/2,string]
    SVN Tutorial
    My SVN:
    Code:
    http://divranspack.googlecode.com/svn/trunk/%20divranspack/
    Get dropbox and get 250 MB extra space: Dropbox

  4. #24
    Wirererer Elmo the Emo Emperor's Avatar
    Join Date
    Feb 2008
    Location
    Lagville(Austrlia)
    Posts
    278

    Default Re: Builder Buddy (WIP)

    And uses less ops() then constantly recalling the date from the array. (I think)

  5. #25
    No u Divran's Avatar
    Join Date
    Jul 2008
    Location
    Sweden
    Posts
    4,582

    Default Re: Builder Buddy (WIP)

    Quote Originally Posted by Elmo the Emo Emperor View Post
    And uses less ops() then constantly recalling the date from the array. (I think)
    I'm not so sure variables use less ops than arrays.
    SVN Tutorial
    My SVN:
    Code:
    http://divranspack.googlecode.com/svn/trunk/%20divranspack/
    Get dropbox and get 250 MB extra space: Dropbox

  6. #26
    Wire Sofaking Rybec's Avatar
    Join Date
    Apr 2008
    Location
    Denver
    Posts
    648

    Default Re: Builder Buddy (WIP)

    Quote Originally Posted by Divran View Post
    The way I used is the best way I've found so far. I'd recommend using it, unless anyone has a better way.

    Sometimes I make variables such as:
    Code:
    M = lastSaid():explode(" ")
    M1 = M[1,string]
    M2 = M[2,string]
    If I use M1 and M2 very often, because it's shorter to write than M[1/2,string]
    That's basically what I'm doing.
    But this isn't about how to code it, this is about IDEAS.
    I finished the stacker helper (or at least the basic form, I may add circle calculations or something), and it may be the greatest thing ever made ever. I'll post stuff later, I have to get to class.


    EDIT: Is it worth making it remember per-side offsets and rotations for stacker? What about making it store these offsets per-model, and keeping them cross-session?
    Last edited by Rybec; 11-07-2009 at 12:54 PM.

  7. #27
    Wire Sofaking Rybec's Avatar
    Join Date
    Apr 2008
    Location
    Denver
    Posts
    648

    Default Re: Builder Buddy (WIP)

    Well I seem to have hit a wall. I tried making it store offsets per-side and per-model. it does this by reading convars/using concmd.

    Problem is, the values keep getting confused with each other due to some unseen delay somewhere. Yesterday it started deciding to randomly subtract 0.01 from all the values.
    It's an insanely useful feature, but it's almost unusable in ti's current state. I've tried everything I can think of.

    Only reason for it that I can think of is that it's reading and storing the convars before the ones for the new side actually take effect.
    At this point, I actually could use a little code advice.

    Code:
    #Stacker
    if (Mode==4 & owner():weapon():type()=="gmod_tool" & owner():tool()=="ol_stacker"){ 
        if (owner():aimEntity():owner()==owner()){
            Ent=owner():aimEntity()
        }
        else {
            Ent=noentity()
        }
        if (Ent:type()=="prop_physics"){
            Dir=Ent:toLocal(Ent:pos()+owner():eyeTrace():hitNormal())
            if (!changed(Dir)){
                if(!Delay) {
                    #Read the convars, round them to 3 decimal places.
                    STR=round(convarnum("ol_stacker_offsetx"),3)+"|"+round(convarnum("ol_stacker_offsety"),3)+"|"+round(convarnum("ol_stacker_offsetz"),3)+"|"+round(convarnum("ol_stacker_rotp"),3)+"|"+round(convarnum("ol_stacker_roty"),3)+"|"+round(convarnum("ol_stacker_rotr"),3)
                    if (STR!=OLDSTR){
                        #Removes models/ from the path, in an attempt to save filesize.
                        #Filesize is my main concern right now, work with enough different props and it could conceivably become too large.
                        #Each path gets saved up to 6 times with a number in front of it for the side.
                        Model=StackDir+Ent:model():sub(8)
                        Stacker[Model,string]=STR
                    }
                    OLDSTR=STR
                    Delay=1
                    timer("delay",30)
                }
            }
            else {
                if (Dir:x()>0.8){
                    StackDir=3
                }
                if (Dir:x()<-0.8){
                    StackDir=4
                }
                if (Dir:y()>0.8){
                    StackDir=6
                }
                if (Dir:y()<-0.8){
                    StackDir=5
                }
                if (Dir:z()>0.8){
                    StackDir=1
                }
                if (Dir:z()<-0.8){
                    StackDir=2
                }
                concmd("ol_stacker_dir "+StackDir)
                Model=StackDir+Ent:model():sub(8)
                if (Stacker[Model,string]){
                    Offsets=Stacker[Model,string]:explode("|")
                }
                else {
                    Offsets="0|":repeat(6):explode("|")
                }
                concmd("ol_stacker_offsetx "+Offsets[1,string])
                concmd("ol_stacker_offsety "+Offsets[2,string])
                concmd("ol_stacker_offsetz "+Offsets[3,string])
                concmd("ol_stacker_rotp "+Offsets[4,string])
                concmd("ol_stacker_roty "+Offsets[5,string])
                concmd("ol_stacker_rotr "+Offsets[6,string])
            }
        }
    }
    In my attempts to fix this, I made it not store values when it needs to write them, and then I also made it not try to write the values unless they changed. I also added a 30 ms delay between writes. (all the delay timer does is set Delay to 0, all my timers are the last things to run in the code.)

    I just thought that maybe I can move the delay to occur after I WRITE the values, so I'll try that. Any other ideas are welcome.

    Other than that, anyone have any ideas on how I can "compress" the model path to save filesize? Saving the entire model path 6 times for each different model will eat up space pretty quick if you use the stacker with a lot of different props.
    I'm looking into hash algorithms at the moment, should be able to come up with something simple to reduce any string to some small hex number or something easy to calculate.
    EDIT: nevermind this part, I grew a brain and realized I can glon inside of gloned glon. One index for the model storing an array containing arrays of the values. Whee.
    Last edited by Rybec; 11-09-2009 at 06:34 PM.

  8. #28
    Wire Sofaking Whodunnit's Avatar
    Join Date
    Jan 2008
    Location
    New Zealand, Ackl
    Posts
    636

    Default Re: Builder Buddy (WIP)

    tbh i think this would be better as a seperate ent , but whatever, E2 is ok i guess.
    ЗАГРУЗКА...................

  9. #29
    Wire Sofaking Rybec's Avatar
    Join Date
    Apr 2008
    Location
    Denver
    Posts
    648

    Default Re: Builder Buddy (WIP)

    Okay, I think I've gotten it about as close to working as I can. However, I'm still seeing some issues.

    I'd like some beta testers before I release this publicly, PM me if you're interested. I need people who can test this with the intent of trying to break or confuse it. Mainly I need testing for the Stacker mode, I'm still getting some rounding errors in multiplayer.

  10. #30
    Wire Noob Pnemesis's Avatar
    Join Date
    Feb 2010
    Posts
    12

    Default Re: Builder Buddy (WIP)

    Nice ^^ more i can't because i can't do it my self =P


    Sry For my bad English i am from Austria Accept it ^^

+ Reply to Thread
Page 3 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. Automatic Floating (Turret) Buddy
    By no_one in forum Expression 2 Discussion & Help
    Replies: 7
    Last Post: 05-17-2009, 02:33 PM
  2. Orbiting chip buddy!
    By zeroxore in forum Expression 2 Discussion & Help
    Replies: 11
    Last Post: 05-12-2009, 08:09 PM
  3. Builder's Lounge (building/contraptions only)
    By Sparrowhawk in forum Servers
    Replies: 0
    Last Post: 02-29-2008, 06:20 PM
  4. I.C. Builder
    By philxyz in forum Ideas & Suggestions
    Replies: 16
    Last Post: 02-09-2008, 01:19 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