Game Development Community

Lone object that only schedules events

by c-level · in Torque Game Engine · 07/16/2003 (10:47 am) · 2 replies

I want to created a lone item that starts a number of schedules to execute events spread out over 10 minutes. (Create new items in the world, etc). And then repeat that line-up after 10 minutes.
Am I going about this incorrectly?
In my world I want Event A to happen at minute 1, Event B at minute 2... If a player joins the game 1.5 minutes in, they will have missed Event A. I thought the first player that launched the game would spawn this 'timer item'. Do I need to use a dedicated server? (I'm LAN only!).

How would you guys do this?
Can I make something in the mission file?

------
I've tested what you can do with items.
Why can I call player.cs, aiplayer.cs, and item.cs functions from clientConnect.cs and game.cs, but not functions in crossbow.cs?

For testing, I want to create a crossbow and then immediately call one of it's functions.

I get this error:
fps/server/scripts/clientConnect.cs (0): Unknown command onStartit.
Object LocalClientConnection(1410) GameConnection -> NetConnection -> SimGroup -> SimSet -> SimObject

Am I misunderstanding object types?


Thanks

#1
07/16/2003 (9:07 pm)
It looks like you're calling an undefined function?

Can you show us some sample code?
#2
07/17/2003 (11:10 am)
I fixed it. It was way too easy for a thread, sorry.

I called a function 'test2()' from fps\server\scripts\game.cs just after creating it.

function GameConnection::callCrossbow(%this){
error("we are here no problem");
%gun = new Item() {
dataBlock = crossbow;
client = %this;
};
MissionCleanup.add(%gun);
%gun.setTransform("-293.14 -136.426 234.408");
%gun.test2();
}

in order for the function to execute in crossbow.cs, it had to be named

//--
function item::test2(%this){

...instead of

function test2(%this) {
//--

I think this is an example of being a bit blind because I'm avoiding the source code. For now.
I guess you have to call it by the fact that it's an item.

Thanks