[CYBERCLONE.C] Global Code Clone Library GCCL V3
Posted: Sat Mar 01, 2014 6:21 am
UPDATE: Added new function, compatible for all versions of gE, functions and descriptions update, demo and debug future ( [D] ).
Cyberlone.c is a global code script that contains plenty of functions with the clones in GameEditor.
Please comment so i can continue share newer and newer versions on it and soon.. even demos.
I would be more then happy to receive suggestions as well. I am open to renew and upload
There is the "Scripting Reference":
c_make: Makes a certain amount of clones with the position of the actor who call this function.[D]
Syntax: void c_make ( char * cName, int cCount )
Example: c_make ( "Rocket", 5 );
c_make2: Makes a certain amount of clones with declared position [D]
Syntax: void c_make2 ( char * cName, int cCount, int xCoord, int yCoord )
Example: c_make2 ( "Rocket", 5, 140, -50 );
c_makeArray: Like "Clone Array" option, it makes clone array at x and y with selected distance.
Syntax: void c_makeArray ( Actor c_source , int c_offset_x , int c_offset_y , int c_count_x , int c_count_y , int c_dist_x, int c_dist_y )
Example: c_makeAt ( GridCell, 140, -50, 5, 5, NULL, NULL );
Note: If you pass NULL instead of distance in pixels, it will set the distance as "Automatic".
c_xTable: Returns an array with all the clone's x coordinates.
Syntax: int * c_xTable ( char * cName )
Example: int * c_xpos = c_xTable ( "Naruto" );
c_yTable: Returns an array with all the clone's y coordinates.
Syntax: int * c_yTable ( char * cName )
Example: int * c_ypos = c_yTable ( "Naruto" );
c_position: Set an specific clone into a y and x coordinates. [D]
Syntax: char * c_position ( char * cName, int cIndex, int xCoord, int yCoord )
Example: c_pos = c_position ( "Naruto", 0, 50, 50);
c_distance: Returns an array with the distance between actor a and actor b.
Syntax: int * c_distance ( char * cName1, int cIndex1, char * cName2, int cIndex2 )
Example: int * c_dist = c_distance( "Naruto", 1, "Sakura", 1);
Return values:
array[0] returns -1 if there are no clones in 1
array[0] returns -2 if there are no clones in 2.
array[0] returns -3 if there are no clones according to the pointed ones.
array[1] returns actor's horizontal distance in pixels.
array[2] returns actor's vertical distance in pixels.
c_setDistance: Set distance between actor a and actor b.
Syntax: void c_setDistance ( char * cName1, int cIndex1, char * cName2, int cIndex2, int xDist, int yDist )
Example: c_setDistance ( "Naruto", 1, "Boss", 1, 50, 0 );
c_properties: Colors or set transparency of the actor specified.
Syntax: void c_properties ( char * cName , int cIndex , double cRed , double cGreen , double cBlue , float cTransp )
Example: c_properties ( "Naruto", 4, 255, 0, 0, 0.5);
Function Macros: m: For color value m means max color (255)
c_destroy: Destroys an specified actor.
Syntax: void c_destroy ( char * cName , int cIndex )
Example: c_destroy ( "Naruto", 4 );
c_destroy2: Destroys an specified actor from index to index.
Syntax: void c_destroy2 ( char * cName , int cSTARTIndex , int cENDIndex)
Example: c_destroy2 ( "Naruto", 0, 4 );
c_velocity: Control the velocity in specific direction of the pointed actor or clone.
Syntax: void c_velocity ( char * cName , int cIndex , double cDirection , int cVelocity, ... )
Example: c_velocity ( "Ball", 0, 90, 1 ); //Ball with cloneindex 0 in direction of 90 degree will move with 1 px per fps
c_tree: Return an array with pointers to all clones specified. Helps you control all the clones easy.
Syntax: Actor ** c_tree ( char * cName, ... )
Example: Usage: Actor ** varexample = c_tree ( "naruto" ); varexample[0]->transp = 0.5; //that will set the clone with index 0 with transparency of 0.5
Warning: I do not suggest you using this function, till i update her (read cyberclone.c desribtion for more info)
c_ged: Return pointer to an actor/clone with desired index.
Syntax: Actor * c_get ( char cName[] , int cIndex )
Example: Usage: c_get("actor", 5)->x = 250; //will set actor.5 on position x = 250.
_________________________________________________________________________________________________________
- For some functions you can also use the following macros:
c_end with means the last clone
c_rand with means random clone - Credits:
bat78
DarkParadox
Direct download:
Download
_________________________________________________________________________________________________________
Download demo:
DOWNLOAD
- Content:
- data
- Cyberclone DEMO BETA.ged
- Cyberclone DEMO BETA.exe
- cyberclone.c