variable clone IDs with Script Events

Non-platform specific questions.

variable clone IDs with Script Events

Postby Kodo » Sat Jan 06, 2007 8:30 pm

How do I use SendActivationEvent with a variable clone ID?

Code: Select all
SendActivationEvent("block_red.1");

The code above works fine for a single specific clone, but I want to be able to increment the Clone ID at will, something like...

Code: Select all
CloneToTrigger++;
SendActivationEvent("block_red.CloneToTrigger");

...Obviously this doesn’t work, but what should the correct syntax be, or does this need to be done a completely different way?

Cheers in advance
User avatar
Kodo
 
Posts: 449
Joined: Thu Oct 20, 2005 8:20 pm
Location: UK
Score: 23 Give a positive score

Postby makslane » Sat Jan 06, 2007 9:23 pm

Use the getclone2 function:
http://game-editor.com/forum/viewtopic. ... =getclone2

And make:
Code: Select all
SendActivationEvent(getclone2("block_red", CloneToTrigger)->clonename);
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Kodo » Sat Jan 06, 2007 9:48 pm

Thanks, thats been a great help :)
User avatar
Kodo
 
Posts: 449
Joined: Thu Oct 20, 2005 8:20 pm
Location: UK
Score: 23 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest