-TWC| Forum
  • Forum
    • Top donors
    • Calendar
    • Help
    • Search
    • Statistics
    • Users
  • Manage
    • Identity
    • Servers
  • DJBooth
  • Gallery
  • Members
  • Site
  • Support


Trackbase Gametracker Facebook Steam

Current time: 08-12-2019, 03:41 AM Hello There, Guest! (Login — Register)


-TWC| Forum >> Offtopic >> Creativity Corner >> Mapping v
1 2 Next »
>> Tutorial {Map Scripting} How to create Spawnpoints .

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode | Linear Mode
Tutorial {Map Scripting} How to create Spawnpoints .
01-09-2015, 08:37 PM (This post was last modified: 01-09-2015 08:51 PM by Hani.)
Post: #1
Hani Offline
Hmph.
**
Clan Friends
Posts: 6,105
Joined: May 2013
Reputation: 168
Confirmed Active Member Top Spammer
{Map Scripting} How to create Spawnpoints .
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.






Tutorial By Hani & Dominator56


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)

PHP Code:
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.

PHP Code:
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..

PHP Code:
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.

PHP Code:
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..

PHP Code:
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"
                
} 

7)So All Together for an allies spawnpoint will look like this,

PHP Code:
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.


PHP Code:
        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 :-

PHP Code:
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*

PHP Code:
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"
                
}

        
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
    
}
} 

*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.


~ All The Best.
Find all posts by this user
Quote this message in a reply
01-09-2015, 09:20 PM
Post: #2
Chris Offline
ヽ༼ຈل͜ຈ༽ノ
**
Clan Friends
Posts: 2,372
Joined: Aug 2012
Reputation: 114
Confirmed Active Member Top Spammer
RE: {Map Scripting} How to create Spawnpoints .
wouldn't you need permission of the map creator to even do so?


[Image: 76561198043822433.png]
Find all posts by this user
Quote this message in a reply
02-09-2015, 05:46 AM
Post: #3
Hani Offline
Hmph.
**
Clan Friends
Posts: 6,105
Joined: May 2013
Reputation: 168
Confirmed Active Member Top Spammer
RE: {Map Scripting} How to create Spawnpoints .
(01-09-2015 09:20 PM)Chris Wrote:  wouldn't you need permission of the map creator to even do so?

Is all the map creators are easy to make a contact with em and ask permission?
You don't need any permission when you r creating a fix but one thing is that you shouldn't say that yea I fixed this map..now this map is made by me..just an example so..

All the maps I fixed is attached with code already, I dont need to contact the creator of map and ask Permission lol..thats just a big waste of time.
and its SPAWNPOINT Scripting not Map Making.
Find all posts by this user
Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


  • View a Printable Version
  • Send this Thread to a Friend
  • Subscribe to this thread
Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | Site | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication

Powered By MyBB, © 2002-2019 MyBB Group.
Design: Duru
Theme reworked by Destroy666