sigleplayer stock map conversion

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Lt.Audie L Murphy
Lance Corporal
Posts: 22
Joined: Wed Feb 16, 2005 8:47 am

sigleplayer stock map conversion

Post by Lt.Audie L Murphy »

seem to be having a slight problem with objective
in a single player map conversion
can a single player save mess up objectives ?
i scripted m1l2b ,,,and the objective i added works fine but when obj has been completed and round restarts seems obj bomb cant be set again
i looked in console and im getting this " cannot save in multiplayer game"
im certain that the save is messing this up
how would i remove save from SP map ?
ive searched all .scr files in mohaa install for some hint,,,,,

a push in right direction would be perfect
Image
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post by Grassy »

:shock:
Sounds like it's got an auto save point trigger in the bsp somwhere.
If such an animal exists?? Try doing a search in the g_allclasses docs for something like that. Sorry that's all I can suggest on this topic. :?
An ambiguous question will get a similar answer...
User avatar
MPowell1944
Moderator
Posts: 287
Joined: Thu Jan 09, 2003 7:06 am
Location: Woodstock, GA
Contact:

Post by MPowell1944 »

Right below main: in the map script, add the lines removeclass triggersave and removeclass triggeronce
Lt.Audie L Murphy
Lance Corporal
Posts: 22
Joined: Wed Feb 16, 2005 8:47 am

Post by Lt.Audie L Murphy »

i added this to script removeclass triggersave and removeclass triggeronce ,,,,, but stillsame effect
only it dont say in console "cannot save in multiplayer"

bomb can be set and defused and explodes
but after round it doesnt reset :(

im thinking it might be where im setting my obj up

seems to delete things out of map,,,,, i added a radio obj
in the end room where telephone rings ,,,, added radio but it deletes 2 other radios
that are in the same building but the sound that was added to radios plays
even thou radios are gone

im thinking if i change where i have obj it might correct this problem
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

it saves at the start of the mission still, because it's an SP-made thing. that attatches an initial save and saves everywhere thereafter. make sure your g_gametype is always 4 (obj) or you'll just have to live with it.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

Saves are done only when g_gametype is set to 0.

Audie, put all the bomb code after level waittill spawn.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Lt.Audie L Murphy
Lance Corporal
Posts: 22
Joined: Wed Feb 16, 2005 8:47 am

Post by Lt.Audie L Murphy »

Code: Select all

//
//
//m1l2a
//
//
//

main:
removeclass triggersave
removeclass triggeronce
removeclass actor

// set scoreboard messages
setcvar "g_gametype" "4"
setcvar "session" "4"
setcvar "g_gametypestring" ""
setcvar "g_obj_alliedtext1" ""
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext4" ""
setcvar "g_obj_axistext1"   ""
setcvar "g_obj_axistext2"   ""
setcvar "g_obj_axistext4"   ""

setcvar "g_scoreboardpic" "m1l2b.tga"

level.script = "maps/m1l2b.scr"


$world farplane_color (0 0 0) (0 0 0) (0 0 0) 0 9 0 0
$world farplane 15000


$interior remove
$exterior remove
$cutwire01 remove
$cutwire02 remove
$cutwire03 remove
$bomb02 hide
$bomb01 hide
$bomb03 hide
$bomb04 hide
$bomb05 hide


level waittill prespawn

exec global/loadout.scr "maps/m1l2b.scr"
exec global/DMprecache.scr
exec global/ambient.scr m1l2b
exec global/jv_sound.scr
exec global/exploder.scr
exec global/door_locked.scr
exec maps/fix0.scr
exec maps/fix3.scr

thread explosives
thread global/exploder.scr::main
thread global/barrel.scr::explosive_barrel

level.defusing_team = "axis"
level.planting_team = "allies"
level.targets_to_destroy = 1
level.bomb_damage = 200
level.bomb_explosion_radius = 1024


level waittill spawn


// set the parameters for this round based match


level.dmrespawning = 1
level.dmroundlimit = 10
level.clockside = axis



fadein 2 0 0 0 1
wait 5



level waittill roundstart


end


$bomb thread global/obj_dm.scr::bomb_thinker
$bomb thread allies_win_bomb
$bomb thread axis_win_timer
$bomb thread exploder_wait


end

//******************************
// jitter large effect
// jitter_large [delay]
//******************************
jitter_large local.time:
	if (local.time)
		wait local.time

	waitexec global/earthquake.scr .35 10 0 0
	waitexec global/earthquake.scr .23 6 0 0
	waitexec global/earthquake.scr 1 1 0 0
	waitexec global/earthquake.scr 1.25 .3 0 1
end


allies_win_bomb:
	println "[threadStart] allies_win_bomb"
	while(level.targets_destroyed < 

level.targets_to_destroy)
		waitframe
	teamwin allies
end

allies_win_timer:
	println "[threadStart] axis_win_timer"
	level waittill axiswin
end

exploder_wait:
	println "[threadStart] exploder_wait"
	while(!self.exploded) {
		waitframe
	}

end
This is code ive been using to convert to obj

this is code i use for obj

Code: Select all

main:

//* The bomb model

local.bomb = spawn script_model "targetname" "bomb"
local.bomb model "items/pulse_explosive.tik"
local.bomb.origin = ( 1628 -1488 -185 )
local.bomb.angles = ( 0.0 0.0 0.0 )
local.bomb.exploder_set = 1
local.bomb.explosion_fx = "models/fx/fx_explosion.tik"
local.bomb.trigger_name = "bomb_trigger"
local.bomb.target = "exploder"

//* The bomb trigger

local.trigger = spawn trigger_use "targetname" "bomb_trigger"
local.trigger setsize ( 1628 -1488 -185 ) ( 1628 -1488 -185 )


end
Last edited by Lt.Audie L Murphy on Wed Mar 02, 2005 11:36 pm, edited 2 times in total.
Image
Lt.Audie L Murphy
Lance Corporal
Posts: 22
Joined: Wed Feb 16, 2005 8:47 am

Post by Lt.Audie L Murphy »

i am exec the obj from a mapfix.scr
could this be why the obj will not reset

i converted training and m1l1 ans m1l2a with this method all 3 work
obj reset when obj completed
Image
Lt.Audie L Murphy
Lance Corporal
Posts: 22
Joined: Wed Feb 16, 2005 8:47 am

Post by Lt.Audie L Murphy »

soon as i removed this line works 100%



"fadein 2 0 0 0 1
wait 5 "



that i do not get :(



owell i can live without a fade in :)
Image
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

it fades from black screen.
Image
Lt.Audie L Murphy
Lance Corporal
Posts: 22
Joined: Wed Feb 16, 2005 8:47 am

Post by Lt.Audie L Murphy »

yes with that code it will fade in from black screen
Image
Post Reply