Ambiera Forum

Discussions, Help and Support.

Create a new account, Search, or Login:
Name: Password:
Ambiera Forum > CopperCube > Programming and Scripting
Extending Internal Objects
Author Text

DouweDabbe
Guest
Quote
2022-05-25 17:15:46

Can I extend the:
"Game Actor with Health (AI, Player)"
thingy with my own methods ?

because i cant find its object / class name its also not in the copperlight class listing.


Robo
Guest
Quote
2022-05-27 12:21:15

No, you can only adjust the movement speed during the game and camera angle.

Other functions are not available.


DouweDabbe
Guest
Quote
2022-05-29 04:29:59

Hi robo and others

Let me clarify my question:

For example, if you use the CC action:
"Drag 3D Object with constraints"
You get to fill in the properties panel but also the code to look at.

And there in the code you wil see the objects name:
"action_Drag3DObject"
This action although a bit simple is very suitable to be turned into some sort of player avatar.
And because you want your player avatars to be universal you woud give it usercontrol functions.
And pathfinding routines so it also can be used as an enemy avatar.

And you can do that; because you know its Object name,
you can extend that script with your own functions, like so:

functions usefull for an enemy node:
"action_Drag3DObject".prototype.findPathToPlayer = function() {}
"action_Drag3DObject".prototype.followPathToPlayer = function() {}

and the functions usefull for an player node:
"action_Drag3DObject".prototype.movePlayerTo = function() {}

etc. etc.

Now why reinvent the wheel if it is already largely there?

thats why I want to know the name of the inbuild object
"Game Actor with Health (AI, Player)"

so that I can extend it with my own custom functions
But only Niko knows them ?


just_in_case
Moderator
Quote
2022-05-29 10:27:58

The drag 3D object is an external scripted action so you can read the source in javascript. All the internal extension ( behaviors and actions) are coded in C++ internally and don't have a javascript source. So you can't really use the parameters.

However, for the webGL part you might be able to use it as the game source is completely open and is in javascript. what you can do is you can attach the inbuilt behavior or action to an object and then publish it as webGL and then run it on the browser now while the game is running open the developer console of the browser and you probably can traceback the functions (classes) the game is using.

hope that bit of information helps.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Int?rnational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© 2020 Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact