UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

[User Tutorial] Multi-Area Maps (Like Town, Farm, Bus Depot in Green Run)

broken avatar :(
Created 13 years ago
by JR-Imagine
0 Members and 1 Guest are viewing this topic.
2,477 views
broken avatar :(
×
broken avatar :(
Location: be
Date Registered: 17 August 2013
Last active: 5 years ago
Posts
369
Respect
Forum Rank
Perk Hacker
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
Web & Software Developer and Designer
Signature
"Deleted code is debugged code." - Jeff Sickel
"Mathematicians stand on each others' shoulders and computer scientists stand on each others' toes." - Richard Hamming
×
JR-Imagine's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
This tutorial will show you how to make an area system like in Green Run or any other map from BO2 with multiple playable areas. (Example: Town, Farm, Bus Depot ...) You need some scripting experience for this since I'm not going to explain how to implement a menu for your area selection or anything like that. You're on your own for that.

1. The Area script
Make a new .gsc file and save it in mods/MAPNAME/maps as areas.gsc:
Code Snippet
Plaintext
//Multi-Area Script by JR-Imagine

//Including needed files
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;
#include maps\_zombiemode_zone_manager;
#include maps\dlc3_code;

//Initiating the area selection
init()
{
thread spawn_area1();
}

spawn_area1()
{
//Activate the Area 1 zone
zones = [];
zones[ zones.size ] = "zone_area1";
level.DLC3.initialZones = zones;

//Define the spawnpoints
spawn0 = getEnt ("area1_spawn0", "targetname");
spawn1 = getEnt ("area1_spawn1", "targetname");
spawn2 = getEnt ("area1_spawn2", "targetname");
spawn3 = getEnt ("area1_spawn3", "targetname");

//Spawn the players at their respective spawnpoints
players = getPlayers();

players[0] SetOrigin(spawn0.origin);
players[0] SetPlayerAngles( spawn0.angles );

players[1] SetOrigin(spawn1.origin);
players[1] SetPlayerAngles( spawn1.angles );

players[2] SetOrigin(spawn2.origin);
players[2] SetPlayerAngles( spawn2.angles );

players[3] SetOrigin(spawn3.origin);
players[3] SetPlayerAngles( spawn3.angles );
}

spawn_area2()
{
//Activate the Area 2 zone
zones = [];
zones[ zones.size ] = "zone_area2";
level.DLC3.initialZones = zones;

//Define the spawnpoints
spawn0 = getEnt ("area2_spawn0", "targetname");
spawn1 = getEnt ("area2_spawn1", "targetname");
spawn2 = getEnt ("area2_spawn2", "targetname");
spawn3 = getEnt ("area2_spawn3", "targetname");

//Spawn the players at their respective spawnpoints
players = getPlayers();

players[0] SetOrigin(spawn0.origin);
players[0] SetPlayerAngles( spawn0.angles );

players[1] SetOrigin(spawn1.origin);
players[1] SetPlayerAngles( spawn1.angles );

players[2] SetOrigin(spawn2.origin);
players[2] SetPlayerAngles( spawn2.angles );

players[3] SetOrigin(spawn3.origin);
players[3] SetPlayerAngles( spawn3.angles );
}
That's the basic set up for a map with 2 areas. If you want more, simply copy over the spawn_area1() function and change the area number.
NOTE: The init function is just for testing purposes, you'll have to edit that function yourself to define wich area is activated when the game starts.



2. Making the script function
Now obviously, just placing this script where I told you to wouldn't do anything. We'll have to open up our mapname.gsc and look for this line:
Code Snippet
Plaintext
maps\_zombiemode::main();

Add the following code AFTER that line:
Code Snippet
Plaintext
maps\areas::init();

So it looks like this:
Code Snippet
Plaintext
maps\_zombiemode::main();
maps\areas::init();

This will call the init() function of the areas.gsc file.



3. Radiant: Spawnpoints
Add a script->origin to your map and give it these KVPs:
"targetname"   "area1_spawn0"
Copy that script origin and change the KVPs to the names of each spawnpoint. This is the list we are using in our script: (including the one we just added)
"targetname"   "area1_spawn0"
"targetname"   "area1_spawn1"
"targetname"   "area1_spawn2"
"targetname"   "area1_spawn3"
"targetname"   "area2_spawn0"
"targetname"   "area2_spawn1"
"targetname"   "area2_spawn2"
"targetname"   "area2_spawn3"

Please note that you still need to add the 4 standard spawn points.



4. Radiant: Zones
Create 2 zones (I hope you already know how to do that...) with zone names of "zone_area1" and "zone_area2". These are the zones defined in the script that will activate when you spawn. "zone_area1" activates when you spawn in area1, "zone_area2" activates when you spawn in area2.



5. Init() function
As I already mentioned before, you still need to edit the init() function. There's several ways of setting this up. You'll have to find one that fits for you. I'm NOT going to explain how to create a menu for it or anything else.
I might edit this later on with a script for a menu or a area selection room. The script will be commented so you know what to change etc. No further explanation will be given. As I already mentioned, you needed some scripting experience for this.
Last Edit: October 29, 2013, 11:38:04 am by JR-Imagine
broken avatar :(
×
broken avatar :(
Relentless Mapper
Location: ar
Date Registered: 21 August 2011
Last active: 4 days ago
Posts
1,323
Respect
Forum Rank
Zombie Colossus
Primary Group
Nuclear
My Groups
More
Personal Quote
This game isn't meant to be played
×
KDXDARK's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Nuclear
Nuclear
DARKLEGION's requested title
Mapper Has released one or more maps to the UGX-Mods community.
KDXDARK's Contact & Social Links
broken avatar :(
×
broken avatar :(
Location: be
Date Registered: 17 August 2013
Last active: 5 years ago
Posts
369
Respect
Forum Rank
Perk Hacker
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
Web & Software Developer and Designer
×
JR-Imagine's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.

 
Loading ...