Game Development Community

Objectives..?

by Edward Cunningham · in Torque 3D Beginner · 08/09/2010 (9:53 pm) · 1 replies

Is there a simple way to make an Objective for a player to have a goal? Or is it difficult??


Thanks !

#1
08/09/2010 (10:24 pm)
Kinda depends on your objective, I guess. "Get to the top of the hill" would be simple compared to "Run up mount Everest and defeat the alien-nazi-demon-zombie-mothership single handed" ...

For the first, make a trigger and put it on the hill. Make it fire a function when the player enters it to record that the player is there, and so the objective is complete.

%checkclass = %obj.getclassname();
	if(%checkclass $= "player")
	{
               echo("Player on top of hill .Objective Accomplished!");
	}

For the second, make a trigger and put it on mount Everest. Make it fire a function when the player enters it to record that the player is there, and then start a function to loop and keep checking if the alien-nazi-demon-zombie-mothership is still alive.

if(!isObject(alien-nazi-demon-zombie-mothership))
   echo("alien-nazi-demon-zombie-mothership does not exist. Mission Accomplished!");

Check out the new script reference posted in the doc blogs (part2) for triggers, and scripts and functions in general.