How do you draw a clone?

Non-platform specific questions.

How do you draw a clone?

Postby SuperSonic » Sat Jun 02, 2012 11:53 pm

Ok, so I want to use the draw_from() function to draw a clone. I want the clone to be specified by my variable i. How do I do that? Here's what I mean:
Code: Select all
int i = 5;//Let's say I want to draw the fifth clone
draw_from(WhatDoIPutHere, 0, 0, 1);
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: How do you draw a clone?

Postby DarkParadox » Sun Jun 03, 2012 12:36 am

Using this:
Code: Select all
int id_of_clone = 5;
//Number can be whatever.

char temp_string[10];
//This can be however long you need it to be...

sprintf(temp_string, "name_of_clone.%i", id_of_clone);
//Modifies the temp string to include the number specified in the integer, change "name_of_clone" to whatever actor you're attempting to draw.

draw_from(temp_string, 0, 0, 1);
//Draws the actor using the clones ID we set using sprintf.
User avatar
DarkParadox
 
Posts: 457
Joined: Mon Jan 08, 2007 11:32 pm
Location: USA, Florida.
Score: 84 Give a positive score

Re: How do you draw a clone?

Postby SuperSonic » Sun Jun 03, 2012 12:53 am

Thank you very much. Plus 1 :wink:
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest