Page 1 of 1

Again - my sp map dont work !?!

Posted: Wed Jun 27, 2007 1:04 am
by mcunha98
Guys,

I am crazy !!!!!!
With base into my first map (this work fine) i make a second map SP to continue the "campaign", but the AI simply dont work (how in the start of the first SP map).

Note: i simply copy the first script and change the objective (assassination for explode flak)

Some idea ?

Code: Select all

main:
	level waittill prespawn

	exec global/ambient.scr m1l1a
	exec global/door_locked.scr::lock
	exec global/exploder.scr

	thread InitPlayer

	level waittill spawn
	exec global/friendly.scr
	level.script = "maps/m1l2_98.scr"

	thread InitFriends
	thread InitObjectives
end

InitPlayer:
	$player item weapons/colt45.tik
	$player item weapons/m1_garand.tik
	$player item weapons/m2frag_grenade.tik

	$player ammo pistol 30
	$player ammo rifle 50
	$player ammo grenade 2
	$player useweaponclass rifle
end

InitObjectives:
	//1 - nao mostra o objetivo, 2 - mostra sem estar checado e 3 - o objetivo esta completo
	waitthread global/items.scr::add_item "explosive"
	waitthread global/objectives.scr::add_objectives 1 2 "Explode Enemy Flaks" $obj1.origin
	set_objective_pos $obj1
	thread LoopObjective1
end

InitFriends:
	//friendtype:
	//1 - behavior, 4 - leader e 5 - medic
	level.friendly1.friendtype = 1
	level.friendly1.distance = 128
	level.friendly1.health = 800
	level.friendly1.accuracy = 80
	level.friendly1.waittime = 2
	level.friendly1 thread global/friendly.scr::friendlythink
	level.friendly1.destination = $player

	level.friendly2.friendtype = 1 
	level.friendly2.distance = 180
	level.friendly2.health = 800
	level.friendly2.accuracy = 70
	level.friendly2.waittime = 1
	level.friendly2 thread global/friendly.scr::friendlythink
	level.friendly2.destination = $player
end

LoopObjective1:
	$bomb1_trigger waittill trigger
	$bomb1 model "animate/explosive.tik"
	$bomb1 playsound explosive
	$player loopsound bombtik
	$player stopwatch 10
	wait 10
	$player stoploopsound bombtik
	$bomb1 playsound explode_tank
	$bomb1 remove
	waitthread global/exploder.scr::explode 1
	radiusdamage $hurtobject1 256 384
	waitthread global/objectives.scr::add_objectives 1 3 "Explode Enemy Flaks" $obj1.origin
	thread FinishObjective1
end

FinishObjective1:
	waitthread global/objectives.scr::add_objectives 1 3 "Explode Enemy Flaks" $obj1.origin
	waitthread global/objectives.scr::current_objectives 0 
	wait 1
	thread MissionComplete
end

MissionComplete:
	iprintln_noloc "Mission complete!"
	wait 1
	iprintln_noloc "Now, we goes to the Humber Ville."
	exec global/missioncomplete.scr m1l2_98 1 
end

Posted: Wed Jun 27, 2007 2:49 pm
by erick
try "exec global/ai.scr" up at the top before prespawn

Posted: Wed Jun 27, 2007 11:04 pm
by jv_map
No the global/ai.scr does absolutely nothing :) (unless you're actually using it's features (spawners etc), which are kinda useless).

mcunha, the console will tell you what's wrong :wink:

Posted: Wed Jun 27, 2007 11:42 pm
by ViPER
maybe because of the spaces ? try

("Explode Enemy Flaks")

add_objectives 1 2

Posted: Thu Jun 28, 2007 1:35 am
by tltrude
You have: "add_objectives 1 2" at the top and "add_objectives 1 3" below. Is that the problem?

Posted: Thu Jun 28, 2007 3:57 am
by mcunha98
Unfortanely not is this TOM.
Simply my enemy and my squad dont appear.
When the game show AI it dont move...

Posted: Thu Jun 28, 2007 8:23 am
by jv_map
Hmm it sounds like you need to rename your map to test_ something or read the single player maps without test_ tutorial 8-)

Posted: Thu Jun 28, 2007 1:55 pm
by mcunha98
No is this !
The name of map is m1l2_98 (the first = m1l1_98 works fine)

Posted: Thu Jun 28, 2007 7:56 pm
by jv_map
Yes is this! :roll: :P

m1l2a_98 will work. Better is to use test_. Or much better read the single player maps without test_ tutorial ;), but that's quite complicated (unfortunately).

Posted: Fri Jun 29, 2007 2:03 pm
by mcunha98
jv_map wrote:Yes is this! :roll: :P

m1l2a_98 will work. Better is to use test_. Or much better read the single player maps without test_ tutorial ;), but that's quite complicated (unfortunately).
Unfortunately you are right...
I rename map to test_..... and works fine :cry: