BTPlusPlus + weapons -> weapons not appearing in map

Discussions about Coding and Scripting
ShaiHulud
Adept
Posts: 459
Joined: Sat Dec 22, 2012 6:37 am

BTPlusPlus + weapons -> weapons not appearing in map

Post by ShaiHulud »

Hello

Another problem! We have an unusual map on our BT server which features "NemesisXF.Konglauncher" SLV style rockets. Except they don't appear, and neither does the ammo ("NemesisXF.Fuelcore") associated with them. After a bit of testing, I found this was down to the:

bAutoLoadInsta=True

...in BTPlusPlus.ini. If I set this to False, the rockets and ammo show up on the map. The code segment in BTPlusPlus which references "bAutoLoadInsta":

Code: Select all

if (bAutoLoadInsta)
{
  if ((!bDisableInTournament || !class<DeathMatchPlus>(Level.Game.Class).Default.bTournament)
      && (!bDisableInNonBTMaps || (Left(string(Level), 3) ~="BT-" || Left(string(Level), 7) ~="CTF-BT-")))
  {
    RemoveActorsForInsta();
    Insta = Level.spawn(class'InstaGibBT');
    Insta.DefaultWeapon = class'SuperShockRifleBT';
    Level.Game.BaseMutator.AddMutator(Insta);
  }
}

...

function RemoveActorsForInsta()
{
  local Inventory I;
  local Actor A;
  local Mutator M, Temp;

  M = Level.Game.BaseMutator;

  while (M.NextMutator != None)
  {
    // check for all zp variants
    if (CheckClassForZP(M.NextMutator.Class))
    {
      Temp = M.NextMutator.NextMutator;
      M.NextMutator.Destroy();
      M.NextMutator = Temp;
      break;
    }
    else
      M = M.NextMutator;
  }

  foreach AllActors(class'Actor', A)
  {
    if (CheckClassForZP(A.class))
      A.Destroy();
  }
}
So, it seems (I think) that BTPlusPlus destroys all of the rockets and ammunition. If I set bAutoLoadInsta to False, then all of the usual CTF weapons appear in the player inventory, and no SuperShockRifle, which obviously isn't desirable. The rockets and ammo *do* show up under these conditions however.

My first thought was that I could create a Mutator that would be embedded in the map and set the BTPlusPlus object's bAutoLoadInsta variable to False in its PreBeginPlay(), but it seems that BTPlusPlus's PreBeginPlay() always gets called first, and before I can do anything about it. I don't know if there's some way I can influence the order of execution - bearing in mind also that the script is "embedded" in the map.

My second idea was less generic, I thought I'd just manually respawn all of the rockets and ammo at their original locations once PostBeginPlay() had been reached... but this doesn't work either. Again, it's OK when bAutoLoadInsta is False, but doesn't do anything when bAutoLoadInsta is True (not entirely sure why).

So, I'd be grateful for any suggestions for ways I can work around this. It's *only* relevant for this single map, so I'm hoping for a solution that won't affect settings elsewhere.
Thank you very much in advance!
UT99.org

Re: BTPlusPlus + weapons -> weapons not appearing in map

Post by UT99.org »

medor wrote:Use KeepIt http://unrealtournament.99.free.fr/foru ... =51&t=1766

I use SLV with insta zp and translock if you want to try online unreal://178.32.72.37:7777/?password=eric
so you can use NemesisX with ZPV210Pack http://unrealtournament.99.free.fr/utfi ... 10Pack.zip


Mapvote CustomGameConfig
Spoiler

Code: Select all

CustomGameConfig[11]=(bEnabled=True,GameClass="Botpack.CTFGame",NewPrefix="IslvCTF",Mutators="SLV205.StrangeArena,ZPColorInstagibAddOnV210.ColorInstagib,KeepIt.Keep1,BatThwap.BatThwap,HyperTrans.TranslocMutator,DoubleJumpUT.DoubleJumpUT,SmartCTF_4E.SmartCTF,Flags3F.Flags3F,heineken2.heineken2,QFeedback_v22.QFeedback,RextendedCTFv2-2.RexCTF,NoSLPickup110.PickupMutator,Settings=",Settings="GoalTeamScore=5.000000,TimeLimit=20,bPlayersBalanceTeams=True,bMultiWeaponStay=True,bBalanceTeams=False,FriendlyFireScale=0.0,bTournament=False,bautopause=False,MaxPlayers=12,MaxTeams=2,MaxSpectators=0,MinPlayers=4,bForceRespawn=False")
ShaiHulud
Adept
Posts: 459
Joined: Sat Dec 22, 2012 6:37 am

Re: BTPlusPlus + weapons -> weapons not appearing in map

Post by ShaiHulud »

Thanks medor, that's really useful. I added it, and the rockets *did* appear on the map after that, but as soon as I grabbed one the server crashed and the log looked like this (if I'd actually managed to get my "embedded" script to work, the same thing would have happened no doubt):

Code: Select all

ScriptLog: tried to add none inventory to CTF-BT-NemesisX.TMale0
ScriptWarning: TMale2 CTF-BT-NemesisX.TMale0 (Function Engine.Pawn.AddInventory:0076) Accessed None
ScriptWarning: TMale2 CTF-BT-NemesisX.TMale0 (Function Engine.Pawn.AddInventory:0084) Accessed None
ScriptWarning: TMale2 CTF-BT-NemesisX.TMale0 (Function Engine.Pawn.AddInventory:008C) Attempt to assigned variable through None
ScriptWarning: Konglauncher CTF-BT-NemesisX.Konglauncher0 (Function NemesisXF.SLWeapon.GiveAmmo:0094) Accessed None
ScriptWarning: Konglauncher CTF-BT-NemesisX.Konglauncher0 (Function NemesisXF.SLWeapon.GiveAmmo:00A3) Accessed None
Critical: appError called:
Critical: keep1 CTF-BT-NemesisX.keep0 (Function keepit.keep1.AlwaysKeep:0000) Infinite script recursion (250 calls) detected
Exit: Executing UObject::StaticShutdownAfterError
Any tips?
ShaiHulud
Adept
Posts: 459
Joined: Sat Dec 22, 2012 6:37 am

Re: BTPlusPlus + weapons -> weapons not appearing in map

Post by ShaiHulud »

Still stuck on this. Perhaps someone can tell me why trying to spawn replacement rockets/ammo is failing. This is what I'm trying to do:

Code: Select all

class AddNemesis extends Mutator config (AddNemesis);

var TournamentWeapon NemesisX;
...
function SetInitialState()
{
  local Actor A;
  local Vector aVector;
  local Rotator aRotator;

  aVector = vect(-2306.510742, -61.363605, -131.881836);
  aRotator = rot(0, 0, 96);
  NemesisX = Spawn(class'NemesisXF.Konglauncher', None, 'Konglauncher27', aVector, aRotator);
  NemesisX.bGameRelevant = True;
}
The values for aVector and aRotator are taken from the map in UnrealEd by right-clicking the object I want to replace, then choosing Properties, Expanding Movement, then Location for the aVector values, and Rotation under Movement for the values for aRotator. Uhm, I try setting bGameRelevant to true because of this in the UnrealWiki:
Note: Any actors spawned before this or during the base mutator's initialization (see Chain Of Events When Spawning Actors) must have bGameRelevant=True set or they will cause an Accessed None when trying to call the base mutator's CheckRelevance() function and as a result of this destroy themselves.
http://wiki.beyondunreal.com/Legacy:Cha ... el_Startup


If I do this:

Code: Select all

class AddNemesis extends Mutator config (AddNemesis);

var TournamentWeapon NemesisX;
...
function SetInitialState()
{
  local Actor A;
  local Vector aVector;
  local Rotator aRotator;

  aVector = vect(-2306.510742, -61.363605, -131.881836);
  aRotator = rot(0, 0, 96);
  NemesisX = Spawn(class'NemesisXF.Konglauncher', None, 'Konglauncher27', aVector, aRotator);
  if (NemesisX != None)
    Log("NemesisX created successfully");
  else
    Log("NemesisX NOT created successfully");
  NemesisX.bGameRelevant = True;
}
...I always get the "NemesisX NOT created successfully" message. I chose SetInitialState() because I reasoned that this would come well after the PreBeginPlay() in BTPlusPlus where it calls its RemoveActorsForInsta() function.

I've no idea if I'm spawning things correctly though, or why they aren't successfully instantiated, so I'd be really grateful if someone could point out where I'm going wrong (or offer other alternatives!).

Thanks again
TARZANFROMJUNGLE
Novice
Posts: 23
Joined: Thu Aug 16, 2012 10:36 pm

Re: BTPlusPlus + weapons -> weapons not appearing in map

Post by TARZANFROMJUNGLE »

Have always told ya before, mate. Riding deemers is not for BT ;)

Hope everything else is going well with the new server.
I don't have an attitude problem, you have a perception problem.
ShaiHulud
Adept
Posts: 459
Joined: Sat Dec 22, 2012 6:37 am

Re: BTPlusPlus + weapons -> weapons not appearing in map

Post by ShaiHulud »

Heyyy! :) You did, you did. Well, this time it wasn't intended, but we inherited the map from one of our new regulars :) We've had quite a few mappers stop by recently, and asterix and some of the FBT guys have been playing there so it's been quite competitive!

But yeah, it's going pretty well, one strange Nexgen problem to fix, but other than that and a few slightly broken maps, can't complain too much. Good to hear from you :)

Ugh. I copied what medToggle is doing with the spawn part, but it just doesn't seem to work in this instance, it's confusing. I don't know enough about how the system works to make good guesses at what I'm doing wrong.
ShaiHulud
Adept
Posts: 459
Joined: Sat Dec 22, 2012 6:37 am

Re: BTPlusPlus + weapons -> weapons not appearing in map

Post by ShaiHulud »

OK, I'm getting nowhere, so perhaps I need to go back a few steps. I've been looking at how other people go about spawning new actors in the game, and attempting to duplicate this in my script, but for reasons that are beyond me at present it isn't working. It seems as though any actor I spawn is instantly destroyed.

Could someone post a very simple example of how you would go about spawning - say - an Enforcer into the game?

Thank you in advance.
ShaiHulud
Adept
Posts: 459
Joined: Sat Dec 22, 2012 6:37 am

Re: BTPlusPlus + weapons -> weapons not appearing in map

Post by ShaiHulud »

Still searching for a solution. I realised the limits of my understanding when I wasn't able to Spawn() and "standard" items once the map was running. Subsequently I found that commenting this line in BTPlusPlus.uc:

Code: Select all

Level.Game.BaseMutator.AddMutator(Insta);
...allowed the NemesisX rockets to appear. "Insta" here is a "InstaGibBT":

Code: Select all

class InstaGibBT expands InstaGibDM;
And after a bit of searching, I came to understand that InstaGibDM is an Arena mutator which screens out anything that isn't a SuperShockRifle via its AlwaysKeep() function.
So I added my own AlwaysKeep() to the script for this map:

Code: Select all

function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
  if (Other.IsA('Konglauncher') || Other.IsA('Fuelcore'))
    return True;

  return Super.CheckReplacement( Other, bSuperRelevant );
}
...and now the NemesisX rockets and the Fuelcores show up in the game (this is basically what KeepIt - which Medor suggested earlier - does), but I still have the same issue I had with KeepIt, which is - once the game is underway, as soon as I touch a NemesisX rocket or FuelCore, the server crashes, and the log shows a lot of errors like this:
ScriptLog: tried to add none inventory to CTF-BT-NemesisX.TMale0
ScriptWarning: TMale2 CTF-BT-NemesisX.TMale0 (Function Engine.Pawn.AddInventory:0076) Accessed None
ScriptWarning: TMale2 CTF-BT-NemesisX.TMale0 (Function Engine.Pawn.AddInventory:0084) Accessed None
ScriptWarning: TMale2 CTF-BT-NemesisX.TMale0 (Function Engine.Pawn.AddInventory:008C) Attempt to assigned variable through None
ScriptWarning: Konglauncher CTF-BT-NemesisX.Konglauncher9 (Function NemesisXF.SLWeapon.GiveAmmo:0094) Accessed None
ScriptWarning: Konglauncher CTF-BT-NemesisX.Konglauncher9 (Function NemesisXF.SLWeapon.GiveAmmo:00A3) Accessed None
ScriptLog: tried to add none inventory to CTF-BT-NemesisX.TMale0
I really don't know enough to understand what's going on here. Can anyone suggest what might be causing this to happen? Thanks in advance
UT99.org

Re: BTPlusPlus + weapons -> weapons not appearing in map

Post by UT99.org »

medor wrote:Your insta is a zp one ? witch one you use ?

Some insta not work with it . Give me all links weapons you want to use in same time i' m going to try mix it for you.

BTPlusPlusv0994 ?
ShaiHulud
Adept
Posts: 459
Joined: Sat Dec 22, 2012 6:37 am

Re: BTPlusPlus + weapons -> weapons not appearing in map

Post by ShaiHulud »

Hey medor! That's extremely kind of you.

Yes, I'm using:

- BTPlusPlusv0994
- This is the map (sorry for the download size) http://www.mediafire.com/?uj1w9yn077sy2hy
- The instagib we use is from i4games http://www.mediafire.com/?jbug48g9f192c7g

Our server command line (to see mutator order) looks like this (edited a bit)

Code: Select all

./ucc-bin server BT-!nekoDungeon?game=Botpack.CTFGame?mutator=BTPlusPlusv0994.BTPlusPlus,BTCheckPoints.BTCheckPoints,i4Games_InstaGib_200810.i4Games_InstaGib,MapVote.BDBMapVote?MaxPlayers=10 ini=UnrealTournament.ini multihome=<SERVER_IP_ADDRESS> port=7777 -nohomedir
Really appreciate it :)
UT99.org

Re: BTPlusPlus + weapons -> weapons not appearing in map

Post by UT99.org »

medor wrote:
ShaiHulud wrote:Hey medor! That's extremely kind of you.

Yes, I'm using:

- BTPlusPlusv0994
- This is the map (sorry for the download size) http://www.mediafire.com/?uj1w9yn077sy2hy
- The instagib we use is from i4games http://www.mediafire.com/?jbug48g9f192c7g

Our server command line (to see mutator order) looks like this (edited a bit)

Code: Select all

./ucc-bin server BT-!nekoDungeon?game=Botpack.CTFGame?mutator=BTPlusPlusv0994.BTPlusPlus,BTCheckPoints.BTCheckPoints,i4Games_InstaGib_200810.i4Games_InstaGib,MapVote.BDBMapVote?MaxPlayers=10 ini=UnrealTournament.ini multihome=<SERVER_IP_ADDRESS> port=7777 -nohomedir


Really appreciate it :)
and NemesisXF to ?

edit oh ok i see it in the zip :lol:
UT99.org

Re: BTPlusPlus + weapons -> weapons not appearing in map

Post by UT99.org »

medor wrote:Go try at unreal://178.32.72.37:7777/?password=eric if it's what you want 3em column
There is to translock but we can easily remove it.
ShaiHulud
Adept
Posts: 459
Joined: Sat Dec 22, 2012 6:37 am

Re: BTPlusPlus + weapons -> weapons not appearing in map

Post by ShaiHulud »

Hi again medor :)

That's excellent - is this configuration only possible with (in BTPlusPlus.ini) bAutoLoadInsta=False, or is there some way to make it all work when bAutoLoadInsta is True?

Thanks again!
UT99.org

Re: BTPlusPlus + weapons -> weapons not appearing in map

Post by UT99.org »

medor wrote:Not work when bAutoLoadInsta is True but may be we can allow with KeepIt.ini

I try an other way because we can not accelerate with the Nemesis
UT99.org

Re: BTPlusPlus + weapons -> weapons not appearing in map

Post by UT99.org »

medor wrote:just add KeepIt and it work with bAutoLoadInsta=True
Post Reply