I surrender...simple Q

Post your scripting questions / solutions here

Moderator: Moderators

theMechanic
Lance Corporal
Posts: 15
Joined: Tue Jun 17, 2003 10:13 pm
Location: Ohio, USA
Contact:

I surrender...simple Q

Post by theMechanic »

I've spent hours searching for a definitive answer, and trying numerous variations of script, so I beg your pardon for asking this question, I'm just tired of getting nowhere:

Q: Can a single player map (ie m1l1) be used as multiplayer in MOHAA?
User avatar
G3mInI
First Lieutenant
Posts: 187
Joined: Sat Jun 29, 2002 3:49 am

Post by G3mInI »

Sure, if you rebuild the map and add spawns for allied and axis. As it is now there is only 1 spawn in the map for singleplayer. Might be possible to add spawns via scripting but that is not my cup of tea. I think there are tutorials out there somewher that tell you how to add objects to existing maps using a text editor. I know I have seen them just dont remember where.

Peace,
G3mInI
blue60007
General
Posts: 1247
Joined: Sun Mar 07, 2004 11:44 pm

Post by blue60007 »

You can certainly add spawn points via scripting, but a singleplayer map will not work well with multiplayer. It's the way they are designed for linear movement. Gameplay in MP mode would not be very good.
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

spawn

Post by tltrude »

This thread should help you add the spawn points.

/forum/viewtopic.php?t=7582

you can also disable or remove the AI for the map.
Tom Trude,

Image
blue60007
General
Posts: 1247
Joined: Sun Mar 07, 2004 11:44 pm

Post by blue60007 »

Yeah you'd have to do that, and disable any other SP stuff...
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

i played the ending Trondheim map, it really sucked. Allies spawned at the train and the choke point was that open concrete area just past. Axis could easily hold it, snipings and rockets. SP is not a good idea for MP. no matter what anyone says.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
blue60007
General
Posts: 1247
Joined: Sun Mar 07, 2004 11:44 pm

Post by blue60007 »

A MP map based on a SP is nice, but you really wouldn't want to use the SP in MP. When designing an MP map, you really can't just plop stuff here and there, you need to lay it out so each team is equal. Once you remove all the scripting you'd probably be able to get into areas where only AI can go, you'd be able to get off the map very easily, as a lot of areas are blocked by dynamic stuff controlled via script, like a tank or something...

You could decompile, rebuild it, than redesign half of it to make it MP compatible. Also there's that linear problem, that's the way most SP maps are designed, only one maybe two ways to go, basically the whole map would be a choke point, you would have no need for strategy when attacking the enemy, just run down the map, and at least for me that beats the whole purpose. Besides all the good sniping points are inaccessible. I took a SP map that I made, and made it into a MP map, I had to about double the size of it, so movement was linear...
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

GD right?

not trying to tell you not to, who cares if you do. it'll just suck.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Considering the large amounts of SP maps, there should be some that works as MP.

One thing that struck me the other day was that the "wave objective mode" I did a while back should make most SP maps playable as MP maps...

It's basically a mode where you concuer new spawnpoints in a TOW kind of ways until you have pressed the enemy far enough back. I did it as an experiment in making use of the respawning mode without making a map boooring...

Here is the script for the wave objective mode:

Code: Select all

// FACTORY WAVE OBJECTIVE
// BY BJARNE GR?NNEVIK

main:
	level waittill prespawn
	
	exec global/DMprecache.scr
	
	$world farplane 7500
	$world farplane_color (0.675 0.663 0.651)

	level.script = maps/obj/obj_factory_wave.scr
	exec global/ambient.scr obj_team5

	setcvar "g_obj_alliedtext1" "[  ]Front spawn taken"
	setcvar "g_obj_alliedtext2" "[  ]Middle spawn taken"
	setcvar "g_obj_alliedtext3" "[  ]Rear spawn taken"
	setcvar "g_obj_axistext1" "[  ]Front spawn taken"
	setcvar "g_obj_axistext2" "[  ]Middle spawn taken"
	setcvar "g_obj_axistext3" "[  ]Rear spawn taken"
	setcvar "g_scoreboardpic" "obj_factory_wave"

	waitthread spawn_setup

	level waittill spawn

	level.dmrespawning = 1 // 1 or 0
	level.dmroundlimit = 10 // round time limit in minutes
	level.clockside = kills // set to axis, allies, kills, or draw

	// level waittill roundstart

	thread axis_win_test
	thread allies_win_test
end

spawn_setup:

	level.spawn_count = 0

	$spawn_allied_front_axis disablespawn
	$spawn_allied_middle_axis disablespawn
	$spawn_allied_back_axis disablespawn
	$spawn_allied_front_allied enablespawn
	$spawn_allied_middle_allied enablespawn
	$spawn_allied_back_allied enablespawn

	$spawn_allied_front_trigger.taken_by_enemy = 0
	$spawn_allied_middle_trigger.taken_by_enemy = 0
	$spawn_allied_back_trigger.taken_by_enemy = 0
	$spawn_allied_front_marker light 0.0 0.0 1.0 300
	$spawn_allied_middle_marker light 0.0 0.0 1.0 300
	$spawn_allied_back_marker light 0.0 0.0 1.0 300
	$spawn_allied_front_marker lightOn
	$spawn_allied_middle_marker lightOn
	$spawn_allied_back_marker lightOn

	thread allied_back_spawn_check
	thread allied_middle_spawn_check
	thread allied_front_spawn_check
	
	$spawn_axis_front_allied disablespawn
	$spawn_axis_middle_allied disablespawn
	$spawn_axis_back_allied disablespawn
	$spawn_axis_front_axis enablespawn
	$spawn_axis_middle_axis enablespawn
	$spawn_axis_back_axis enablespawn
	
	$spawn_axis_front_trigger.taken_by_enemy = 0
	$spawn_axis_middle_trigger.taken_by_enemy = 0
	$spawn_axis_back_trigger.taken_by_enemy = 0
	$spawn_axis_front_marker light 1.0 0.0 0.0 300
	$spawn_axis_middle_marker light 1.0 0.0 0.0 300
	$spawn_axis_back_marker light 1.0 0.0 0.0 300
	$spawn_axis_front_marker lightOn
	$spawn_axis_middle_marker lightOn
	$spawn_axis_back_marker lightOn

	thread axis_back_spawn_check
	thread axis_middle_spawn_check
	thread axis_front_spawn_check
end

axis_win_test:
	while(level.spawn_count > -3) {
		waitframe // protection
	}
	iprintlnbold_noloc "The axis has gained complete control of the factory!"
	teamwin axis
end

allies_win_test:
	while(level.spawn_count < 3) {
		waitframe // protection
	}
	iprintlnbold_noloc "The allies has gained complete control of the factory!"
	teamwin allies
end

allied_back_spawn_check:
	while(1) {
		$spawn_allied_back_trigger waittill trigger
		if(parm.other.dmteam != allies) {
			if($spawn_allied_back_trigger.taken_by_enemy) {
				parm.other iprint "You already control this entrance." 1
				continue
			} else {
				waitthread allied_back_spawn_change
			}
		} else {
			if($spawn_allied_back_trigger.taken_by_enemy) {
				waitthread allied_back_spawn_change
			} else {
				parm.other iprint "You already control this entrance." 1
				continue
			}
		}
		waitframe // protection
	}
end

allied_back_spawn_change:
	$spawn_allied_back_trigger playsound convert_spawn

	if($spawn_allied_back_trigger.taken_by_enemy) {
		level.spawn_count ++
		$spawn_allied_back_trigger.taken_by_enemy = 0
		$spawn_allied_back_marker lightOff
		$spawn_allied_back_marker light 0.0 0.0 1.0 300
		$spawn_allied_back_marker lightOn
		$spawn_allied_back_axis disablespawn
		$spawn_allied_back_allied enablespawn
		// $spawn_allied_back_switch anim disable // disable is just a guess
		iprintlnbold_noloc "The allies controls their rear entrance again!"
		setcvar "g_obj_axistext3" "[  ]Rear spawn taken"
	} else {
		level.spawn_count --
		$spawn_allied_back_trigger.taken_by_enemy = 1
		$spawn_allied_back_marker lightOff
		$spawn_allied_back_marker light 1.0 0.0 0.0 300
		$spawn_allied_back_marker lightOn
		$spawn_allied_back_axis enablespawn
		$spawn_allied_back_allied disablespawn
		// $spawn_allied_back_switch anim enable // enable is just a guess
		iprintlnbold_noloc "The axis controls the rear allied entrance!"
		setcvar "g_obj_axistext3" "[X]Rear spawn taken"
	}
end

allied_middle_spawn_check:
	while(1) {
		$spawn_allied_middle_trigger waittill trigger
		if(parm.other.dmteam != allies) {
			if($spawn_allied_middle_trigger.taken_by_enemy) {
				parm.other iprint "You already control this entrance." 1
				continue
			} else {
				waitthread allied_middle_spawn_change
			}
		} else {
			if($spawn_allied_middle_trigger.taken_by_enemy) {
				waitthread allied_middle_spawn_change
			} else {
				parm.other iprint "You already control this entrance." 1
				continue
			}
		}
		waitframe // protection
	}
end

allied_middle_spawn_change:
	$spawn_allied_middle_trigger playsound convert_spawn

	if($spawn_allied_middle_trigger.taken_by_enemy) {
		level.spawn_count ++
		$spawn_allied_middle_trigger.taken_by_enemy = 0
		$spawn_allied_middle_marker lightOff
		$spawn_allied_middle_marker light 0.0 0.0 1.0 300
		$spawn_allied_middle_marker lightOn
		$spawn_allied_middle_axis disablespawn
		$spawn_allied_middle_allied enablespawn
		// $spawn_allied_middle_switch anim disable // disable is just a guess
		iprintlnbold_noloc "The allies controls their middle entrance again!"
		setcvar "g_obj_axistext2" "[  ]Middle spawn taken"
	} else {
		level.spawn_count --
		$spawn_allied_middle_trigger.taken_by_enemy = 1
		$spawn_allied_middle_marker lightOff
		$spawn_allied_middle_marker light 1.0 0.0 0.0 300
		$spawn_allied_middle_marker lightOn
		$spawn_allied_middle_axis enablespawn
		$spawn_allied_middle_allied disablespawn
		// $spawn_allied_back_switch anim enable // enable is just a guess
		iprintlnbold_noloc "The axis controls the middle allied entrance!"
		setcvar "g_obj_axistext2" "[X]Middle spawn taken"
	}
end

allied_front_spawn_check:
	while(1) {
		$spawn_allied_front_trigger waittill trigger
		if(parm.other.dmteam != allies) {
			if($spawn_allied_front_trigger.taken_by_enemy) {
				parm.other iprint "You already control this entrance." 1
				continue
			} else {
				waitthread allied_front_spawn_change
			}
		} else {
			if($spawn_allied_front_trigger.taken_by_enemy) {
				waitthread allied_front_spawn_change
			} else {
				parm.other iprint "You already control this entrance." 1
				continue
			}
		}
		waitframe // protection
	}
end

allied_front_spawn_change:
	$spawn_allied_front_trigger playsound convert_spawn

	if($spawn_allied_front_trigger.taken_by_enemy) {
		level.spawn_count ++
		$spawn_allied_front_trigger.taken_by_enemy = 0
		$spawn_allied_front_marker lightOff
		$spawn_allied_front_marker light 0.0 0.0 1.0 300
		$spawn_allied_front_marker lightOn
		$spawn_allied_front_axis disablespawn
		$spawn_allied_front_allied enablespawn
		// $spawn_allied_front_switch anim disable // disable is just a guess
		iprintlnbold_noloc "The allies controls their front entrance again!"
		setcvar "g_obj_axistext1" "[  ]Front spawn taken"
	} else {
		level.spawn_count --
		$spawn_allied_front_trigger.taken_by_enemy = 1
		$spawn_allied_front_marker lightOff
		$spawn_allied_front_marker light 1.0 0.0 0.0 300
		$spawn_allied_front_marker lightOn
		$spawn_allied_front_axis enablespawn
		$spawn_allied_front_allied disablespawn
		// $spawn_allied_front_switch anim enable // enable is just a guess
		iprintlnbold_noloc "The axis controls the front allied entrance!"
		setcvar "g_obj_axistext1" "[X]Front spawn taken"
	}
end

axis_back_spawn_check:
	while(1) {
		$spawn_axis_back_trigger waittill trigger
		if(parm.other.dmteam != axis) {
			if($spawn_axis_back_trigger.taken_by_enemy) {
				parm.other iprint "You already control this entrance." 1
				continue
			} else {
				waitthread axis_back_spawn_change
			}
		} else {
			if($spawn_axis_back_trigger.taken_by_enemy) {
				waitthread axis_back_spawn_change
			} else {
				parm.other iprint "You already control this entrance." 1
				continue
			}
		}
		waitframe // protection
	}
end

axis_back_spawn_change:
	$spawn_axis_back_trigger playsound convert_spawn

	if($spawn_axis_back_trigger.taken_by_enemy) {
		level.spawn_count --
		$spawn_axis_back_trigger.taken_by_enemy = 0
		$spawn_axis_back_marker lightOff
		$spawn_axis_back_marker light 1.0 0.0 0.0 300
		$spawn_axis_back_marker lightOn
		$spawn_axis_back_axis disablespawn
		$spawn_axis_back_allied enablespawn
		// $spawn_axis_back_switch anim disable // disable is just a guess
		iprintlnbold_noloc "The axis controls their rear entrance again!"
		setcvar "g_obj_alliedtext3" "[  ]Rear spawn taken"
	} else {
		level.spawn_count ++
		$spawn_axis_back_trigger.taken_by_enemy = 1
		$spawn_axis_back_marker lightOff
		$spawn_axis_back_marker light 0.0 0.0 1.0 300
		$spawn_axis_back_marker lightOn
		$spawn_axis_back_axis enablespawn
		$spawn_axis_back_allied disablespawn
		// $spawn_axis_back_switch anim enable // enable is just a guess
		iprintlnbold_noloc "The allies controls the rear axis entrance!"
		setcvar "g_obj_alliedtext3" "[X]Rear spawn taken"
	}
end

axis_middle_spawn_check:
	while(1) {
		$spawn_axis_middle_trigger waittill trigger
		if(parm.other.dmteam != axis) {
			if($spawn_axis_middle_trigger.taken_by_enemy) {
				parm.other iprint "You already control this entrance." 1
				continue
			} else {
				waitthread axis_middle_spawn_change
			}
		} else {
			if($spawn_axis_middle_trigger.taken_by_enemy) {
				waitthread axis_middle_spawn_change
			} else {
				parm.other iprint "You already control this entrance." 1
				continue
			}
		}
		waitframe // protection
	}
end

axis_middle_spawn_change:
	$spawn_axis_middle_trigger playsound convert_spawn

	if($spawn_axis_middle_trigger.taken_by_enemy) {
		level.spawn_count --
		$spawn_axis_middle_trigger.taken_by_enemy = 0
		$spawn_axis_middle_marker lightOff
		$spawn_axis_middle_marker light 1.0 0.0 0.0 300
		$spawn_axis_middle_marker lightOn
		$spawn_axis_middle_axis disablespawn
		$spawn_axis_middle_allied enablespawn
		// $spawn_axis_middle_switch anim disable // disable is just a guess
		iprintlnbold_noloc "The axis controls their middle entrance again!"
		setcvar "g_obj_alliedtext2" "[  ]Middle spawn taken"
	} else {
		level.spawn_count ++
		$spawn_axis_middle_trigger.taken_by_enemy = 1
		$spawn_axis_middle_marker lightOff
		$spawn_axis_middle_marker light 0.0 0.0 1.0 300
		$spawn_axis_middle_marker lightOn
		$spawn_axis_middle_axis enablespawn
		$spawn_axis_middle_allied disablespawn
		// $spawn_axis_middle_switch anim enable // enable is just a guess
		iprintlnbold_noloc "The allies controls the middle axis entrance!"
		setcvar "g_obj_alliedtext2" "[X]Middle spawn taken"
	}
end

axis_front_spawn_check:
	while(1) {
		$spawn_axis_front_trigger waittill trigger
		if(parm.other.dmteam != axis) {
			if($spawn_axis_front_trigger.taken_by_enemy) {
				parm.other iprint "You already control this entrance." 1
				continue
			} else {
				waitthread axis_front_spawn_change
			}
		} else {
			if($spawn_axis_front_trigger.taken_by_enemy) {
				waitthread axis_front_spawn_change
			} else {
				parm.other iprint "You already control this entrance." 1
				continue
			}
		}
		waitframe // protection
	}
end

axis_front_spawn_change:
	$spawn_axis_front_trigger playsound convert_spawn

	if($spawn_axis_front_trigger.taken_by_enemy) {
		level.spawn_count --
		$spawn_axis_front_trigger.taken_by_enemy = 0
		$spawn_axis_front_marker lightOff
		$spawn_axis_front_marker light 1.0 0.0 0.0 300
		$spawn_axis_front_marker lightOn
		$spawn_axis_front_axis disablespawn
		$spawn_axis_front_allied enablespawn
		// $spawn_axis_front_switch anim disable // disable is just a guess
		iprintlnbold_noloc "The axis controls their front entrance again!"
		setcvar "g_obj_alliedtext1" "[  ]Front spawn taken"
	} else {
		level.spawn_count ++
		$spawn_axis_front_trigger.taken_by_enemy = 1
		$spawn_axis_front_marker lightOff
		$spawn_axis_front_marker light 0.0 0.0 1.0 300
		$spawn_axis_front_marker lightOn
		$spawn_axis_front_axis enablespawn
		$spawn_axis_front_allied disablespawn
		// $spawn_axis_front_switch anim enable // enable is just a guess
		iprintlnbold_noloc "The allies controls the front axis entrance!"
		setcvar "g_obj_alliedtext1" "[X]Front spawn taken"
	}
end
Admin .MAP Forums
Image
Head above heels.
seere
First Lieutenant
Posts: 181
Joined: Fri Apr 02, 2004 12:51 pm
Location: London

Post by seere »

There is already a server running single player maps for multi player its a UK server 195.20.109.42:12204
It is quite fun (because its kinda new) but is problematic because of the reasons stated above... too linear.
Shame because some of the maps are pretty good and I may consider remaking some.
Seere.
User avatar
G3mInI
First Lieutenant
Posts: 187
Joined: Sat Jun 29, 2002 3:49 am

Post by G3mInI »

The only map I can readily think of in singleplayer that is not as linear as most would be the one where you have to shoot all them snipers. I can't remember exactly which one it is. But I'm sure you all know which one I am referring too. That map is basically square only thing is..I dont recall too many of the buildings being accessible, especially the high windows where snipers are.

G3mInI
seere
First Lieutenant
Posts: 181
Joined: Fri Apr 02, 2004 12:51 pm
Location: London

Post by seere »

Snipers last stand,
Looks great that map but again your forced through just one route,not good enough for multi player, need at least 3 routes to any given objective.
Seere
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

m5l1 aka sniper's last stand

it would be okay. but i stand by my original sayings. any SP map was designed for ONE player. not any more than three would be a good idea.

maybe you ought to look into Team Assault. go here and see what you can find.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Post by Krane »

I agree w/ lizardplayer, the maps were designed for 1 player BUT that doesn"t mean we cannot modify things thru script and make a nice MP map out of a SP map.

Maybe disabling some AI, adding things thru script, etc...Worth a try!
Image
theMechanic
Lance Corporal
Posts: 15
Joined: Tue Jun 17, 2003 10:13 pm
Location: Ohio, USA
Contact:

Post by theMechanic »

Wow, i started a whole new wealth of info in just one place. :lol:

This is why i always recommend this place, and peruse it quite often, even tho i don't post much. Thats because i find my answers and go off to try out what i learned here. I just want to thank all of you for being here to help, teach, and pass on your learned wisdom. That said....

Yea, I gave up on the idea after trying some ideas in the other threads, I have enough probs with the scripts i'm running now. Since we have KINDOF gotten to a performance topic on this, I have an issue that i just cant seem to get a handle on.

I use a pk3 with which i spawn objects on the stock maps, using the .scr's for each map in the maps folder. I have had some lag and performance issues of late, and have eliminated about 90% of the mods I was spawning to try and eliviate the prob. I'm just wondering if perhaps there is better code than what i am using, or I'm calling the objects wrong or what. This is an example of my .scr and an object....

main:

// set scoreboard messages
setcvar "g_obj_alliedtext1" "Southern France"
setcvar "g_obj_alliedtext2" "}:MECH:{ War Mods"
setcvar "g_obj_alliedtext3" "67.18.236.176:12203"
setcvar "g_obj_axistext1" "www.clanmech.com"
setcvar "g_obj_axistext2" "Thanks For Playing"
setcvar "g_obj_axistext3" "Here"

setcvar "g_scoreboardpic" "mohdm1"

// call additional stuff for playing this map round based is needed
if(level.roundbased)
thread roundbasedthread

level waittill prespawn

//*** Precache Dm Stuff
exec global/DMprecache.scr

level.script = maps/dm/mohdm1.scr
exec global/ambient.scr mohdm1

level waittill spawn

exec global/sfmessages.scr

thread funstuff
thread lift1
thread lift2
thread upandaway1
thread upandaway2
thread antisniper

end

//-----------------------------------------------------------------------------

funstuff:

//mapfixes

//Southern France
// Fix for open gate people can get behind
local.pan1 = spawn script_model
local.pan1 model "vehicles/panzer_iv_d.tik"
local.pan1.origin = ( 230 -1110 0 )
local.pan1.angles = ( 0 90 0 )
local.pan1 solid

// protect spawn areas
//SW Corner
local.static = spawn script_model
local.static model "static/indycrate.tik"
local.static.origin = ( 800 -600 0 )
local.static.angles = ( 0 0 0 )
local.static solid

I am trying to use buzzgoodies spawn protect next to eliminate the use of spawned objects next.
Post Reply