UE2 - UT2kX No Weapons, No running, no jumping

  • 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.

Dusky

New Member
Feb 25, 2010
26
0
0
A museum im helping to make a virtual tour through this game wants the following disabled in Unreal Tournament 2004:
Weapons -> no weapon HUD, shots, visual display weapon
Jumping -> no jumping, or at least no real animation, possibility to do so.
Running -> no running, everyone needs to go at the same speed

Idea is to make a virtual tour where a tour guide can guide people through the virtual museum with his avatar. It should not be possible to shoot him, run past him or jump all around like crazy.

Is this possible? Also is this possible WITHOUT having to make a mod for it? I mean if i make a level for it, can i fix it through server admin and level setup?

Thanks,
 

ShadowsWar

New Member
Nov 30, 2008
76
0
0
I don't remember this been possible in UT2kX, but doing it by mod is not difficult at all.
Or maybe you can do that in UT3 using kismet, this way you can set this things on the level it self.
Again, I'm not sure, but I guess that's what happen, and either would recommend you doing it by mod(creating a new Pawn class for example is very easy), or changing your engine for the UT3 (This could be a problem if you already have a map done for UT2kX).
 

Dusky

New Member
Feb 25, 2010
26
0
0
do you have any links that can help me out? im not too familiar with the coding of mods for unreal tournament
 
Apr 11, 2006
738
0
16
You could probably make a volume that, on touch, would delete all of a player's weapons from inventory, reduce his JumpZ to 0, and set his run and walkspeed to be the same.
That would be fairly simple to do and wouldn't require much in the way of code.
 

Dusky

New Member
Feb 25, 2010
26
0
0
Can anyone enlighten me some more about volumes? Im not quite sure on how to use them and tutorials are limited. I only see "special" volumes, damage volumes, falling volumes etc. If i add a generic volume i cannot change jumpZ and such, how do i add this? This is an aspect of UTed thats rather vague to me.
 
Apr 11, 2006
738
0
16
Can anyone enlighten me some more about volumes? Im not quite sure on how to use them and tutorials are limited. I only see "special" volumes, damage volumes, falling volumes etc. If i add a generic volume i cannot change jumpZ and such, how do i add this? This is an aspect of UTed thats rather vague to me.

You'd have to code it manually.


Basically it'd look something like this,


Code:
class MyVolume extends PhysicsVolume;

event PawnEnteredVolume  (Pawn  Other)
{
Other.JumpZ = 0;
Other.GroundSpeed = 300;

//Some function here to remove all of a pawn's inventory
}
 

Dusky

New Member
Feb 25, 2010
26
0
0
not to familiar with unrealscript and oop, but it looks a lot like as3 with oop..

Anyways im thinking that to kill the weapons i can easily extend your script with

Other.Weapon.EWeaponClientState = WS_None;

And than i have to think of something to hide all the weapons scattered throughout the level. Btw ive tried your script and the player is still able to jump..

Current:
class VirtueleTour extends Volume
placeable;
event PawnEnteredVolume (Pawn Other)
{
Other.JumpZ = 0;
Other.GroundSpeed = 300;
Other.Weapon.EWeaponClientState = WS_None

//Some function here to remove all of a pawn's inventory
}
 

Dusky

New Member
Feb 25, 2010
26
0
0
Edit: none of the stuff seems to work so far, although it looks logical. Player get full inventory of weapons, can run and jump. I dont think he enters the volume, even though he spawns in it (i took the volume over the entire level)
 
Apr 11, 2006
738
0
16
If players spawn inside of a physicsvolume, then the PawnEnteredVolume function may not be called. That's actually one of the things I wasn't sure about. Off the top of my head, you can try using the Touch() function for the volume, that may work.
 

Dusky

New Member
Feb 25, 2010
26
0
0
Yea, i got something about Touch() not actually meant to work the way i wanted it too or something from the editor. but im gonna try that one. Thanks for the code by the way its a great base for me to work from. I actually had it almost done (only needed to kill the weapons), i had used instead of jumpz, the boolean for jumpcapable. I also just disabled walking :p.

Anyway that took some hours of figuring out and now my UnrealEd is broken, its just hanging at compiling, its stuck at closing at the moment.

Thanks for the script though, whenever i can get it to work again im surely gonna finish this. Only thing im a little stuck with is how i should use conding, cause the enum is unusable in volume and i wanted to kill weapons through that :p.

EDIT: im think that an enteredvolume could work if i just let the player fall on it or something...anyway have to test if thats acceptable

Btw, anyone else got windows vista and is stuck at the closing of the compiling scripts. its kinda frustrating. This is making work impossible. Every time i want to try to see if i recreated what i made before the crash the script just doesnt initiate because it isnt compiled or available or whatever. Anyone got a solution? I cant make scripts like this..
 
Last edited:

Dusky

New Member
Feb 25, 2010
26
0
0
Code:
//=============================================================================
// VirtueleTour.
//=============================================================================
class VirtueleTour extends PhysicsVolume;
event PawnEnteredVolume  (Pawn  Other)
{
//Walking
Other.bCanWalk = false;
Other.bCanCrouch = false;

//Jumping
Other.bJumpCapable = false;

//HUD
Other.bHideRegularHUD = true;

//Weapons
Other.bNoWeaponFiring = true;
Other.Weapon =  none;
Other.bStasis = true;
Other.Weapon.ClientState = WS_None;
Other.PendingWeapon = none;
}

This actually works quite good, well except that it should be on touch. Im now actually looking as to how i can get the weapons away. This actually makes all the Unreal stuff go away but when you can still switch weapons afterwards, so its only hiding them

2 issues:

The entervolume should be touch
and
Weapons only "hiding"

Ive tried already with Other.Inventory but so far no luck, im thinking im missing a piece of code or overseeing some function or the working of some at least. Any help appreciated.

Thanks for the previous info and the base script you gave, it made me actually get this far :)
 

Dusky

New Member
Feb 25, 2010
26
0
0
//=============================================================================
// VirtueleTour.
//=============================================================================
class VirtueleTour extends PhysicsVolume;

event Touch (Actor Other)
{
//Walking
Pawn(Other).bCanWalk = false;
Pawn(Other).bIsWalking = true;
Pawn(Other).bCanCrouch = false;

//Jumping
Pawn(Other).bJumpCapable = false;
Pawn(Other).bCanJump = false;

//HUD
Pawn(Other).bHideRegularHUD = true;

//Weapons
Pawn(Other).bNoWeaponFiring = true;
Pawn(Other).bCanPickupInventory = false;
Pawn(Other).bInvulnerableBody = true;
Pawn(Other).bCanUse = false;
DestroyWeapons(Other);
}
function DestroyWeapons(Actor Other)
{
//Function to kill all weapons from inventory or spawn
Pawn(Other).DeleteInventory(???);
}

I got it almost working...I have no idea to though as to how to use this function. It references to Inventory but i have no idea how i can actually find the items i want to delete or what i have to say here. i tried it with the subclasses and such but came up clueless..

Any help is appreciated, this part of the Unreal game is really vague to me
 
Apr 11, 2006
738
0
16
Hey, sorry I haven't checked in on this thread in a few days.

What you may want to do is something like this.

Code:
function DestroyWeapons()
{
local Inventory Inv;

for( Inv=Inventory; Inv!=None; Inv=Inv.Inventory )
{
if (Weapon(Inv) != None)
Inv.Destroy();
}
 

Dusky

New Member
Feb 25, 2010
26
0
0
Hey yea i was already exprimenting with the for function, just not in the right context yet. I tried it through the functions that only work for mutators :p. Anyways thanks for the help, hopefully i can do the rest on my own :D.

Will update ya on the progress and the eventual script
 

Dusky

New Member
Feb 25, 2010
26
0
0
Update, this kills the weapons. Dont know wich part exactly does but im happy. You do have to use the Actor though to get it done. Thanks for the help!

//=============================================================================
// VirtueleTour.
//=============================================================================
class VirtueleTour extends PhysicsVolume;

event Touch (Actor A)
{
setVirtueleTourPawn(
Pawn(A),
Inventory(A)
);
}

function setVirtueleTourPawn(Pawn P, Inventory I) {
//Walking
P.GroundSpeed = 300;
P.JumpZ = 0;
P.bUpAndOut = true;

//Jumping
P.JumpZ = 0;

//HUD
P.bHideRegularHUD = true;

//Weapons
P.bNoWeaponFiring = true;
P.bCanPickupInventory = false;
P.bInvulnerableBody = true;
P.bCanUse = false;
P.bCanTeleport = false;

setWeapons(P, I);
}

function setWeapons(Pawn P, Inventory I) {
if (P.Weapon != None) {
P.Weapon.Destroy();
P.Weapon = None;
}
if(P.Inventory != None) {
P.Inventory.Destroy();
}
}
 

Dusky

New Member
Feb 25, 2010
26
0
0
Right now my map is working with this whenever i dont rebuild the paths. However everytime it rebuilds the paths it puts the z of the playerstart down. This basiclly stops the player from falling into the level however thats how i want to use the mod.
How do i stop this from happening? How do i say that it should just leave z at 60?