Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Rocco on Sat 04/02/2006 23:38:13

Title: is there a possibility to clone objects or characters??
Post by: Rocco on Sat 04/02/2006 23:38:13
anything like this:

new object[MAX_OBJECTS];
x = 0;
while(x < MAX_OBJECTS)
{
object[x] = oWifeshoes;
x++;
}


thanks for suggestions
Title: Re: is there a possibility to clone objects or characters??
Post by: monkey0506 on Sun 05/02/2006 00:27:28
There is no "new" keyword in AGS, so, no...Objects, Characters, and all the other managed types cannot be created from the script.  You could, if you needed it, create a pointer to an Object:

Object* pObjAtXY = Object.GetAtScreenXY(mouse.x, mouse.y);

(This would create a pointer to the object under the mouse (at that point)).

Why, might I ask, do you need this (what are you trying to do)?
Title: Re: is there a possibility to clone objects or characters??
Post by: Gilbert on Sun 05/02/2006 04:54:47
Related tracker entry (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=155) for your referenece.
Title: Re: is there a possibility to clone objects or characters??
Post by: Pumaman on Sun 05/02/2006 14:26:50
The reason this hasn't been implemented is because of the difficulty in dealing with the object's interactions. Since the object wouldn't have been set up in the editor, how would you specify what happens when the player clicks on it?

There are various possible solutions, but none of them leap out as seeming like the way to go.
Title: Re: is there a possibility to clone objects or characters??
Post by: Akumayo on Sun 05/02/2006 15:03:39
What about making the new objects interactions identical to another objects interactions?  This way you could clone existing objects to different places in the room.
Title: Re: is there a possibility to clone objects or characters??
Post by: Rocco on Wed 08/02/2006 00:26:15
Quote from: monkey_05_06 on Sun 05/02/2006 00:27:28

Why, might I ask, do you need this (what are you trying to do)?

Here i have an example, im not unhappy with the result so far.
http://s6.simpleupload.de/fc8f78bc9/Arcade.zip.html
But i need advice with the text.
Cause i want to display the score and player stats, but i cant use overlays.
(CJ - PLEASE We need more overlays :)
and the non blocking text functions that i know, have no functionality to display %d values.
i dont want to use the standard gui, cause the whole thing should fits to the module.
Title: Re: is there a possibility to clone objects or characters??
Post by: Khris on Wed 08/02/2006 00:35:02
Why don't you use a custom GUI?
A label on a transparent GUI should be exactly what you're looking for.

You could even use the default statusbar, just set its foreground and background color to 0 and add a textlabel.
To display graphical stuff, use the GUIs background pic for static stuff and buttons for the rest.
Title: Re: is there a possibility to clone objects or characters??
Post by: strazer on Wed 08/02/2006 16:52:05
Quote from: Rocco on Wed 08/02/2006 00:26:15
and the non blocking text functions that i know, have no functionality to display %d values.

Don't know what functions you're referring to exactly, but you could always construct the string beforehand using the StrFormat/String.Format function.

But I think it's totally okay to require the module user to create and name a GUI label. This way he can easily place it where he wants it.
Title: Re: is there a possibility to clone objects or characters??
Post by: Rocco on Wed 08/02/2006 21:07:57
thanks strazer, this is exactly what im searching for.
maybe the best way, is to provide both possibilities.