Announcement

Collapse
No announcement yet.

Coding a Bombing Run Ball Spawn

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Coding a Bombing Run Ball Spawn

    I think this is the place for this...I'm working on my second Bombing Run map, and I want the ball to be hovering in a low gravity area. All well and good EXCEPT the Bomb Base appears under it, and it really takes away from the effect I was going for. I can't find anything in the Ball Spawn properties that allow the base to not be shown. is there a simple solution, or am i gonna have to code a new BR Ballspawn? I'm new to map designing, and have no experience with scripting. anyone have any ideas? any help would be much appreciated!

    #2
    See if you can set the mesh property to none (in Display?) for the base.

    Comment


      #3
      ok... i tried that. it did not display anything in the editor, but in game:

      the bomb base doesnt show in the editor, only the ballspawn. it seems to be coded into the actor itself to show the base. I popped open the script in UED, to see if i could find anything that may point me in the right direction i included the whole script, so it could be seen in full, the bold area is something that caught my attention:
      //================================================== ===========================
      // xBombSpawn.
      //================================================== ===========================
      class xBombSpawn extends GameObjective
      placeable;

      var() Sound TakenSound;
      var xBombFlag myFlag;
      var class<xBombFlag> FlagType;

      #exec OBJ LOAD FILE=XGameShaders.utx

      function BeginPlay()
      {
      Super.BeginPlay();
      if ( !Level.Game.IsA('xBombingRun') )
      return;

      myFlag = Spawn(FlagType, self);

      if (myFlag==None)
      {
      warn(Self$" could not spawn flag of type '"$FlagType$"' at "$location);
      return;
      }
      else
      myFlag.HomeBase = self;

      Spawn(class'XGame.xBombBase',self,,Location-vect(0,0,60),Rotation);
      }


      function bool BotNearObjective(Bot B)
      {

      if ( (myFlag == None) || (B==None) )
      return false;

      if ( (MyBaseVolume != None) && myFlag.bHome && B.Pawn.IsInVolume(MyBaseVolume) )
      return true;

      return ( (VSize(myFlag.Position().Location - B.Pawn.Location) < 2000) && B.LineOfSightTo(myFlag.Position()) );
      }

      function bool BetterObjectiveThan(GameObjective Best, byte DesiredTeamNum, byte RequesterTeamNum)
      {
      if ( !myFlag.bHome || (RequesterTeamNum == DesiredTeamNum) )
      return false;
      return true;
      }

      i created my own xballspawn actor, copied the code, and took out that line... just to see if it would work. NOPE. when i put it back in, worked fine. i dont even know if that's the line i need to change, but it was the only thing in the script that i could find that even remotely pointed to the bomb base. anyone have any more suggestions?

      EDIT: i thought that line i bolded was pointing to a static mesh, so i tried changing the reference. it's not that either... i'm confuzzled.

      Comment


        #4
        Ok you want to subclass xBombBase, and in the defaults, set bHidden = false.

        The problem with that is that in order to do so, you are going to have to subclass at LEAST xBombSpawn as well so that it will spawn your subclass of xBombBase instead.

        So subclass xBombSpawn, and in that function:
        Code:
        function BeginPlay()
        {
        Super.BeginPlay();
        if ( !Level.Game.IsA('xBombingRun') )
        return;
        
        myFlag = Spawn(FlagType, self);
        
        if (myFlag==None)
        {
        warn(Self$" could not spawn flag of type '"$FlagType$"' at "$location);
        return;
        }
        else
        myFlag.HomeBase = self;
        
        Spawn(class'yourGame.yourBombBase',self,,Location-vect(0,0,60),Rotation);
        }
        However.

        In that function it calls super.PostBeginPlay(), which you do not want to do because it will just spawn xBombBase over your's. Tis getting more complex.

        So I guess what you will have to do is instead of calling super.PostBeginPlay, you will have to copy the PostBeginPlay from GameObjective and paste it in there. Messy.

        Unless there's a way to call super.super, and heh Supercede the call over xBombSpawns head. I think there have been some threads about whether that is possible, I don't remember the answer at the moment as I have never needed to do it.

        Comment


          #5
          Originally posted by cknight52
          So I guess what you will have to do is instead of calling super.PostBeginPlay, you will have to copy the PostBeginPlay from GameObjective and paste it in there. Messy.
          Na. Just do this:
          Code:
          function BeginPlay()
          {
                  //Skips xBombSpawn's BeginPlay:
          	Super(GameObjective).BeginPlay();
          	if ( !Level.Game.IsA('xBombingRun') )
          		return;
          		
          	myFlag = Spawn(FlagType, self);
          
          	if (myFlag==None)
          	{
          		warn(Self$" could not spawn flag of type '"$FlagType$"' at "$location);
          		return;
          	}
          	else
          		myFlag.HomeBase = self;
          	
          	
              //Comment out or delete this line:
              //Spawn(class'XGame.xBombBase',self,,Location-vect(0,0,60),Rotation);
          }

          Comment


            #6
            Excellent :up: So is that how you call the super of a super?

            Comment


              #7
              Yup yup. Comes in handy quite a bit, especially when you're subclassing something that spawns effects.

              Comment


                #8
                ok... so i think i understand chinese better than that... if i take that section of the script you posted angel, copy it verbatim, and replace it with the xbombspawn script... it will not show the bombbase?
                Super(GameObjective).BeginPlay(); should contain the name of the game objective E.G.: Super(Bomb Spawn).BeginPlay(); ... is that correct, or am i misunderstanding? i'm not familiar with commenting out scripts so if i delete Spawn(class'XGame.xBombBase',self,,Location-vect(0,0,60),Rotation);
                } it should work????? forgive me... i have no scripting experience whatsoever... but i guess this will inspire me to learn!

                EDIT: i decided to just take what you posted, throw it in there and see what happened. i didnt get any errors this time... but when i went ingame, the bombase was still present... except it is black instead of being textured. also... does "//" comment out something from the script???? I think i may just have to live with the bombbase being there for now. thank you very much for the help though! if anyone knows how to get this **** thing completely removed, or hell, just invisible... i'd be VERY greatful! i have no money... but i would be sure to give proper "THANK YOU______!!! YOU OWN!!!!" credit.

                Comment


                  #9
                  Allrighty here's what you do, but you will have to compile these...


                  1st new class:

                  Code:
                  class porcupineBombBase expands xBombBase;
                  
                  defaultproperties
                  {   
                     bHidden=true
                  }
                  Thats it for that one. Now, for the second new class

                  Code:
                  porcupineBombSpawn expands xBombSpawn;
                  
                  function BeginPlay()
                  {
                    //Skips xBombSpawn's BeginPlay:
                    Super(GameObjective).BeginPlay();
                    if ( !Level.Game.IsA('xBombingRun') )
                      return;
                    myFlag = Spawn(FlagType, self);
                    if (myFlag==None)
                    {
                      warn(Self$" could not spawn flag of type '"$FlagType$"'at "$location);
                       return;
                    }
                    else
                      myFlag.HomeBase = self;
                      Spawn(class'porcupinePackage.porcupineBombBase',self,,Location-vect(0,0,60),Rotation);
                  }
                  
                  defaultproperties
                  {   
                  }
                  The class'porcupinePackage.porcupineBombBase references back to the first class you created. When you save the classes, they will have to be in some package, hence the porcupinePackage.

                  Then when you are making your map, instead of dropping in an xBombSpawn, you will drop in your's instead.

                  Comment


                    #10
                    AWESOME!!!! i will try it out! thank you SOOO much for taking a few minutes to help me with this!

                    Comment


                      #11
                      ok, so this is alot harder than i thought! maybe some other day i'll start to learn uScript... but that day is not today. sorry for wasting your time, but i think this is way over my head right now!

                      EDIT: this was buggin me that i couldnt figure it out, so i visited angel mapper's WONDERFUL!!! site, read her basic coding tutorial, and applied it to the problem i was trying to solve. it makes more sense now, and:

                      WOOHOO! thank you both for your help! angel mapper, you have a grand way of explaining things so they make sense! i had a hard time figuring out how to access the Xbombbase, so i d/led the scripts as instructed to do on the tut, popped it open, and guess what?
                      //=================================================
                      //xBombBase.
                      // For decoration only, this actor serves no game-related purpose!
                      //=================================================

                      my question is... why the hell even have it in the first place??? mappers could just use the static mesh base if they so desire. if any of the handful of br mappers want the bombspawn without the base, just ask and it's yours. thank you again cknight and angel mapper!

                      Comment

                      Working...
                      X