+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Able to hide weapon and body?

  1. #1
    Wire Noob devilboy643's Avatar
    Join Date
    Mar 2010
    Posts
    6

    Default Able to hide weapon and body?

    Well I am currently almost finished with this E2 that makes it so when you crouch, a holographic box covers your body, like in metal gear. Well anyways, when I crouch, the hologram shows, my body goes invisible, but my weapon shows. Is there anyway to cloak my weapon when i crouch, and it uncloaks when i uncrouch.

    Here is the code if you need it...

    Code:
    @name Stealth Box
    @persist A 
    runOnTick(1)
    
    if ( first() ) {
        holoCreate(1)
    }
    if ( owner():isCrouch() ) {
        A=255
    }
    
    else {
       A=0
    }
       
    
    holoModel(1,"cube")
    holoScale(1,vec(3,3,3))
    holoParent(1,entity())
    holoMaterial(1,"phoenix_storms/fender_wood")
    holoPos(1,owner():pos()+vec(0,0,19))
    holoAlpha(1,A)
    
    if (A==255) {
        owner():setColor(0,0,0)
        owner():setMaterial("Models/effects/vol_light001")
    }
     
    
    
    
    elseif (A==0) {
        owner():setColor(255,255,255)
        owner():setMaterial("")
    }
    Last edited by Drunkie; 08-21-2010 at 04:24 PM. Reason: code tags mah boy

  2. #2
    Wire Sofaking Wodden's Avatar
    Join Date
    Sep 2007
    Location
    location.sh &> /dev/null
    Posts
    446

    Default Re: Able to hide weapon and body?

    Code:
    owner():weapon():setMaterial("Models/effects/vol_light001")
    “Saying Java is good because it works on all operating systems is like saying anal sex is good because it works on all genders.”

  3. #3
    Wire Noob devilboy643's Avatar
    Join Date
    Mar 2010
    Posts
    6

    Default Re: Able to hide weapon and body?

    I tried that before you suggested it. When I add that, whenever I crouch it shows and when I stand up it disapears.

  4. #4
    Wire Sofaking Wodden's Avatar
    Join Date
    Sep 2007
    Location
    location.sh &> /dev/null
    Posts
    446

    Default Re: Able to hide weapon and body?

    Maybe because you are switching weapons. If you "cloak" the physgun, all other weapons are visible.
    You could use a foreach loop and an array of all weapon names to turn all weapons visible/invisible.
    Code:
    @persist Weps:array
    
    #Set up teh array
    Weps:pushString("weapon_physcannon")
    Weps:pushString("weapon_physgun")
    Weps:pushString("weapon_pistol")
    Weps:pushString("weapon_357")
    Weps:pushString("weapon_smg1")
    Weps:pushString("weapon_crossbow")
    Weps:pushString("weapon_shotgun")
    Weps:pushString("weapon_ar2")
    Weps:pushString("weapon_frag")
    Weps:pushString("weapon_rpg")
    Weps:pushString("weapon_crowbar")
    Weps:pushString("gmod_tool")
    Weps:pushString("gmod_camera")
    
    #Turn every weapon visible/invisible
    foreach(K,V:string=Weps){
        owner():weapon(V):setMaterial("models/effects/vol_light001")
        #owner():weapon(V):setMaterial("")
    }
    Something like that.
    Last edited by Wodden; 08-22-2010 at 02:36 AM. Reason: It's weapon_frag :/
    “Saying Java is good because it works on all operating systems is like saying anal sex is good because it works on all genders.”

  5. #5
    Wire Noob devilboy643's Avatar
    Join Date
    Mar 2010
    Posts
    6

    Default Re: Able to hide weapon and body?

    Didnt help

  6. #6
    Wire Noob WeeZy's Avatar
    Join Date
    Aug 2010
    Posts
    5

    Default Re: Able to hide weapon and body?

    is there anyone who would know how to do it? both ways dont work

    p.s. this is devilboy643

  7. #7
    Ursus maritimus Drunkie's Avatar
    Join Date
    Feb 2009
    Location
    Canada
    Posts
    5,662
    Blog Entries
    1

    Default Re: Able to hide weapon and body?

    Setting the material to models/effects/vol_light001 works, I don't know what you're doing wrong.

  8. #8
    Wire Noob WeeZy's Avatar
    Join Date
    Aug 2010
    Posts
    5

    Default Re: Able to hide weapon and body?

    I think you cant hide your body and weapon.

  9. #9
    Wire Amateur Mr G's Avatar
    Join Date
    Aug 2010
    Posts
    36

    Default Re: Able to hide weapon and body?

    YOUR DOING IT WRONG!

    You cant setAlpha on players I believe.

  10. #10
    aka Colonel Never Online Colonel Thirty Two's Avatar
    Join Date
    Oct 2009
    Posts
    2,683
    Blog Entries
    5

    Default Re: Able to hide weapon and body?

    Code:
    Revision 2205
    [E2] setAlpha now works on the owner's weapons,
    setColor(N,N,N,N) and it's variants now affect the alpha of the owner's weapons.
    Don't think vol_light can be applied to >1 entity, so you can use vol_light on yourself and setAlpha on your weapon.

+ Reply to Thread
Page 1 of 2 12 LastLast

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