Results 1 to 15 of 15
  1. #1
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Posts
    51

    Default How to change the Weapon Respawn time?

    Example:

    UTWeap_Rocket_Launcher.uc does not have this Default Property

    Inside Weapon.uc has "Respawntime=30.00000" but is a distant class

    UtWeapon_Rocket_Launcher.uc extends UTWeapon.uc Extends GameWeapon.uc Extends Weapon.uc

    Two classes between them. How to do that?

    Thanks!

  2. #2
    MSgt. Shooter Person
    Join Date
    Jan 2011
    Location
    In my maps
    Posts
    336
    Gamer IDs

    Gamertag: idnewton

    Default

    put a slow volume on it. LOL. But no really, that DOES work (in the game anyways, not the editor).

    I don't think that's editable. Besides, why would you need or want to change that?
    Mass Map Pack (aka Team Stealth Jumbo UT3 Pack) is currently in beta phase, check it out here: http://forums.epicgames.com/threads/...eta?p=29851355
    Need help with mutator! http://forums.epicgames.com/threads/...or!?p=29782758

  3. #3
    MSgt. Shooter Person
    Join Date
    Jun 2009
    Posts
    398

    Default

    Every variable is accessable with the same syntax.
    [{INSTANCED_OBJECT}.]VARIABLE = VALUE
    [{INSTANCED_OBJECT}.]METHOD([PARAMETERS])
    [{INSTANCED_OBJECT}.]EVENTS

    If you're still in the same class, you can just use the variable name.
    Same like LockerAmmoCount. It's not declared in UTWeap_RocketLauncher.uc but accessible in that class (line 1471)
    Code:
        AmmoCount=9
        LockerAmmoCount=18
        MaxAmmoCount=30

  4. #4
    MSgt. Shooter Person
    Join Date
    Jan 2011
    Location
    In my maps
    Posts
    336
    Gamer IDs

    Gamertag: idnewton

    Default

    wow thats a bit advanced methinks
    Mass Map Pack (aka Team Stealth Jumbo UT3 Pack) is currently in beta phase, check it out here: http://forums.epicgames.com/threads/...eta?p=29851355
    Need help with mutator! http://forums.epicgames.com/threads/...or!?p=29782758

  5. #5
    MSgt. Shooter Person
    Join Date
    Jun 2009
    Posts
    398

    Default

    -.-

    Code:
    class MyRL extends UTWeap_RocketLauncher
    defaultproperties
    {
        RespawnTime=0005.0000
    }
    I'm not sure, but i think it would be 5 secs.

  6. #6
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Posts
    51

    Default

    The problem is RespawnTime is not in UTWeap_RocketLauncher
    Default Properties, but in Weapon.uc Default Properties

  7. #7
    MSgt. Shooter Person
    Join Date
    Jun 2009
    Posts
    398

    Default

    Did you try to compile and test it?

    Every variable a class can be accessed by its derivated/child class.
    RespawnTime is accessible in every GameWeapon (UTWeapon) and in UTWeap_RocketLauncher.

    Quote Originally Posted by RattleSN4K3 View Post
    Every variable is accessable with the same syntax.
    Same like LockerAmmoCount. It's not declared in UTWeap_RocketLauncher.uc but accessible in that class (line 1471)
    Code:
        AmmoCount=9
        LockerAmmoCount=18
        MaxAmmoCount=30
    There was s small error in the previous code. Here's the working code.
    Code:
    class MyRL extends UTWeap_RocketLauncher;
    
    defaultproperties
    {
        RespawnTime=0005.0000
    }
    Is it working? Yes.
    Compile it. Replace a weapon with this weapon, run over this weapon, and check when the weapons respawns.


    I would suggest you read some documents

    UE1 UnrealScript Language Reference:
    http://wiki.beyondunreal.com/Legacy:...uage_Reference

    UE2 UnrealScript:
    http://wiki.beyondunreal.com/Legacy:UnrealScript

    UE3 UnrealScript Reference:
    http://udn.epicgames.com/Three/Unrea...Reference.html
    (btw. quote "Default values are inherited by child classes. Values specified in child classes' defaultproperties override values specified in parent classes.")

    And there are many other tutorials and documents you could read. For now, these are okay.

  8. #8
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Posts
    51

    Default

    I've already tried but didn't work.
    This week i'm travelling but I'll try again at home.

    I'll read this UT3 documents...

    Thanks a lot for the help, i"ll post later.


    ThalisMan

  9. #9
    MSgt. Shooter Person
    Join Date
    Sep 2009
    Location
    Arlington, TX
    Posts
    372

    Default

    I tried also, this requires more. If you read the PickupFactory and UTPickupFactory, you may notice some 30 second floats are used to set timers which seem to affect the visibility and touch toggling functions. You could discretely set them (in your own subclass) to match your Rocket's RespawnTime. Alternatively, you could probably whip up some arithmetic with GetRespawnTime() instead, so that you could more easily adjust times later using only inventory class default properties.

  10. #10
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Posts
    51

    Default

    Yes... UTPickupFactory need changes
    I only know how to change Default Properties...
    How can i change the code?

  11. #11
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Posts
    51

    Default

    Ok, Respawn time changed! But the weapon animation is still in 30 sec. I can grab the weapon in the inventory without see it. Visually is still in 30 sec.

    Some tip?

    Thanks!

  12. #12
    MSgt. Shooter Person
    Join Date
    Sep 2009
    Location
    Arlington, TX
    Posts
    372

    Default

    first off, if you are doing this for a level and not a mod/mutator then it may be easier for you, as a new modder, to simply fake the pickup via kismet..just sayin'

    some tips? Again:
    Quote Originally Posted by NickG View Post
    If you read the PickupFactory and UTPickupFactory, you may notice some 30 second floats are used to set timers which seem to affect the visibility and touch toggling functions. You could discretely set them (in your own subclass) to match your Rocket's RespawnTime. Alternatively, you could probably whip up some arithmetic with GetRespawnTime() instead, so that you could more easily adjust times later using only inventory class default properties.
    so...you could subclass UTWeaponPickupFactory factory and override the functions, replacing the 30.0 second floats w/ your respawn time. Then in your mod/mutator replace UTWeaponPickupFactory with your subclassed pickup factory. If you chose to set discrete times, then your script would have to first check the inventory type so as not to replace the pickup factories which have different spawn times. This is yet another reason to set these floats based on the respawn time in your subclass (I am at a loss why epic did not do this) - then, it is most likely that you can simply replace all the UTWeaponPickupFactory with your subclassed version from your mutator. Then, you would also have to replace the weapon inventory class as does the weapon replacement mutator

  13. #13

    Default

    Hi, sorry to res an old thread, but I'm really interested in this subject and I couldn't find anyone else discussing it.

    I've created a custom weaponpickupfactory with the 30 second floats changed to my own time (15). I'm experienced with using the checkreplacement function to replace weapons and ammo, but how would I go about using it to sub in my pickupfactory?

  14. #14
    MSgt. Shooter Person
    Join Date
    Sep 2009
    Location
    Arlington, TX
    Posts
    372

    Default

    I haven't compiled the following, but this is mostly paraphrased from my super duper pickup switcher mutator, which replaces pickup factories with my subclasses, see what you can make of it.
    Code:
    	local UTWeaponPickupFactory WeaponPickup;  //their class
    	local GnaMWeaponPickupFactory GnaMWeaponPickupInstance; //your class (for the purposes of this post, anyway)
    	if (Other != None) //found actor Other
    	{
    		if ( Other.IsA('UTWeaponPickupFactory') && !Other.IsA('GnaMWeaponPickupFactory') )  //Other is UTWeaponPickupFactory but not one of your replacement subclassed ones
    		{
    			if (Other.WeaponPickupClass != None)  //gotta make sure it has inventory so we can assign the replacement's inventory. 
    			{
    				GnaMWeaponPickupInstance = Spawn(class'GnaMWeaponPickupFactory',,, Other.Location, Other.Rotation);  //go ahead and spawn your new pickup right where the old Other was.
    				GnaMWeaponPickupInstance.WeaponPickupClass; = Other.WeaponPickupClass;  //set the Weapon Pickup Class...
        			GnaMWeaponPickupInstance.InventoryType = GnaMWeaponPickupInstance.WeaponPickupClass;  //need to set this one too, so that the pickup does not disable itself.				
    				GnaMWeaponPickupInstance.SetBase(Other.Base);  //settle in...
    				if (GnaMWeaponPickupInstance.Base != None)   
    				{
    					GnaMWeaponPickupInstance.SetHardAttach(TRUE);  //glue for movers (VCTF-Rails, etc)
       				}
    				GnaMWeaponPickupInstance.OriginalFactory = Other;   //a.i. stuff? as seen in  UTMutator_WeaponReplacement ammo section , or ReplaceWith() 
    				Other.ReplacementFactory = GnaMWeaponPickupInstance;  //second line of that stuff
        			GnaMWeaponPickupInstance.SetDrawScale(Other.DrawScale);  //this is good to do for fancy maps.
        			GnaMWeaponPickupInstance.InitializePickup();  //and this is so it will start with the inventory and go to correct state.				
    				return false; //remove original "other"
    			}
    		}
    	}
     	return true;  //other others stay other
    For your mutator, you could maybe be more elegant and let the ReplaceWith() function do some of this work.

    I've assumed that you know what you are doing with the other floats of mention, just remember that you'll need to override the inherited function "GetRespawnTime()" in your weaponpickupfactory subclass because it tries to do this...
    Code:
    function float GetRespawnTime()
    {
        return InventoryType.Default.RespawnTime;
    }
    which, upon pickup sleep state, resets it to 30 for normal weapons (inherited from "Inventory" and 120 (90?) for redeemer, set from its content class defaultproperties.
    so you want something like this in your weapon pickup factory;
    Code:
    function float GetRespawnTime()
    {
        return GnaMsFloat;  // or:  return 15.0;
    }
    Narayana*SIG*

  15. #15

    Default

    Excellent, thank you very much! I haven't had a chance to try it out yet, but I definitely think I can work with this. Thanks again.

    EDIT: Got some weird results.

    For starters, it didn't like the line "if (Other.WeaponPickupClass != None)" essentially giving me this error that WeaponPickupClass was not a valid property of Actor Other. The only way I could successfully compile was to change it to "WeaponPickup.WeaponPickupClass".

    Neither of us spotted the extra semicolon in "GnaMWeaponPickupInstance.WeaponPickupClass; = Other.WeaponPickupClass;" and it took me 45 minutes to realize a typo was all that was the problem with that line.

    It didn't like either of the "AI stuff" lines and ultimately I decided to leave them out to see if I could get the rest of the code to work. In the end it compiled without errors, but then all of the weapon pickups disappeared from the map. I tinkered with the code some more, but none of my changes helped even when they compiled correctly. I'm sure it's due to the things I stupidly altered in your code in an effort to avoid the errors it was tossing back at me.

    At any rate, here's the truly bizarre part... After trying to work this code for a while, I decided to revert my mutator back to its original state from before I had attempted to replace the WeaponPickupFactory, so I could restart from a clean state. I compiled it with absolutely no pickupfactory alterations, just the line "Respawntime=15.00000" added to all my custom weapon classes, and when I tried it in-game on a lark, all weapons respawned in 15 seconds with full visuals, no invisible weapons, and no other issues! I thought "this can't be right" and tried to find a hitch, but as I continued playtesting, it weapons always disappeared when picked up and respawned properly in the allotted time regardless of whether it was me, another local player, or bot viewing or grabbing the weapon.
    Last edited by GnaM; 08-14-2012 at 11:14 AM.


 

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.