Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Announcements and Showcase
behavior to Display Current Altitude.

just_in_case
Moderator
Quote
2017-02-09 13:21:58

Just Created a behavior to show current altitude with respect to the current player specified on a 2d overlay...

Created it for @BlackWater as he need this for his project..

Maybe other will found this usefull...

So here is the link to behavior
https://drive.google.com/open?id...


weaponsempty
Registered User
Quote
2017-05-08 01:43:35

nice, thanks a lot just_in_case!


behroz-khan
Registered User
Quote
2018-08-18 12:46:03

Hmm. Looks nice but I need that when we are at:
60 meters = subtract 60 health
20 meters = subtract 20 health
and so on....
Can you help me???


just_in_case
Moderator
Quote
2018-08-18 12:48:10

Sure, you can easily do this using my behavior...


just_in_case
Moderator
Quote
2018-08-18 15:24:27

here is the example file... if your player will reach 20 meters height then his health will be subtracted by 20... and if he is at height of 60 meters his health will be decreased by 60...

link to the example file... Use variable "Altitude" to compare and then decrease the health accordingly...

https://drive.google.com/file/d/...


behroz-khan
Registered User
Quote
2018-08-19 10:21:18

Hmm. it's alright but the box just flies around... I want if the altitude is 60 and it fell on the ground then subtract health not when it is on 60 altitude..
I hope you understood and will help me.


behroz-khan
Registered User
Quote
2018-08-20 14:19:00

just-in-case you are not answering me... Why???


just_in_case
Moderator
Quote
2018-08-20 18:05:57

Sorry, i was busy... If i have read your post i definately have answered you...

Reagrding to your question.... As i have already provided you a link to diffrent thread ... In another post... On how to create a fall damage based on comparing altitude using the time... You can easily understand the javascript code provided there.... To make it convenient for you am pasting the cose here too.....




First set a coppercube variable...I called mine "Altitiude" Then run this code every second using the looped interval behavior (Can't remember what it is called)

---------------------------------------------------------------------------------

var LastAltitude = ccbGetCopperCubeVariable("Altitude");
print(LastAltitude);

var s = ccbGetSceneNodeFromName("Camera1");

var position = ccbGetSceneNodeProperty(s, "Position");

ccbSetCopperCubeVariable("Altitude", position.y)

var currentAlt = position.y;
currentAlt = currentAlt + 60;
if(LastAltitude > currentAlt)
{

print("Died");

}else
{

print("Working");

}


-------------------------------------------------------------------------


The above method is posted by another user... But uses my behaviour script to make a fall damege... It is just modified version of my script...

You can change the variable and valaues accordingly to make this work for you...

Have patience, i go through all the post in the forums... And will reply to most of them , when necessary...
There maybe possibility that am not active , or is busy... This doesn't mean am ignoring or not answering your posts...


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internati?nal" (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© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact