Jump to content

{Map Scripting} How To Create Spawn Points.


Hani

Recommended Posts

As far as i remember, last month/weeks ago ive posted a help about creating Spawnpoints and stuff but i guess nobody sorted out( http://fearless-assassins.com/topic/73486-adding-spawnpoints-help/), but after research and thinking,

testing/scripting alot ive managed to find a way for creating spawnpoints for map & and i will show you guys how ive did it. 

 

Therefore, There are some maps that actually doesnt have Spawnpoints, How are we going to create or add one? , Easy..Just have a look on the video.

 

https://www.youtube.com/watch?v=qdrpx_ttlyY

 

 

In Theory:-

1)Download or find a map that doesnt have spawnpoints
2)Open its .pk3 file and inside you will find the "map" folder
3)Open the "map" folder you will find the (mapname).script file.
4)Open the (mapname).script file with notepad and u will see something likes this

(The .script file inside the map shows you how the map is controlled or i can say how the map is working and how is it making it run according to the objectives and the teams itself)

game_manager
{
        spawn
        {
 
                wm_axis_respawntime     3
                wm_allied_respawntime   3
                wm_set_round_timelimit  30
       
                wm_set_defending_team   0
 
                wm_setwinner    1
               
                setautospawn "Allies Spawn" 1
                setautospawn "Axis Spawn" 1
 
                wait 1000
        }
} 

-Sometimes some maps with more objectives and stuff have more codes..like this one.

game_manager
{
    spawn
    {
        wm_axis_respawntime        5
        wm_allied_respawntime    5
        wm_set_round_timelimit    25
        
        // Stopwatch mode defending team (0=Axis, 1=Allies)
        wm_set_defending_team    0
        
        // Winner on clock 0:00 (0=Axis, 1=Allies, -1=Nobody)
        wm_setwinner            0
        
        wait 100
        
        setstate sroom_1        default
        setstate sroom_2        invisible
        setstate sroom_3        invisible
        setstate sroom_4        invisible
        setstate sroom_s1        default
        setstate sroom_s2        invisible
        setstate sroom_s3        invisible
        setstate sroom_s4        invisible
        setstate sroom_teleport    invisible
    }
}

opener1
{
    trigger
    {
        trigger door1 open
    }
}

opener2
{
    trigger
    {
        trigger door2 open
    }
}

closer1
{
    trigger
    {
        trigger door1 close
    }
}

closer2
{
    trigger
    {
        trigger door2 close
    }
}

door1
{
    spawn
    {
        accum 0 set 0 // whether the door is open or closed
    }

    trigger open
    {
        accum 0 abort_if_equal 1
        stopsound
        playsound sound/movers/doors/door2_open.wav
        gotomarker door1_down 640
        accum 0 set 1
    }
    
    trigger close
    {
        accum 0 abort_if_equal 0
        stopsound
        gotomarker door1_up 480
        accum 0 set 0
    }
}

door2
{
    spawn
    {
        accum 0 set 0 // whether the door is open or closed
    }

    trigger open
    {
        accum 0 abort_if_equal 1
        stopsound
        playsound sound/movers/doors/door2_open.wav
        gotomarker door2_down 640
        accum 0 set 1
    }
    
    trigger close
    {
        accum 0 abort_if_equal 0
        stopsound
        gotomarker door2_up 480
        accum 0 set 0
    }
}

sroom_1
{
    trigger
    {
        setstate sroom_1    invisible
        setstate sroom_2    default
        setstate sroom_s1    invisible
        setstate sroom_s2    default
    }
}

sroom_2
{
    trigger
    {
        setstate sroom_2    invisible
        setstate sroom_3    default
        setstate sroom_s2    invisible
        setstate sroom_s3    default
    }
}

sroom_3
{
    trigger
    {
        setstate sroom_3    invisible
        setstate sroom_4    default
        setstate sroom_s3    invisible
        setstate sroom_s4    default
    }
}

sroom_4
{
    trigger
    {
        setstate sroom_4        invisible
        setstate sroom_s4        invisible
        setstate sroom_teleport    default
    }
}

sroom_reset
{
    trigger
    {
        setstate sroom_1        default
        setstate sroom_2        invisible
        setstate sroom_3        invisible
        setstate sroom_4        invisible
        setstate sroom_s1        default
        setstate sroom_s2        invisible
        setstate sroom_s3        invisible
        setstate sroom_s4        invisible
        setstate sroom_teleport    invisible
        setstate sroom_timer    invisible
    }
} 

-----------------------------------------------------------------

 

5)Somehow if you want to add a spawnpoint, You Should make sure you start adding it after the "Spawn{" Code Like this..

game_manager
{
    spawn
    {
        create
        {
            scriptName "allies_obj"
            classname "team_WOLF_objective"
            targetname "alliesspawn_obj"
            origin "-10853 -2036 6"    
            spawnflags 2    
        } 

6) This is the Main(Starting Code Spawnpoint) For Allies, You must Put this Code at first if you want to start creating a spawnpoint for Allies Team.

create
        {
            scriptName "allies_obj"
            classname "team_WOLF_objective"
            targetname "alliesspawn_obj"
            origin "-10853 -2036 6"    
            spawnflags 2    
        } 

7)After adding the first code for creating spawnpoint for allies, You want to lets say add amount of 5 spawnpoints for allies, so u will put it in this way..

create
        {
                scriptName "allies_spawn1"
                    classname "team_CTF_bluespawn"
                        targetname "allies_spawn"
                        origin "-4288 384 72"
                        spawnflags 2   
                        angle "0"
                }

                create
                {
                       scriptName "allies_spawn2"
                       classname "team_CTF_bluespawn"
                       targetname "allies_spawn"
                       origin "-4288 468 72"
                       spawnflags 2   
                       angle "0"
                }

                create
                {
                       scriptName "allies_spawn3"
                       classname "team_CTF_bluespawn"
                       targetname "allies_spawn"
                       origin "-4287 281 72"
                       spawnflags 2   
                       angle "0"
                }

                create
                {
                       scriptName "allies_spawn4"
                       classname "team_CTF_bluespawn"
                       targetname "allies_spawn"
                       origin "-4381 281 72"
                       spawnflags 2   
                       angle "0"
                }

                create
                {
                       scriptName "allies_spawn5"
                       classname "team_CTF_bluespawn"
                       targetname "allies_spawn"
                       origin "-4381 380 72"
                       spawnflags 2   
                       angle "0"
                } 

So All Together for an allies spawnpoint will look like this

game_manager
{
    spawn
    {
    
        create
        {
            scriptName "alliesspawn_obj"
            classname "team_WOLF_objective"
            targetname "alliesspawn_obj"
            origin "-4288 384 72"
            spawnflags 2    
            description "Allies Spawn"
        }
        
        create
         {
                      scriptName "allies_spawn1"
                      classname "team_CTF_bluespawn"
                       targetname "allies_spawn"
                       origin "-4288 384 72"
                       spawnflags 2   
                       angle "0"
                }

                create
                {
                       scriptName "allies_spawn2"
                       classname "team_CTF_bluespawn"
                       targetname "allies_spawn"
                       origin "-4288 468 72"
                       spawnflags 2   
                       angle "0"
                }

                create
                {
                       scriptName "allies_spawn3"
                       classname "team_CTF_bluespawn"
                       targetname "allies_spawn"
                       origin "-4287 281 72"
                       spawnflags 2   
                       angle "0"
                }

                create
                {
                       scriptName "allies_spawn4"
                       classname "team_CTF_bluespawn"
                       targetname "allies_spawn"
                       origin "-4381 281 72"
                       spawnflags 2   
                       angle "0"
                }

                create
                {
                       scriptName "allies_spawn5"
                       classname "team_CTF_bluespawn"
                       targetname "allies_spawn"
                       origin "-4381 380 72"
                       spawnflags 2   
                       angle "0"
                } 

8)Same For Axis But there will be just difference in their script words like the scriptname,classname and the targetname.

        create
        {
            scriptName "axisspawn_obj"
            classname "team_WOLF_objective"
            targetname "axisspawn_obj"
            origin "-1408 384 72"    
            spawnflags 2    
        }
                create
                {
                       scriptName "axis_spawn1"
                       classname "team_CTF_redspawn"
                       targetname "axis_spawn"
                       origin "-1408 384 72"
                       spawnflags 2  
                       angle "-179"
                }

                create
                {
                       scriptName "axis_spawn2"
                       classname "team_CTF_redspawn"
                       targetname "axis_spawn"
                       origin "-1407 298 72"
                       spawnflags 2   
                       angle "179"
                }

                create
                {
                       scriptName "axis_spawn3"
                       classname "team_CTF_redspawn"
                       targetname "axis_spawn"
                       origin "-1407 479 72"
                       spawnflags 2   
                       angle "179"
                }

                create
                {
                       scriptName "axis_spawn4"
                       classname "team_CTF_redspawn"
                       targetname "axis_spawn"
                       origin "-1322 383 72"
                       spawnflags 2   
                       angle "179"
                }

                create
                {
                       scriptName "axis_spawn5"
                       classname "team_CTF_redspawn"
                       targetname "axis_spawn"
                       origin "-1322 303 72"
                       spawnflags 2   
                       angle "179"
                } 

9)So All Together Axis & Allies Spawnpoints together should look like this :-

game_manager
{
    spawn
    {
    
        create
        {
            scriptName "alliesspawn_obj"
            classname "team_WOLF_objective"
            targetname "alliesspawn_obj"
            origin "-4288 384 72"
            spawnflags 2    
            description "Allies Spawn"
        }
        
        create
        {
                scriptName "allies_spawn1"
                    classname "team_CTF_bluespawn"
                        targetname "allies_spawn"
                        origin "-4288 384 72"
                        spawnflags 2   
                        angle "0"
                }

                create
                {
                       scriptName "allies_spawn2"
                       classname "team_CTF_bluespawn"
                       targetname "allies_spawn"
                       origin "-4288 468 72"
                       spawnflags 2   
                       angle "0"
                }

                create
                {
                       scriptName "allies_spawn3"
                       classname "team_CTF_bluespawn"
                       targetname "allies_spawn"
                       origin "-4287 281 72"
                       spawnflags 2   
                       angle "0"
                }

                create
                {
                       scriptName "allies_spawn4"
                       classname "team_CTF_bluespawn"
                       targetname "allies_spawn"
                       origin "-4381 281 72"
                       spawnflags 2   
                       angle "0"
                }

                create
                {
                       scriptName "allies_spawn5"
                       classname "team_CTF_bluespawn"
                       targetname "allies_spawn"
                       origin "-4381 380 72"
                       spawnflags 2   
                       angle "0"
                }
            create
        {
            scriptName "axisspawn_obj"
            classname "team_WOLF_objective"
            targetname "axisspawn_obj"
            origin "-1408 384 72"    
            spawnflags 2    
        }
                create
                {
                       scriptName "axis_spawn1"
                       classname "team_CTF_redspawn"
                       targetname "axis_spawn"
                       origin "-1408 384 72"
                       spawnflags 2  
                       angle "-179"
                }

                create
                {
                       scriptName "axis_spawn2"
                       classname "team_CTF_redspawn"
                       targetname "axis_spawn"
                       origin "-1407 298 72"
                       spawnflags 2   
                       angle "179"
                }

                create
                {
                       scriptName "axis_spawn3"
                       classname "team_CTF_redspawn"
                       targetname "axis_spawn"
                       origin "-1407 479 72"
                       spawnflags 2   
                       angle "179"
                }

                create
                {
                       scriptName "axis_spawn4"
                       classname "team_CTF_redspawn"
                       targetname "axis_spawn"
                       origin "-1322 383 72"
                       spawnflags 2   
                       angle "179"
                }

                create
                {
                       scriptName "axis_spawn5"
                       classname "team_CTF_redspawn"
                       targetname "axis_spawn"
                       origin "-1322 303 72"
                       spawnflags 2   
                       angle "179"
                } 

10) And now Lets add this code in the map's ".script" (MAPS THAT DOESNT HAVE SPAWNPOINTS)

 

*It Should look like this after all, Both Allies and Axis have 5 Spawnpoints now*

 

http://pastebin.com/i8QzU530

 

*Important Notices*
~ The Map Should be without spawnpoints if u want to add one, if you are adding a spawnpoint on a map that has already one , then it might not work at all ~ 
~ Spawnflags means = 2(ALLIES) 1(AXIS), sometimes Most of the map's axis spawnpoint doesnt work if u add number 1 in the axis's spawnflag code so better for both teams add "spawnflag 2" in the spawnpoint codes ~
~ Sometimes Map will crash..the problem is that you have done some typo or missed some brackets in the .script , so becarefull and put the code properly as how i did ~
~If you want to increase the amount of spawnpoints, then continue the same code by adding a allies_spawn2..3..4.5..6 etc.
~It will not work if you test it with your Local Host, You should create a private jaymod server and test it there, or share it with your freind's private server.

 

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.