Page 1 of 1

Stopping threads

Posted: Thu Jun 26, 2003 4:55 am
by TheShiznaeSpe
Is it possible to stop a thread midway?


I want to the cancel the allies_win_hold and the axis_win_hold from completing, but not permanently.

So far I have this:

Code: Select all

target_building_touched:

$control_trigger waittill trigger

local.player = parm.other
if(local.player.dmteam == "allies")
{
	iprintln "The US holds the target building."
	$allies_spawn disablespawn
	$allies_spawn_target enablespawn
	$axis_spawn enablespawn
	$axis_spawn_target disablespawn
	$us_indicator show
	$iraq_indicator hide
	thread allies_win_hold
	axis_win_hold delete // i've tried stop also
}
if(local.player.dmteam == "axis")
{
	iprintln "The Iraqis holds the target building."
	$allies_spawn enablespawn
	$allies_spawn_target disablespawn
	$axis_spawn disablespawn
	$axis_spawn_target enablespawn
	$us_indicator hide
	$iraq_indicator show
	thread axis_win_hold
	allies_win_hold delete // i've tried stop also
}

end
Also:

The command locprint, is it possible to cancel this also? So another message replaces it?

Posted: Thu Jun 26, 2003 8:37 am
by jv_map
Yup there are a number of ways to stop a thread, i.e. end, delete, remove or immediateremove. Use parm.previousthread to 'get' the thread object:

thread allies_win_hold
level.allies_thread = parm.previousthread
level.axis_thread end

and

thread axis_win_hold
level.axis_thread = parm.previousthread
level.allies_thread end

locprint is automatically overwritten by another locprint (pretty annoying actually).

Posted: Thu Jun 26, 2003 6:59 pm
by TheShiznaeSpe
thanks that's just what i need :D