Internal Value for Clones

Non-platform specific questions.

Internal Value for Clones

Postby Conqueran » Sun Aug 28, 2005 10:51 pm

I know actors can have internal values but is it possible for every clone of an actor to have a separate internal value?

For instance I'd like to create a transport actor, however I want each transporter clone to bring the main character to a different place.

Anyway to do this besides making 20+ separate transporter actors.

Any help is appreciated :).
User avatar
Conqueran
 
Posts: 21
Joined: Fri Aug 19, 2005 4:55 pm
Score: 0 Give a positive score

Postby Game A Gogo » Sun Aug 28, 2005 11:29 pm

I encounter that problem to.
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby jazz_e_bob » Mon Aug 29, 2005 12:56 am

You could use something like this:

Code: Select all
// set transport exit points

getclone("transport.1")->exitX = 100;
getclone("transport.1")->exitY = 100;

getclone("transport.2")->exitX = 200;
getclone("transport.2")->exitY = 400;


It may be simpler to build 2 actors per transporter.

tranporterStart & transporterEnd

Then you could use

On Collision with tranporterStart:

Code: Select all
ship.x = getclone2("transporterEnd", collide.cloneindex)->x;
ship.y = getclone2("transporterEnd", collide.cloneindex)->y;


This method would make it much simpler to design and edit levels.

You can get a copy of getClone2 here:
http://www.game-editor.com/forum/viewtopic.php?t=711&highlight=getclone
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby ondy1985 » Mon Aug 29, 2005 8:29 pm

Yes, I would really appreciate 'Copy actor' function.
Image

Motto: "I never let my schooling interfere with my education" --- Mark Twain
User avatar
ondy1985
 
Posts: 99
Joined: Thu May 05, 2005 7:43 pm
Location: Slovakia
Score: 1 Give a positive score

Postby Conqueran » Tue Aug 30, 2005 7:56 pm

Thanks JAzz E BOB, I finally figured out that getclone thing. Its really useful.
User avatar
Conqueran
 
Posts: 21
Joined: Fri Aug 19, 2005 4:55 pm
Score: 0 Give a positive score

Postby BeyondtheTech » Tue Aug 30, 2005 8:41 pm

Yes, think of getclone as a long-winded way of getting to an actor's internal variable.

What's nice is the getclone2 implementation that was posted here on the forum. If you are accessing a bunch (read: loop) or a different clone every time, you can use the getclone2 to specify the actor and the cloneindex separately.

For instance, I have 5 ships present, all called "ship.0" through "ship.5". for (a=0;a<6;a++) getclone2("ship",a)->xvelocity=1; allows me to individually set the xvelocity without having 6 separate lines of code.
User avatar
BeyondtheTech
 
Posts: 270
Joined: Wed Mar 30, 2005 6:34 am
Location: Edison, NJ
Score: 4 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest