Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 8 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 4
Category: CoD4 Scripting
Scripting and coding with Call of Duty 4.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Addint Custom Spawns to a already compile map
Shoot
General Member
Since: Jun 22, 2002
Posts: 260
Last: Mar 22, 2008
[view latest posts]
Level 5
Category: CoD4 Scripting
Posted: Friday, Mar. 21, 2008 06:03 pm
Has anyone here been able to create new spawn locations through a new mp_this_map.gsc file?

I want to add some spawn locations for better sniper placement on a sniper server - for gameplay reasons - some of the maps spawns aren't working for the sniper to get where they need to go in the allotted time. Short of adding 60 seconds of invisible spawn protection which I don't think is very prudent.

I know it has been done - I have attempted a few methods but have not been able to get the iwmp3.3xe to accept the script.

Thanks in advance for any help.
Share |
SpeedHighway
General Member
Since: Apr 30, 2005
Posts: 494
Last: Apr 9, 2008
[view latest posts]
Level 5
Category: CoD4 Scripting
Posted: Friday, Mar. 21, 2008 06:07 pm
Even if you could do that, I would imagine it would be difficult to guess where the map is located. It could run from 0,0 to 7000,7000 or it could run from 34,234 to 54,234. No idea what coordinates you could use. If you did have a method, you could just start trying numbers, I guess, tho. Just hope they didn't build it off in never-never land to make it hard on people trying to do that.
Share |
novemberdobby
General Member
Since: Sep 17, 2006
Posts: 1965
Last: Oct 13, 2013
[view latest posts]
Level 8
Forum Moderator
Category: CoD4 Scripting
Posted: Friday, Mar. 21, 2008 06:30 pm
You could just spawn spawnpoints through the mod? Use viewpos to find out where they should go or something?

You could easily delete all of the current spawnpoints, or make it so they're ignore and it only accepts a different kind of spawned spawn (lol).
Share |
SpeedHighway
General Member
Since: Apr 30, 2005
Posts: 494
Last: Apr 9, 2008
[view latest posts]
Level 5
Category: CoD4 Scripting
Posted: Friday, Mar. 21, 2008 06:38 pm
That actually might work.

You could probably use some method to get the corners that the minimap corners are at, in order to find out where the map is based at. (Using this method won't allow you to run maps that don't yet have a compass)
Share |
Shoot
General Member
Since: Jun 22, 2002
Posts: 260
Last: Mar 22, 2008
[view latest posts]
Level 5
Category: CoD4 Scripting
Posted: Friday, Mar. 21, 2008 08:23 pm
Getting the spawn points isn't the issue - that is easy like Dobby said - you devmap the map and use viewpos where you want the spawn to be and tweak it from there once you get the locations added.

The issue is getting it to call from the map.gsc file
I have tried a few things and tonight I hope to go back to the spawn system and the war.gsc file and see how best to call the axis spawn and the allied spawn.

I see where the spawns all randomize, I see how they are called from the compiled map using the getentarray but can't get it to directly apply the spawn I am aiming for. Just going for 1 per side right now - once I get that then I can go from there.

Learning as I go here so please excuse me if this is a really easy thing to do.
Share |
SpeedHighway
General Member
Since: Apr 30, 2005
Posts: 494
Last: Apr 9, 2008
[view latest posts]
Level 5
Category: CoD4 Scripting
Posted: Friday, Mar. 21, 2008 08:27 pm
I understand. I didn't know what the viewpos command did, so that's good to know.

Check some of the other stock scripts for ideas on how best to spawn something. Singleplayer version of _nightvision.gsc spawns an FX for the laser. MP version of _exploding_barrels.gsc spawns ...something, I don't remember what.

You shouldn't have to worry about the war.gsc file. As long as you can place the spawnpoints, the game should handle the rest. Just make sure to do this early on in your main gsc before players spawn, etc. :)
Share |
Sevenz
General Member
Since: Apr 24, 2006
Posts: 2390
Last: May 10, 2013
[view latest posts]
Level 8
Category: CoD4 Scripting
Posted: Friday, Mar. 21, 2008 08:29 pm
the spawn points are loaded into an array right? they can be read out by script. delete this array and generate a new one with your desired spawn points. Spawnlogic should still work ('cause it's a script running in real-time).

have a look at \raw\maps\mp\gametypes\_spawnlogic.gsc:


level.teamSpawnPoints[team] = getEntArray( spawnPointName, "classname" );

level.spawnpoints = [];

spawnPoints = getEntArray( spawnPointName, "classname" );

edited on Mar. 21, 2008 04:32 pm by Sevenz
Share |
SpeedHighway
General Member
Since: Apr 30, 2005
Posts: 494
Last: Apr 9, 2008
[view latest posts]
Level 5
Category: CoD4 Scripting
Posted: Friday, Mar. 21, 2008 09:01 pm
So basically you should be able to spawn the spawnpoints at certain locations and then use similar code to reattach the spawn points to the teams and/or players. Hmm. Follow Sevenz idea. I think he has the best path going, definitely
Share |
Shoot
General Member
Since: Jun 22, 2002
Posts: 260
Last: Mar 22, 2008
[view latest posts]
Level 5
Category: CoD4 Scripting
Posted: Saturday, Mar. 22, 2008 01:24 am
Ok I have tried calling the spawns in the map gsc file - that ain't workin!!! didn't think so but I had to try - get this error

mp_tdm_spawn_axis_start cannot be spawned dynamically

Code:
main()
{
	maps\mp\_load::main();
	ambientPlay("ambient_backlot_ext");
	maps\mp\_compass::setupMiniMap("compass_map_mp_a_custom_map");

	game["allies"] = "marines";
	game["axis"] = "opfor";
	game["attackers"] = "axis";
	game["defenders"] = "allies";

	game["allies_soldiertype"] = "desert";
	game["axis_soldiertype"] = "desert";

	setdvar( "r_specularcolorscale", "1" );
	setdvar("r_glowbloomintensity0",".25");
	setdvar("r_glowbloomintensity1",".25");
	setdvar("r_glowskybleedintensity0",".3");
	setdvar("compassmaxrange","1800");

	level.spawn_axis_start[0] = spawn("mp_tdm_spawn_axis_start", (5059, 1244, 1136));
	level.spawn_allies_start[0] = spawn ("mp_tdm_spawn_allied_start", (-4079, -8435, 1147));
}


I know the angles aren't in the origins - was hoping to get an error of " Hey there are no spawn angles" but didn't even get that far!!!


Ok - I see where it calls the spawn array - but how to create the new array?

Is this in a new file?

level.spawnpoints [0] = (spawn1, "mp_tdm_spawn_axis_start);
level.spawnpoints.origin[0]=(X, Y, Z);
level.spawnpoints.angles[0]=(x, y);

Don't think this is right - just theory at this point
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»