Author Topic: is there a possibility to clone objects or characters??  (Read 473 times)  Share 

anything like this:
[code]
new object[MAX_OBJECTS];
x = 0;
while(x < MAX_OBJECTS)
{
 object
  • = oWifeshoes;

 x++;
}
[/code]

thanks for suggestions

monkey_05_06

  • AGS Project Admins
  • Has left the building.
Re: is there a possibility to clone objects or characters??
« Reply #1 on: 05 Feb 2006, 00:27 »
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:

[code]Object* pObjAtXY = Object.GetAtScreenXY(mouse.x, mouse.y);[/code]

(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)?
Let's be honest. Most people suck at coding. I suck at coding, but at least my code is readable. To Hell with anyone too lazy to maintain consistent formatting in their code. I could deal with bad interfaces and structure if I could even read your horrible code. And that's putting it nicely. -monkey

Iceboty V7000a

  • Local Moderator
  • * KILL* * KILL * * KILL *
    • Lifetime Achievement Award Winner
    •  
Re: is there a possibility to clone objects or characters??
« Reply #2 on: 05 Feb 2006, 04:54 »
Related tracker entry for your referenece.

Pumaman

  • Creator of AGS
  • Administrator
  • Mittens TRAITOR
  • I sense danger.
    • Lifetime Achievement Award Winner
    •  
Re: is there a possibility to clone objects or characters??
« Reply #3 on: 05 Feb 2006, 14:26 »
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.

Akumayo

  • Is Watching You
    • I can help with AGS tutoring
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with story design
    •  
    • I can help with voice acting
    •  
  • Akumayo worked on a game that was nominated for an AGS Award!
Re: is there a possibility to clone objects or characters??
« Reply #4 on: 05 Feb 2006, 15:03 »
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.
"Power is not a means - it is an end."

Re: is there a possibility to clone objects or characters??
« Reply #5 on: 08 Feb 2006, 00:26 »

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.

Khris

  • Evil Dark Emperor Death-Kill
    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
Re: is there a possibility to clone objects or characters??
« Reply #6 on: 08 Feb 2006, 00:35 »
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.
http://whathaveyoutried.com/

The other day on yahoo answers:
"Can you print colored images with black ink? If so tell me how please Thanx Kimberly"

Re: is there a possibility to clone objects or characters??
« Reply #7 on: 08 Feb 2006, 16:52 »
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.

Re: is there a possibility to clone objects or characters??
« Reply #8 on: 08 Feb 2006, 21:07 »
thanks strazer, this is exactly what im searching for.
maybe the best way, is to provide both possibilities.