About clones

Game Editor comments and discussion.

About clones

Postby Leif » Sun Dec 27, 2009 7:56 pm

Need help ((
here is my file. I'm trying to do the hext:
1. Each of red elements has it's own ID (from 1 to 4). Pressing button (arrow) must increase ID of all the elements by 1, but it increases only the first by 5. Why? how to correct?
2. Words to the left - animation names of elements. They are added to array when elements were created and displayed after that. How to add to array full names of elements instead of anim.names? To use them after ?

Help me please
Attachments
item_ID_inc.rar
(4.46 KiB) Downloaded 68 times
Repulsor beam + heavy cannons
User avatar
Leif
 
Posts: 147
Joined: Mon Dec 15, 2008 12:42 pm
Location: Moscow, Russia
Score: 10 Give a positive score

Re: About clones

Postby DST » Sun Dec 27, 2009 8:18 pm

You forgot the data folder.
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: About clones

Postby Leif » Sun Dec 27, 2009 10:28 pm

Sorry :)
See below
Attachments
item_ID_inc_.rar
(409.82 KiB) Downloaded 68 times
Repulsor beam + heavy cannons
User avatar
Leif
 
Posts: 147
Joined: Mon Dec 15, 2008 12:42 pm
Location: Moscow, Russia
Score: 10 Give a positive score

Re: About clones

Postby skydereign » Sun Dec 27, 2009 10:53 pm

Well, fixed the first problem. The problem was that you were getting the clone "SQUARE.i", instead of the actor with a cloneindex of i, which is what you want. To do what you wanted you would need something like what I put in, which actually puts the .i to the end of the string, but uses the actual number. To do this I put a function into global code. Not really sure what you mean by the second. What are the full names, and do you mean saving the names when you say to use them after?
Attachments
item_ID_inc_.zip
(448 KiB) Downloaded 63 times
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: About clones

Postby Leif » Mon Dec 28, 2009 6:15 am

Thanks ))
Full name - I mean "name+cloneindex". I Intend to put of them into array (some elements) and if needed take actors by the name from array.
Repulsor beam + heavy cannons
User avatar
Leif
 
Posts: 147
Joined: Mon Dec 15, 2008 12:42 pm
Location: Moscow, Russia
Score: 10 Give a positive score

Re: About clones

Postby skydereign » Mon Dec 28, 2009 6:48 am

Code: Select all
char*
getFullName (const char *cname, int cindex)
{
    char* buffer = calloc(50,1);
    sprintf(buffer,"%s.%i",cname,cindex);
    return(buffer);
}


You can use this to get the full name to put into the array.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: About clones

Postby Leif » Mon Dec 28, 2009 7:25 am

:D super )))

Thanks a lot ))

My C programming leaves much to be desired...
Repulsor beam + heavy cannons
User avatar
Leif
 
Posts: 147
Joined: Mon Dec 15, 2008 12:42 pm
Location: Moscow, Russia
Score: 10 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron