Results 1 to 14 of 14

Thread: MultiLevel Lift in Thievery

  1. #1
    Member Przemek557's Avatar
    Registered
    Jan 2007
    Location
    Poland>Tychy
    Posts
    142

    MultiLevel Lift in Thievery

    Is it possible to create this kind of lift in UnrealEd? As far as I remember I haven't seen such a thing in any map, and I believe it would require complex combinations with many movers... unless someone codes it. I tried to achieve it, in a pretty simple way - this is the result (unr file):
    http://www.sendspace.com/file/c9snoz
    If you download and run it, you will see that it works perfectly. If you do not wish to download it, you may still see that it works perfectly by watching this video:
    http://www.youtube.com/watch?v=VIFgxQJgqes
    Unfortunately, as I was expecting, when I run a server with this map and joined it, it didn't work any longer. I guess sth crucial is not replicating to client.

    This is one of the two actors I created to make it work
    Code:
    //=============================================================================
    // ThHaxersLiftButton.
    //=============================================================================
    class ThHaxersLiftButton expands ThPushButton;
    
    var() int LiftKeyTarget;
    var() int LiftSpeedmps;
    
    function frob (Actor Frobber, Actor FrobItem) {
    	local Mover LiftOne;
    	local LiftNavigationPoint LiftNvg;
    
    	// play the relevant anim
    	PlayAnim('Push');
    
    	// play switching sound effect
    	PlaySound(FrobSound, SLOT_None, 1.0, true, 1200, 1.0);
    
    	if( Event != '' )
    	{
    		foreach AllActors( class 'LiftNavigationPoint', LiftNvg, Event )
    		{
    			if(LiftNvg.LiftKeyTarget==LiftKeyTarget)
    			{
    				foreach AllActors(class 'Mover', LiftOne, Event)
    				{
    					if(!LiftOne.bInterpolating)
    					{	
    						if(LiftOne.KeyNum==0)
    						{
    							LiftOne.KeyPos[1]=LiftNvg.Location-LiftOne.BasePos;
    						}
    						else if(LiftOne.KeyNum==1)
    						{
    							LiftOne.KeyPos[0]=LiftNvg.Location-LiftOne.BasePos;
    						}
    						LiftOne.MoveTime=(VSize(LiftOne.Location-LiftNvg.Location)/64)/LiftSpeedmps;
    						LiftOne.Trigger( Pawn(Frobber), Pawn(Frobber) );
    					}
    				}
    			}
    		}
    	}
    }
    The other one (LiftNavigationPoint) just expands navigation point and holds LiftKeyTarget variable.

    The way it should work in a short way:
    By pressing the button, a lift navigation point with tag matching button's event is found, then all movers with matching tag are moving to lift navigation point's location.

    The way it works online is pretty hard to describe - mover does not seem to react after pressing a button, however, as it moves on the server, it causes a desynchronization between client and server.

    I would like to know if there is any way to bypass this problem - I intend to use this kind of mover in my map - in a similar way I could achieve a mover with more than 8 keys.

  2. #2
    Member immortius's Avatar
    Registered
    Jan 2003
    Location
    NX128EZ061 - The main planet
    Posts
    3,117
    Ew, nested AllActors.

    Well, the reason it doesn't work is because changes to Mover KeyPos are not replicated to clients.

    I suggest changing your mover to an ElevatorMover, and change your button to call
    Code:
    MoveKeyframe( int newKeyNum, float newMoveTime )
    on the mover, where newKeyNum is the frame to move to and newMoveTime is the total time for the move.

  3. #3
    Member Przemek557's Avatar
    Registered
    Jan 2007
    Location
    Poland>Tychy
    Posts
    142
    Thanks. It helped. By the time I tried expanding mover into a custom one updating client-side's KeyPos and MoveTime. Both solutions work perfectly. And, additionnally, I can create movers with as many keys as I desire. Ofc I dont need scyscrapers with lifts, but there is a mover I intend to have more than 8 keys in my upcoming map.

  4. #4
    Member
    Registered
    Apr 2005
    Location
    Telč and Prague, Czech Republic
    Posts
    153
    Interresting. I have not not tried to override the KeyNum limit of Unreal movers (no need for this). On the other hand I have had used elevator described below (code is part of ThieveryMCFpack, but none probably care of documentation hidden in /UT/help/... )

    ElevatorAttachMover.uc
    ElevatorAttachMover is part of ThieveryMcFpack.u package
    Combines elevator mover with attach mover. Now Elevators could have internal push buttons (meshes not brushes!) and so, placed inside, and attached, movable. These attached mesh objects moves along with the ElevatorAttachMover (WARNING sometimes the position might be displaced when spacing between elevator floors is not the same !!!) It is also able o trigger directly elevator shaft doors to open when the elevator stop (see ThElevatorShaftDoor).
    ElevatroAttachMover could be controlled by normal ElevatorTrigger (Unreal) or TElevatorButtonTrigger (Thievery)
    AttachTag actors with same tag are attached to ElevatorAttachMover, and move with this mover
    DoorTag this is used with ThElevatorShaftDoor, ThElevatorShaftDoors with this tag are controlled by this ElevatorAttachMover. ThElevatorShaftDoor does not move with the elevator they open or close when elevatro stops on given floor (see ThElevatorShaftDoor)

    Place in level using UEd command: BRUSH ADDMOVER CLASS=ElevatorAttachMover
    Or You should add this to Your UnrealEd.ini [UserDefinedGroup] -> Button#=ThElevator Attach Mover,UDThElevator, BRUSH ADDMOVER CLASS=ElevatorAttachMover (replace # with appropriate number)

    ThElevatorShaftDoor.uc
    ThElevatorShaftDoor is part of ThieveryMcFpack.u package
    ThDoor controlled directly by ElevatorAttachMover
    FloorNum determines which Elevator floor this door belongs to (set this to same value as KeyNum value)

    Place in level using UEd command: BRUSH ADDMOVER CLASS=ThElevatorShaftDoor
    Or You should add this to Your UnrealEd.ini [UserDefinedGroup] -> Button#=ThElevator Shaft Door Mover,UDThElevatorDoor, BRUSH ADDMOVER CLASS=ThElevatorShaftDoor (replace # with appropriate number)
    Mappers do thier hard work for other people (game players namely), but if none of these other people give them feedback, there is no power to do what have to be done.

    Be kind to Your mappers because they are doing it for You and give them hope...

  5. #5
    Member Przemek557's Avatar
    Registered
    Jan 2007
    Location
    Poland>Tychy
    Posts
    142
    Well, the attempt to create more than 8 keys for a mover was quite successful. I was unable to rotate them anyway however. Besides, in online mode the mover was a little bit shaking. Fortunately, the mover was a boat, and that fact could be explained by the waves of the sea, the boat had to struggle with...

    Anyway - as this topic turned into a little bit UScript discussion, I will post a link to a vid I believe I haven't posted here yet. It is also connected with movers partially, and the result is quite fascinating:
    http://www.youtube.com/watch?v=NZe3fgyHAV0
    It can be used only with solid (no-mover) windows with shutters unfortunately. This solutions wouldn't work with doors and openable windows etc.

    ... or at least it would be very hard and not as effective - it could be done the same way, but the light triggered by the door would need to be on the opposite site of the light source and be perfectly placed, so that it looked naturally. The tag would need to be NoLightPlayer (or whatever it was). There could be a few, little lights instead of one to gain better control of the area, the opened door would lit. I am pretty convinced it would take hours to set it up, and eventually it wouldn't be satisfying.

  6. #6
    Member Przemek557's Avatar
    Registered
    Jan 2007
    Location
    Poland>Tychy
    Posts
    142
    The demo map shown on the video above (with a few improvements) is available at http://www.thievery.pl/files/Th-WindowTest.zip

    To use it in your map you simply need to open this demo map in UnrealEditor, and then, in the same instance of UED open your own map. 2 new Actors should appear in Actor Class Browser:
    Actor->Triggers->ThHaxersDbOpen
    Actor->Triggers->ThHaxersDbOpen->ThHaxersDbOpenAdvanced

    The first one is a controller for opening/closing both doors simultaneously - it works similarly to TriggerBool used on Breandor. The only difference/improvement is that if you pick/unlock one of the door, the second one gets unlocked too.
    Options:
    Tag should be set same as both doors events.
    Event should remain None
    DoorTag and DoorTag2 doesn't require much to explain. Note that the doors should have different Tags.
    Both doors should have Object->InitialState set to TriggerControl

    The second Actor (ThHaxersDbOpenAdvanced) is the extended version of the controller above. Apart from features I described, it also has an additional option - TriggerLightTag -it is just the Tag of the TriggerLight you want to control with the door. That light's InitialState should also be set to TriggerControl. To gain better effect, adjust TriggerLight->ChangeTime to shutters opening speed. The light should be initially On, and the shutters should be opened by default (so that the light will be properly built). To achieve it, the shutters should be placed on the level at their closed position, and then, their keyframe should be changed to 1. While the key is 1, set the shutters to opened position (just like you would do with normal mover) and leave them at that state - do not switch back to key 0. The rest of the configuration of the advanced version is same as the basic one (Events, Tags, etc.).

    If anything remains unclear, the demo is a good example of how it works.

    Note: In that demo I have experimented a bit with 'Mirror' tag in Surface properties, the effect is pretty nice.

  7. #7
    Member
    Registered
    Mar 2004
    Location
    Restoring balance.
    Posts
    547
    Very impressed, thanks for sharing that.

  8. #8
    Member Przemek557's Avatar
    Registered
    Jan 2007
    Location
    Poland>Tychy
    Posts
    142
    Does anyone know how to change texture of an object? I need buttons with numbers (0-9), but the only button we have with TUT is the all-red one. I have already taken the textures out, and remade them like that:
    http://imageshack.us/photo/my-images...uttontex5.png/

    The question is how to actually apply them. The original THPushButton's mesh and textures are set by some commands that look like preprocessor directives, just like that:
    Code:
    #exec MESH IMPORT MESH=ThPushButton ANIVFILE=MODELS\pushbutton\ThPushButton_a.3d DATAFILE=MODELS\pushbutton\ThPushButton_d.3d X=0 Y=0 Z=0
    #exec MESH ORIGIN MESH=ThPushButton X=0 Y=0 Z=0
    
    #exec MESH SEQUENCE MESH=ThPushButton SEQ=All STARTFRAME=0 NUMFRAMES=20
    #exec MESH SEQUENCE MESH=ThPushButton SEQ=Push STARTFRAME=0 NUMFRAMES=19
    
    #exec MESHMAP NEW MESHMAP=ThPushButton MESH=ThPushButton
    #exec MESHMAP SCALE MESHMAP=ThPushButton X=0.1 Y=0.1 Z=0.2
    
    #exec TEXTURE IMPORT NAME=PushButtonTex FILE=MODELS\pushbutton\PushButtonTex.pcx GROUP=Skins FLAGS=2
    #exec TEXTURE IMPORT NAME=PushButtonTex FILE=MODELS\pushbutton\PushButtonTex.pcx GROUP=Skins PALETTE=PushButtonTex
    #exec MESHMAP SETTEXTURE MESHMAP=ThPushButton NUM=1 TEXTURE=PushButtonTex
    I have tried adding a new object inheriting ThPushButton, and adding sth like that:
    Code:
    #exec TEXTURE IMPORT NAME=PushButtonTex FILE=C:\Buttons\PushButtonTex5.pcx GROUP=Skins FLAGS=2
    #exec TEXTURE IMPORT NAME=PushButtonTex FILE=C:\Buttons\PushButtonTex5.pcx GROUP=Skins PALETTE=PushButtonTex
    #exec MESHMAP SETTEXTURE MESHMAP=ThPushButton NUM=1 TEXTURE=PushButtonTex
    but with no effect.

    Even if it worked, perhaps there is a better way to do that, without having to add 10 new classes, just because they need a different textures? Just like bots' skins are determined by MultiSkins property.

  9. #9
    Member Keggie's Avatar
    Registered
    Aug 2005
    Location
    following your foot falls...
    Posts
    2,004
    all the code you posted does is import the textures/meshes into the package and apply some changes. you apply texture changes using the MultiSkins property as you just said.. just place in the map, alter the actors default properties, somtimes texture slot 1 you dont notice the difference, so work your way down untill you find the one that changes the one you want changed

    edit - multiskin slot 1 changes the texture on thpushbutton, so add your new texture there. you donot need custom classes for it, unless you created new textures that donot fit, inwhich case you need 1 new mesh to be made, will have to resize the texture on it before it becomes a mesh to work.
    [E.D.G]Keggie - All that is yours is allready mine
    Thievery - Hanse's, Market, Mutator List
    AlienSwarm2k4 - Nighide Research Facility
    Videos - YouTube

  10. #10
    Member Przemek557's Avatar
    Registered
    Jan 2007
    Location
    Poland>Tychy
    Posts
    142
    Yeah, thanks for that, it helped. I have tried changing MultiSkins property, but when I saw nothing happened after changing MultiSkins[0] I thought it is no point trying others.

    Lovely:
    http://img850.imageshack.us/img850/7381/shot0002r.png

  11. #11
    Member Keggie's Avatar
    Registered
    Aug 2005
    Location
    following your foot falls...
    Posts
    2,004
    Looks good. is that for a safe? type in correct code to open it? would be rather good idea actualy, just make a small script that changes the code needed every game and adds it to a scroll on the map, thieves have to read the scroll to find out what the code is before they can open the safe
    [E.D.G]Keggie - All that is yours is allready mine
    Thievery - Hanse's, Market, Mutator List
    AlienSwarm2k4 - Nighide Research Facility
    Videos - YouTube

  12. #12
    Member Przemek557's Avatar
    Registered
    Jan 2007
    Location
    Poland>Tychy
    Posts
    142
    Yes, that's exactly what I did. What is more the code is hidden randomly in one of a few books/scrolls on the map.

  13. #13
    Member Shug's Avatar
    Registered
    Jan 2003
    Location
    Play Hard. Go Pro.™
    Posts
    3,294
    Very cool execution.
    Nightmaster,
    .:Mockers Thievery Guild:.
    - "until the cat is skinned"

  14. #14
    Member
    Registered
    Apr 2005
    Location
    Telč and Prague, Czech Republic
    Posts
    153
    Quote Originally Posted by Przemek557 View Post
    Does anyone know how to change texture of an object? I need buttons with numbers (0-9)
    ...
    Even if it worked, perhaps there is a better way to do that, without having to add 10 new classes, just because they need a different textures? Just like bots' skins are determined by MultiSkins property.
    Sorry for late reply...

    Either using Multiskin or Skin property of an object

    Using exect directive is effective when You are importing new objects and setting default skin and so. In case of default skin this is not realy necessary (unless You need model to be skinned in mesh viewer), because You can use assign texture in property editor (either on import in default properties or when placed into map)

    Of these exec directives realy is needed footstepsound making directive. As far as I know there is no other way how to tell engine to produce footstep sound. Without this the model handling routine doe snot know when to call play footstep.

    But in case of skins You may use Skin or Multiskin property. If I remember things correctly. Skin property is equal to Multiskin(0). There might be an obstacle due to simple fact the multiskin index depends on skin index of 3d modeling software (when using 3DSmax multiskin characters are produced setting mesh/poly regions index and setting (assigning) appropriate mutli-subobject material to this mesh.
    Normally the skin index (poly region index) is 0 by default, but...
    Even when modeller is creating single skin model, there might be (due to mistake, stupidity or whatever) the skin index (accidentally or whatever) set to other value than 0.

    In case You are using multiskin property in UEd and nothing seem to happen, do not panic and try to swap multiskin slots. The model might have its single skin assigned to slot 3 not 0 !!!
    Mappers do thier hard work for other people (game players namely), but if none of these other people give them feedback, there is no power to do what have to be done.

    Be kind to Your mappers because they are doing it for You and give them hope...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Thievery MA and Thievery Full Map Pack
    By Antero90 in forum Thievery Discussion
    Replies: 18
    Last Post: 9th Nov 2004, 05:42 PM
  2. Special Lift Speeds
    By Sniper007 in forum Alien Swarm 2K4 Discussion
    Replies: 2
    Last Post: 16th Jun 2004, 09:45 AM
  3. Thievery Costumes at the Thievery shop?
    By TemperMental in forum Community Chat
    Replies: 9
    Last Post: 29th Sep 2003, 09:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •