Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Does Template Exist?
Does Template Exist?
2004-11-27, 4:21 PM #1
Hi!
I'm making a Mod that will work with all other Mods, I think...

I just want to know, is there some way I can check to see if a certain template exists? For example, new force destruction that will take the most powerfullest projectile in a Mod (those that I've looked at).

/Edward
Edward's Cognative Hazards
2004-11-27, 4:42 PM #2
I'm sorry, but I don't think you can get a reference to an uninstanced template via COG.
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2004-11-28, 3:49 PM #3
You can try using LoadTemplate(). If the template you give it doesn't exist, it'll probably return -1 or some other invalid number.
Historians are the most powerful and dangerous members of any society. They must be watched carefully... They can spoil everything. - Nikita Khrushchev.
Kill one man, and you are a murderer. Kill millions of men, and you are a conqueror. Kill them all, and you are a god. - Jean Rostand.
2004-11-29, 3:44 AM #4
The problem is, that he doesn't know.the template name. He wants a reference to an unknown template (I think).
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2004-11-29, 8:01 AM #5
You can create an object via the template number, but thats about it. :\
And when the moment is right, I'm gonna fly a kite.
2004-11-29, 2:53 PM #6
Hmmm..... Well, you can check if a template exists inside the level .jkl or static.jkl by doing the following:

Define your template in the symbols section:

template MyChecker=+Tpl_ToCheckFer local


Then, you would execute some cog code like this:

DummyThinger=FireProjectile(player, MyChecker........);
if(DummyThinger == -1) //Then the template doesn't exist
{
Print("Template not exist");
}


I hope this is what you're asking for. :o

(I did this so that if you tried to play TDiR on levels that we didn't support, it would jkEndLevel() ;) )
-Hell Raiser

↑ Up to the top!