The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

Battlefield game mode (Based on Warfare from UT3)

  • Filter
  • Time
  • Show
Clear All
new posts

  • Battlefield game mode (Based on Warfare from UT3)

    I want to make i game mode as seen in Battlefield 2. In order to do so i have started to look at Onslaught source from UT3, when i try to compile it i get these errors:
    E:\UDK\UDK-2010-02\Development\Src\WW2\Classes\UTOnslaughtFlag.uc(1) : Error, Unexpected 'п'
    E:\UDK\UDK-2010-02\Development\Src\WW2\Classes\UTOnslaughtGame.uc(1) : Error, Unexpected 'п'
    E:\UDK\UDK-2010-02\Development\Src\WW2\Classes\UTOnslaughtGodBeam.uc(1) : Error, Unexpected 'п'
    E:\UDK\UDK-2010-02\Development\Src\WW2\Classes\UTOnslaughtGRI.uc(1) : Error, Unexpected 'п'
    E:\UDK\UDK-2010-02\Development\Src\WW2\Classes\UTOnslaughtHUD.uc(1) : Error, Unexpected 'п'
    E:\UDK\UDK-2010-02\Development\Src\WW2\Classes\UTOnslaughtHUDMessage.uc(1) : Error, Unexpected 'п'
    E:\UDK\UDK-2010-02\Development\Src\WW2\Classes\UTOnslaughtObjective.uc(1) : Error, Unexpected 'п'
    E:\UDK\UDK-2010-02\Development\Src\WW2\Classes\UTOnslaughtMapInfo.uc(1) : Error, Unexpected 'п'
    E:\UDK\UDK-2010-02\Development\Src\WW2\Classes\UTOnslaughtMiningRobot.uc(1) : Error, Unexpected 'п'
    E:\UDK\UDK-2010-02\Development\Src\WW2\Classes\UTOnslaughtMiningRobotController.uc(1) : Error, Unexpected 'п'
    E:\UDK\UDK-2010-02\Development\Src\WW2\Classes\UTOnslaughtNodeEnhancement.uc(1) : Error, Unexpected 'п'
    E:\UDK\UDK-2010-02\Development\Src\WW2\Classes\UTOnslaughtNodeHealEffectBase.uc(1) : Error, Unexpected 'п'
    E:\UDK\UDK-2010-02\Development\Src\WW2\Classes\UTOnslaughtNodeTeleporter.uc(1) : Error, Unexpected 'п'
    E:\UDK\UDK-2010-02\Development\Src\WW2\Classes\UTOnslaughtPRI.uc(1) : Error, Unexpected 'п'
    E:\UDK\UDK-2010-02\Development\Src\WW2\Classes\UTOnslaughtSquadAI.uc(1) : Error, Unexpected 'п'
    E:\UDK\UDK-2010-02\Development\Src\WW2\Classes\UTOnslaughtTarydiumMine.uc(1) : Error, Unexpected 'п'
    E:\UDK\UDK-2010-02\Development\Src\WW2\Classes\UTOnslaughtTeamAI.uc(1) : Error, Unexpected 'п'
    E:\UDK\UDK-2010-02\Development\Src\WW2\Classes\UTOnsScoreboardPanel.uc(1) : Error, Unexpected 'п'
    obviously there is no character П in its code

  • #2
    Open them with a Hex editor (like HxD) and remove the first character from the files. Or open them in an other tool than notepad...


    • #3
      Yeah, i toticed that when i delete all contents files is still 3 bytes instead of 0. Thanks for help.


      • #4
        Are you actually using some of the script files from UT3? I'm not positive, but I would assume that is against the UDK license agreement.


        • #5
          I am not going to be using them, I am writing code based on them. So basically I would totally modify them.


          • #6
            Basically only functionality i need from UT3 is how capturing nodes work (player just would have to stand within some radius of point). Other then that it will be completely different game mode


            • #7
              save your files as unicode this should get rid of that error


              • #8
                I believe this one will be hard to implement cause there is a lot onslaught code. going through could take weeks. but hope i can do it


                • #9
                  So i guess i start from scratch will slowly build up this game mode.
                  So basically my idea shouldn't be too hard to implement.
                  I am not planing on implementing vehicles so i guess i could use UTTeamGame
                  1. I need to set up some static mesh to be a flag(non-movable) (placeable nav point)
                  2. Create a radius around it so once a player is inside this radius Capture value start to fill up every second and then once its at 100 set flag material to according team
                  3. If one team has more captured points then other start deducting spawn points
                  4. Team who has no spawn point loses.

                  So what i would need help with is points 1 and 2. Also i believe that i am not going to do any AI for my game. So it should make it simpler

                  Any suggestions, help, tutorials are greatly appreciated.


                  • #10
                    Argh, I typed like a huge post but my browser refreshed, so here is a simplified version as I don't feel like typing again.

                    To solve 1 and 2 make an custom placeable actor for your flag, like FlagCapturePoint.

                    Make it have an integer for the capture value, and an integer holding how many capturing players are within radius (possibly another one for the player that already own the flag). Upon PostBeginPlay in the Gametype you can do a ForEach on these to count how many flags there are in the current level (and thus figure out a win situation or how fast the tick-points of each team decreases).

                    In the actor add a Tick-event which does the following things:
                    - Iterate over all Pawns and calculate their distance to the flag, you do this as follows:
                    float distance = VSize(Pawn.Location - self.Location);
                    - Increase the respective playercount-integers and possibly store a refeference to the player so you can force them to show a HUD-thing later perhaps.
                    - Next do some funky formula to calculate a new capture-threshold which gets added to the current value (or subtracted up till 0 in case of making the flag neutral first) every second. You can go completely wild, but be sure to not continue with this "funky formula" if playercount-integers are 0, for performance.

                    You might say: Why not do this in the Pawn itself? Because this is gametype-gameplay-element which the pawn shouldn't know off, only the HUD would need to know about the fact it might happen that it has to display a capture-icon, maybe not even that. It's really a case of code-seperation.

                    Besides, it might happen you have overlapping radiuses, this way the Pawn/PC doesn't have to worry about that, as each flag does it all by itself.


                    • #11
                      thanks for replies and ideas
                      I am trying to assign a static mesh to make flagcapturepoint, but in the editor static mesh doesnt show up, only icon of objetivepoint

                      class WW2_FlagCapturePoint extends UTGameObjective	
                      	begin object class=StaticMeshComponent name=FlagMesh
                      	end object


                      • #12
                        You forgot
                        right below the object in defaultproperties.

                        And you'd be better of extending right of Actor, as you shouldn't need any higher classes for this to work, you only need Tick afterall, nothing more.


                        • #13
                          Thanks it worked , For capture radius would I define collision cylinder or make some kind of trigger with touch/untoch events?

                          Also having problem with static mesh it is unlit


                          • #14
                            Read what I typed, from the tick-event you iterate over all pawns in WorldInfo (ForEach) and calculate their distance from the flag.


                            • #15
                              Ok, I get the idea, so based on player distance to flag i can execute different code. What i have problem with is Pawn.Location . Looks like i have to cast it? because it says bad or missing token for Pawn.Location