TTLG|Thief|Bioshock|System Shock|Deus Ex|Mobile
Results 1 to 8 of 8

Thread: UED: 3 Scripting Problems I'm having

  1. #1
    Member
    Registered: Sep 2002
    Location: Crouched behind a BSP-hole

    UED: 3 Scripting Problems I'm having

    Ok, I'll skip the waffle and get to the point. My map involves some 3rd-party coding (a few features that aren't in thievery that I'd like to test out) & it's been going 80% smooth-running. However, I haven't been able to find any solutions to the following problems:

    Problem 1:
    I can't access the script for TBaseBot. Whenever, I try to access it UED crashes. I need to access the script becuase I want to see what functions I can manually access & I want some way of "fooling" the bots into thinking they saw something (I want Bots to act like humans, that can't be 100% sure that what they saw was a thief or a trick of the light).

    Problem 2:
    I've tried adding a custom inventory to the ThieveryShopThieves (or whatever it is called) in position #10 (the array starts at #0) but for some reason ingame it doesn't show up in the loadout slot. I get an extra blank box on the list of items but no text inside that box & I can't click on it to buy that item. The item is definately functional and works when I insert it into the slot of another item (hence, replacing that item: not ideal) & so I can't work out why it doesn't work when I insert it as an additional item, as opposed to overwriting an old item in the list.

    Problem 3:
    I've had to subclass the repair kit, in order to create a new modified repair kit that can be used on items other than the Whistler & Chest. I've had no problem replacing the old kit with this in the ThieveryShop but now if I select a loadout, it wouldn't buy the new repair kit & due to the old 1 not being available, I'd find myself starting without a repair kit. Is there someway of:

    1--- Replacing an item in a characters inventory with another (& hence people could buy the old kit & receive the new 1)
    OR
    2---Automatically replace 1 item in a persons saved loadouts with another item (JUST FOR THE DURATION OF THAT MAP)


    Ok, those are my probs, any help that anyone can provide will be greatly appreciated
    (& any posts saying "I don't like that idea blah blah blah" will be duly ignored)

  2. #2
    Member
    Registered: Sep 2002

    Re: UED: 3 Scripting Problems I'm having

    Originally posted by The_Dan

    Problem 1:
    I can't access the script for TBaseBot. Whenever, I try to access it UED crashes. I need to access the script becuase I want to see what functions I can manually access & I want some way of "fooling" the bots into thinking they saw something (I want Bots to act like humans, that can't be 100% sure that what they saw was a thief or a trick of the light).
    I'll PM you the script.

  3. #3
    ThieveryUT
    Member

    Registered: Jun 1999
    Location: www.thieveryut.com
    1. Have you tried going to "File -> Export all scripts" in the actor classes browser? This will throw all the source files into your UnrealTournament folder where you can browse them easily with a text editor, or something like UClasses.

    2. Hmm, are you setting the Items[10], ItemsName[10] and ItemsLimit[10] all correctly?

    3. Your best bet here is a custom mutator. The mutator class gets its SpawnNotify function called whenever something is created and you get a chance to override the spawn with something of your own. So, yeah.. make a custom mutator that does this.. then you might be able to just put it down in the level, if not you'll have to make some other custom object that spawns the mutator in BeginPlay.
    Project Lead,
    Thievery UT.

  4. #4
    Member
    Registered: Sep 2002
    Location: Crouched behind a BSP-hole
    Thanx Immortius for the script.

    Dalai:
    1. No I didn't think of that 1, but Immortius has sent me the script anyway.

    2. I'm positive that they're all correctly filled in, but I'll double check anyway (I was pretty chuffed at getting the Spider-Eggs to work as an inventory item, even if they just use the flashbomb model).

    3. I considered a mutator but I wasn't sure about how you force a map to load a mutator. If I just place the mutator in the map as per any other actor (or whatever class it comes under), will it be loaded along with the map (as opposed to just sitting there, doing nothing)?

    Thanx for the suggestions

  5. #5
    Member
    Registered: Nov 1999
    Location: Plotting my next move...
    Dosen't the LevelInfo actor have a script running during play? I know that Deus Ex had something like this, but maybe UT has it as well...I'm at work right now, but I'll check when I get home.

  6. #6
    ThieveryUT
    Member

    Registered: Jun 1999
    Location: www.thieveryut.com
    2. Hmm, I just dug into the code for the pop out SpeechWindow and it looks like there's some hardcoded limit in there, above which it's meant to make scroll buttons appear at the top and bottom for the excess items. I'll double check this and make sure it's fixed for 1.3.

    3. Looking at the code, just placing a mutator in the level won't work. Instead, I suggest you make a subclass of info to do the job, like this:

    // --------------------------------------------------------------------------
    // This actor will add a mutator to the game
    // --------------------------------------------------------------------------

    class MutatorSpawner extends Info;

    var() class<Mutator> MutatorClass;

    function BeginPlay() {
    Super.BeginPlay();
    Level.Game.BaseMutator.AddMutator(Spawn(MutatorClass));
    }

    defaultproperties {
    bHidden=true
    RemoteRole=ROLE_None
    }



    Then you can just throw down a MutatorSpawner and set the class of mutator to spawn when the game begins.
    Project Lead,
    Thievery UT.

  7. #7
    Member
    Registered: Sep 2002
    Location: Crouched behind a BSP-hole
    Ok, Thanks for the help Dalai, I guess I'll have to put the inventory items on hold (I could always hide them in the level somewhere).

    I'll implement the Mutator tonight, & see if it manages to successfully replace the repair kits.

    Thanks MO, for the LevelInfo suggestion, but I'll probably stick with the mutator for now.

  8. #8
    Member
    Registered: Sep 2002
    Location: Crouched behind a BSP-hole
    Hmm, I need to brush up on my Mutator-UScript knowledge.

    No luck so far, but I've got an alternate approach lined up (as opposed to just replacing one repair kit with the other, which doesn't appear to work) :

    -PlayerSpawn event called
    -Decide whether player owns a repair kit
    -Destroy the old repair kit
    -Give that player an advanced repair kit

    It's worth a try, although I suspect there may be a problem since players spawn before they start buying equipment

    (It's really annoying since this is a really minor matter, after I've got the ThRepairableObject & ThPickupAdvancedKit working)

    By the way, Dalai, would you find this ThRepairableObject of any use in 1.3?
    The dev team have given us so much, it'd be nice to give something back.

Posting Permissions

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