1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

How to make weapons lean on walls (would that include to spawn without weaponbase?)?

Discussion in 'Level Editing - Advanced' started by Crossfire, Apr 13, 2004.

  1. Crossfire

    Crossfire New Member

    Joined:
    Mar 18, 2000
    Messages:
    4
    Likes Received:
    0
    Hi all :)

    I want to do what is shown on the screenshot (from a level I did for the original UT) in UT2004. It can be done right? I think that is much more nice looking than the big weaponbase thing. Please help :)

    [​IMG]
     
  2. Bot_40

    Bot_40 Go in drains

    Joined:
    Nov 3, 2001
    Messages:
    2,911
    Likes Received:
    0
    Possibly either with a custom coded weapon base to spawn the weapon at that angle and offset to the side, then just set bHidden = true so it hides the base itself.
    Or alternatively it's possible to place the weapons on their own without the bases apparently though this is supposed to cause AI issuses (but epic are yet to back this statement up)
     
  3. Crossfire

    Crossfire New Member

    Joined:
    Mar 18, 2000
    Messages:
    4
    Likes Received:
    0
    Thanks for the answer.

    I can't find out how to just place the weapons on their own.. How?
     
    Last edited: Apr 14, 2004
  4. KingMango

    KingMango pwnt

    Joined:
    Feb 12, 2004
    Messages:
    141
    Likes Received:
    0
    place the weapons base near your intended location
    Open the properties. Set cull distance to .00001
    clear the mesh field as well
    Now find the mesh for whatever pickup and lay it against the wall.

    maybe?
     
  5. Dennis Grass

    Dennis Grass New Member

    Joined:
    Nov 3, 2004
    Messages:
    9
    Likes Received:
    0
    Hello!

    I was just searching the web for a way to get rid of the rotating pickup because I want to lean the weapons on walls, too. So I found this thread. Unfortunately without an answer... :(

    But Bot_40's idea is great and a good point to start. So I did a little UScript for a new xWeaponBase class without rotating pickups.
    I know this thread is old and maybe you have already found a way to do it, but anyway, here is how i do it now.

    At first goto the Actor Class browser, highlight xWeaponBase and click the New Script button. As package name use MyLevel so the new class will be stored within your map package. Enter MyxWeaponBase as name for the new class.

    Put the following code into the new class:

    //========================================================
    // MyxWeaponBase.
    //========================================================
    class MyxWeaponBase extends xWeaponBase
    placeable;

    var(PickUpBase) rotator SpawnRotation; // access via the Properties
    var(PickUpBase) vector SpawnLocation; // access via the Properties

    function SpawnPickup()
    {
    if( PowerUp == None )
    return;

    Super.SpawnPickup();

    myPickUp.SetRotation(SpawnRotation); // synchronize rotated position of PickUp and Base
    myPickUp.SetLocation(SpawnLocation); // synchronize vector position of PickUp and Base (pivot position)
    myPickUp.SetPhysics(PHYS_None); // kill this annoying rotation
    }


    Compile it and the new class MyxWeaponBase appears in the browser. Place it in your map, set it up as you like and set Advanced, bHidden to True so the base cannot be seen in-game. Look at the code, there are two new variables you have to set up manually in the MyxWeaponBase properties:

    Set Pitch, Roll, Yaw of PickUpBase.SpawnRotation to exactly the same values as in PickUpBase.Movement.Rotation.
    Do the same with the PickUpBase.SpawnLocation vector values and PickUpBase.Movement.Location.
    (Sorry, this has to be done manually because i just cannot find the corresponding WeaponBase actor via UScript :mad: If someone knows, please post)
    So location and rotated location of the spawning weapon will be exactly the same as of the base.

    Now it's a little tricky to get the right position of the weapon because you cannot see it in the editor. After setting up SpawnRotation and SpawnLocation the pivot location of the spawning weapon is the same as the WeaponBases pivot location. The weapons rotation is also synchronized with the bases rotation. So you can orientate to the WeaponBase. (Just leave the Bases bHidden to true an run your map to check the base and weapon position.)

    Ok. It's not fully automatic. But it works (UT2004 v3323). :D

    English is not my mother language. I hope you understand what I wrote.

    Greetings
    Dennis
     
  6. XepptizZ

    XepptizZ What are you lookin at...

    Joined:
    May 17, 2004
    Messages:
    486
    Likes Received:
    0
    Bases of any kind should've been totally optional IMO, It's just more fun and original to make your own right?
     
  7. ReD_Fist

    ReD_Fist New Member

    Joined:
    Sep 6, 2004
    Messages:
    1,404
    Likes Received:
    0
    Just make a new class name under the weapon

    then rightclick and edit the propeties of the new named weapon you added.

    if you can't find any of the things you need to modify ,type this in on the command bar at bottom of editor

    editactor class=myclassicsniperrifle

    (or whatever you named it)

    then just pick your class in "pickups" not "xweaponbase" to the base you add to map.
    wich is hidden in advanced,
    Need any help let me know.
     
  8. Dennis Grass

    Dennis Grass New Member

    Joined:
    Nov 3, 2004
    Messages:
    9
    Likes Received:
    0
    Oops. The code I posted was tested careless. :D
    The spawning weapon collides with the world and always gets "pushed away" form BSP (and static meshes?) for about 30 units or so. That made placing them near walls impossible.
    Here it is fixed and fully automatic (if u like):

    Code:
    //========================================================
    // MyxWeaponBase.
    //========================================================
    class MyxWeaponBase extends xWeaponBase
    	placeable;
    
    var(PickUpBase) bool bUseCustomSpawn; // allows u to spawn the pickup at a location (and rotation) away from its base
    var(PickUpBase) rotator SpawnRotation; // effective if bUseCustomSpawn is True
    var(PickUpBase) vector SpawnLocation; // effective if bUseCustomSpawn is True
    
    function SpawnPickup()
    {
        if( PowerUp == None )
            return;
    
    	Super.SpawnPickup();
    
    	myPickUp.bCollideWorld = False; // stop colliding with world, so spawning near (sure, even inside) walls is possible
    
    	if (bUseCustomSpawn == True) // use user input for the pickups rotation/location
    	{
    		myPickUp.SetRotation(SpawnRotation);
    		myPickUp.SetLocation(SpawnLocation);
    	}
    	else // synchronize the pickups rotation/location to its base
    	{
    		myPickUp.SetRotation(Rotation);
    		myPickUp.SetLocation(Location);
    	}
    
    	myPickUp.SetPhysics(PHYS_None); // kill rotating animation
    
    	bHidden = True; // hide the weaponbase in-game
    }
    
    I just wanted to correct the code.

    ReDs way has the advantage you can see the weapon inside of UnrealEd. This makes placing them right easy. So you don't have to run the map over and over again to see where the weapon actually spawns.
     
  9. Ghost3021

    Ghost3021 Registered Hobbit

    Joined:
    Nov 21, 2004
    Messages:
    586
    Likes Received:
    0
    hey, i already made custom placable weapons for one of my maps, 2on2chizra, its at nali city. theiir in the mylevel package, just load the map and load yours, they extend pickup.:) no need for code, realy.
     
  10. Dennis Grass

    Dennis Grass New Member

    Joined:
    Nov 3, 2004
    Messages:
    9
    Likes Received:
    0
    I took a look at your map, SoH. It is just the best way to do get rid of these weaponbases and placing the weapons is very easy. And without any code...I go crazy it's that simple! Thank you very much for this! :)
     
  11. Ghost3021

    Ghost3021 Registered Hobbit

    Joined:
    Nov 21, 2004
    Messages:
    586
    Likes Received:
    0
    no prob. obviously i wanted my map to be just like the original chizra, so i did the thing.
     

Share This Page