Modifying script but wont function properly within the game
by Howard University · in Torque Game Engine · 04/03/2006 (7:54 pm) · 1 replies
I am modifying the checkpoint.cs script and have no errors in the console log but i can not get the scoreboard display to function right. The scoreboard is just a display that shows how many points you have accumulated throughout the game as you go through different checkpoints. The display is suppose to say " socre is: (score)" but i can not get the display to show the actual points and then i need to know if they are going to increment as i would like them, which would be as they go through the correct checkpoint. This is the script that I am using.
//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
datablock TriggerData(CheckPointTrigger)
{
// The period is value is used to control how often the console
// onTriggerTick callback is called while there are any objects
// in the trigger. The default value is 100 MS.
tickPeriodMS = 100;
};
//-----------------------------------------------------------------------------
function CheckPointTrigger::onEnterTrigger(%this,%trigger,%obj)
{
Parent::onEnterTrigger(%this,%trigger,%obj);
for(score=1; %score <= 20; %score++)
{
if(%obj.client.nextCheck == %trigger.checkpoint)
centerPrint(%obj.client, "Score is" score, 1, 1);
else
centerPrint(%obj.client. "Wrong Checkpoint", 1, 1);
}
}
In my mission I have created checkpoints with the dynamic field of the name checkpoint and the value to be 1,2,3,..... with each checkpoint in the order you are suppose to go in. Please help this is a major project for me that I have been working on for three months now and keep running into problems.
//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
datablock TriggerData(CheckPointTrigger)
{
// The period is value is used to control how often the console
// onTriggerTick callback is called while there are any objects
// in the trigger. The default value is 100 MS.
tickPeriodMS = 100;
};
//-----------------------------------------------------------------------------
function CheckPointTrigger::onEnterTrigger(%this,%trigger,%obj)
{
Parent::onEnterTrigger(%this,%trigger,%obj);
for(score=1; %score <= 20; %score++)
{
if(%obj.client.nextCheck == %trigger.checkpoint)
centerPrint(%obj.client, "Score is" score, 1, 1);
else
centerPrint(%obj.client. "Wrong Checkpoint", 1, 1);
}
}
In my mission I have created checkpoints with the dynamic field of the name checkpoint and the value to be 1,2,3,..... with each checkpoint in the order you are suppose to go in. Please help this is a major project for me that I have been working on for three months now and keep running into problems.
About the author
Torque Owner Mike Rowley
Mike Rowley