Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
I created a mana bar with 2d overlay = 200 pixel, I add to this every seconds the 2d overlay + 1pixel, and when I press a key the 2d overlay -5pixel ( for skill ). BUT I DONT KNOW HOW TO LIMIT WHEN MANA =0 THE 2D OVERLAY PIXEL STOP IN 0 PIXEL, AND WHEN MANA = 200 ( MAX) THE 2D OVERLAY STOP IN 200 PIXEL ? ? |
||||
|
Simply use if a variable has a value do something...for example when a variable name mana has value 0 then execute javascript.. And use the code... Var s = CcbgetScenenodefromname("2Doverlay1") Ccbsetscenenodeproperty(s,"pixels" 0,0); This isn't the accurate code.... But the code should be something like this... Please go through the javascript reference api in the documentation... |
||||
|
Are you using JavaScript, or are you using the variable Actions? You must add more checks, like this: This will limit the high point of the Mana to 200: If Mana is less than 200, That will only allow the Mana to grow if its current amount is any number below 200. If the Mana is 199, 1 point will be added, so it will reach 200 and it won't grow higher. And this will only allow the Mana skill to be used if the player has at least 5 Mana points: If Mana key is pressed, That will limit the low point of the Mana to zero because a Magic Spell will only be used if your character has at least 5 points! I hope you can understand what I mean. You must set your variable Actions like those examples show. If you're using JavaScript, the same ideas will work, but they must be written according to the syntax rules of JavaScript. |
||||
|
Big thanks for your help ! But Im still not developer I send you my .ccp file, Can you complete the idea on the ccp file, for me? thanks :3 https://drive.google.com/file/d/0B3boo-rjTAQASXZUblpUdFlxNDg/view?usp=sharing |
||||
|
I added my examples from my previous post to your JavaScript sections. Download it here: https://drive.google.com/file/d/... You will notice that the bar doesn't grow higher than 200 points. If you hold the left mouse button, you will see that the bar only uses the Mana points if you have at least five points available. Even if you hold the left mouse button forever, it will never move below zero! |
||||
|
wrote: I added my examples from my previous post to your JavaScript sections. Download it here: https://drive.google.com/file/d/... You will notice that the bar doesn't grow higher than 200 points. If you hold the left mouse button, you will see that the bar only uses the Mana points if you have at least five points available. Even if you hold the left mouse button forever, it will never move below zero! woa thanks friend !! |
||||
|
I want to do if mana is too low skill does not work, and players need to wait for mana to recover or drink more mana potion !! :) |
||||
|
Added CCB template to MTM for everyones convenience...This thread is linked on MTM with the product, so that people better understand the context of the ccb |
||||
|
https://marshtownmadness.com |
||||
|
Hi there. ! I want to create a skill like in the picture, I want the AI around the circle to lose blood when entering, how to do? |
||||
|
wrote: Are you using JavaScript, or are you using the variable Actions? You must add more checks, like this: This will limit the high point of the Mana to 200: If Mana is less than 200, That will only allow the Mana to grow if its current amount is any number below 200. If the Mana is 199, 1 point will be added, so it will reach 200 and it won't grow higher. And this will only allow the Mana skill to be used if the player has at least 5 Mana points: If Mana key is pressed, That will limit the low point of the Mana to zero because a Magic Spell will only be used if your character has at least 5 points! I hope you can understand what I mean. You must set your variable Actions like those examples show. If you're using JavaScript, the same ideas will work, but they must be written according to the syntax rules of JavaScript. Can you show me how to do this with variable ? because im not coder |
|