Results 1 to 9 of 9
  1. #1
    Iron Guard
    Join Date
    Jun 2008
    Location
    at computer
    Posts
    514

    Default how to hide weapon bases..

    Greetings, trying to hide weapon bases of some pickups but whatever i do, the weapon bases dont get removed from the game. was guessing its because there bstatic or somthing. i ripped the code out of the instagib mutator as this does what i want but for some reason its not working. the code im trying to make just removes certain pickups and that all works fine but removign the pickup bases at all even using the instagib code with no changes doesnt want to work.. think i must of missed somthing

    code i ripped was.. (in mutator class)

    Code:
    simulated function BeginPlay ()
    {
      local xPickUpBase P;
      local Pickup L;
    
      foreach AllActors(Class'xPickUpBase',P)
      {
        P.bHidden = True;
        if ( P.myEmitter != None )
        {
          P.myEmitter.Destroy();
        }
      }
      foreach AllActors(Class'Pickup',L)
      {
        if ( L.IsA('WeaponLocker') )
        {
          L.GotoState('Disabled');
        }
      }
      Super.BeginPlay();
    }
    
    function bool CheckReplacement (Actor Other, out byte bSuperRelevant)
    {
      if ( Other.IsA('Pickup') )
      {
        if ( Other.bStatic || Other.bNoDelete )
        {
          Other.GotoState('Disabled');
        }
        return False;
      }
      bSuperRelevant = 0;
      return True;
    }
    
    defaultproperties
    {
      bNetTemporary=True
      bAlwaysRelevant=True
      RemoteRole=2
    }
    any thoughts on what iv missed out? or another way of doing it, TAM does it too but those changes are also in the playerclass and was hoping not to touch those

    thanks
    //=========
    // ~NightMan
    //=========

  2. #2
    MSgt. Shooter Person
    Join Date
    Apr 2008
    Posts
    58

    Default

    The code you have pasted is not set to hide weapon bases. Its set to go through all classes and subclasses of xPickUpBase and set them to hidden and set all pickup classes that are weapon lockers to disabled. I looked at the disabled state of weapon locker and all it appears to do is remove the weapons that are normally hanging from said locker.
    You could try adding L.bHidden = true; to the second foreach (so it would look like:
    foreach AllActors(Class'Pickup',L)
    {
    if ( L.IsA('WeaponLocker') )
    {
    L.GotoState('Disabled');
    L.bHidden = true;
    }
    }
    )
    I do believe that weapon lockers cast shadows and are not hidden because it would produce a shadow with no discernible source at runtime.
    /

  3. #3
    Iron Guard
    Join Date
    Jun 2008
    Location
    at computer
    Posts
    514

    Default

    Quote Originally Posted by Vaporlynx View Post
    The code you have pasted is not set to hide weapon bases. Its set to go through all classes and subclasses of xPickUpBase and set them to hidden and set all pickup classes that are weapon lockers to disabled.
    weaponbase is a subclass of xpickupbase so it should hide them as well. overall i want to hide specific weaponbases/weapons/pickups and replace some others with different pickups, i can do most of it but the pickupbases dont get hidden even tho the code should work. i should point out i forgot to add, offline the code works perfect, the moment i run it on a server is when it stops working and i dont run any other mutators along side it that could effect it.

    Quote Originally Posted by Vaporlynx View Post
    I looked at the disabled state of weapon locker and all it appears to do is remove the weapons that are normally hanging from said locker.
    You could try adding L.bHidden = true; to the second foreach (so it would look like:
    foreach AllActors(Class'Pickup',L)
    {
    if ( L.IsA('WeaponLocker') )
    {
    L.GotoState('Disabled');
    L.bHidden = true;
    }
    }
    )
    ah ok, most DM maps dont have weaponlockers, kept it in as a placeholder to fix up later, well spotted tho, will check that out thx
    //=========
    // ~NightMan
    //=========

  4. #4
    MSgt. Shooter Person
    Join Date
    Mar 2009
    Location
    .no
    Posts
    174

    Default

    Try setting bNetTemporary false. (Rationale: Since there is no replication block, maybe the engine decides it doesn't do anything (optimizations), and thus won't invoke simulated function calls? If not, the problem probably lies outside the box. x))
    "Those are tears, Jefferson!"
    @ModDB | @Twitter | @UnrealWiki

  5. #5
    Banned
    Join Date
    Feb 2011
    Location
    BXL/Paris
    Posts
    2,169

    Default

    Instate of L.bHidden = true try L.SetDrawType(DT_None), that should fix replication as well.

    ...or in xPickUpBase set PowerUp to None, that will disable SpawnPickup and do this in CheckReplacement, because it run before level start up.

    BTW. Can you post whole code?
    Last edited by VendorX; 02-12-2012 at 07:01 PM.

  6. #6

    Default

    Why don't you post your full code up here.
    Also make sure you're actually running your mutator. If you're testing on a server, make sure the mutator is added into the server packages and in the game configuration.

  7. #7
    Iron Guard
    Join Date
    Jun 2008
    Location
    at computer
    Posts
    514

    Default

    Quote Originally Posted by Wail of Suicide View Post
    Why don't you post your full code up here.
    that was the full code, i removed everything else just to eliminate it from the problem. there was nothing else in the class and i deleted all other classes.

    tried everything and none of it worked. so i tried running the actualy MutInstaGib mut on the server and guess what! i see weaponbases. so im guessing theres somthing wrong with the server and the codes fine as the offical mut works fine on other servers for normal DM i think.. no idea whats causing it tho, the muts def in the gameconfig/server packages etc and its certainly running. servers running latest patch/files as far as im aware so dunno. iv made quite a few mods and tested them many times so i do know what im doing... i think :P if anyone has any ideas let me know what could be causing that..
    //=========
    // ~NightMan
    //=========

  8. #8
    Redeemer
    Join Date
    Jan 2004
    Location
    The great Pacific Northwest
    Posts
    1,576

    Default

    Did you specifically try what rejecht recommended in post #4 above? I am using pretty much identical code to what you have (except I don't have "bNetTemporary=True" in the default properties), and it removes/hides pickup bases just fine on client computers. The only other difference is that I do have a replication block where I send a byte of data to clients, and I set "RemoteRole=ROLE_SimulatedProxy" rather than "2" in the default properties (I'm not sure if the code parser "eats" numbers in place of the enumeration names when compiling).

    [EDIT] Also, how are you running your mutator? Is it the default mutator for a new gametype (like the DMMutator in DeathMatch), or one that you add on the mutator tab of the game setup? (It can make a difference during level startup timing)
    Last edited by meowcat; 02-13-2012 at 09:49 PM.
    "What do you mean it doesn't exist clientside?"
    YARM: where player's Lean, Prone, Mantle, Dash, Crouch Jump, 'Parkour' and slide around all with generic realistic weapons!
    Meowcat's Mods for UT2K4:
    Yet Another Real-life Mod: Realistic weapons, unoriginal gameplay, w/ cheap CODMW knockoff mutator
    TD Vehicles: HUMV, MI4Hound, Motorcycle, IFAV Jeep, UH-60, MH-53 & AH-6 Helicopters, Abrams Tank
    Jetpacks for UT2k4!

  9. #9
    Iron Guard
    Join Date
    Jun 2008
    Location
    at computer
    Posts
    514

    Default

    sorry for slow reply, been doing alot of testing. i did try what rejecht posted and had no effect, changing nettemp didnt make a diff and nor did the remoterole from 2. the mutator just extends mutator and is for any gametype, its not a gameinfos mut or anything like that, simple standalone mut added to the server via the mapvote command line in the ini file, not in the batch to start server or anything.

    As i said i have the same problem with MutInstaGib, i see the weapon bases, so i thought it was somthing to do with the server, however i got anoyed with this and left it and finished the rest of the mod to test with a few friends.. none of them can see the weapon bases, its only me who can see them.. i dont see why or even how that would happen.. game is fully uptodate with patch and bonus packs etc.. the server testing was done from my lan server which is the only thing i could think of but still didnt think it was that. so as far as i know my pc has a setting somewhere that shows weapon bases lol. if its only me that has the problem then i guess its not important, just very odd..

    thx for the help tho, much apreciated! if anyone has a thought on why it would be interesting to hear it ^^
    //=========
    // ~NightMan
    //=========


 

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
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.