Platform Builder Forums

Help and Support => Working with Platform Builder => Topic started by: Antikore on September 11, 2020, 08:39:57 PM

Title: Idk what I'm doing wrong exactly with variables
Post by: Antikore on September 11, 2020, 08:39:57 PM
Let me explain, I'm trying to do a defend dash system, however, my defend variable stays in 0.
Here are my three command prompts
Code: [Select]
//Player 1 - Create CP
local var defend = 0

Code: [Select]
//Player 1 - Looping CP
if defend > 0
defend - 1
if defend > 16
{
     color = yellow
     effect = diamond out
     remove hurt = true
}
else
remove hurt = false
<area name>[defend] //For testing

Code: [Select]
//Player 1 - Pick Key Press CP
if defend = 0
defend = 32

However, it just does nothing
Title: Re: Idk what I'm doing wrong exactly with variables
Post by: Antikore on September 14, 2020, 11:44:32 AM
*Bump*
Title: Re: Idk what I'm doing wrong exactly with variables
Post by: Antikore on September 15, 2020, 09:31:58 AM
Really? Anybody?
Title: Re: Idk what I'm doing wrong exactly with variables
Post by: Gizgord on September 15, 2020, 10:34:22 AM
did you try running two variables?
like 'defend' and 'defend_check'. it might help you out
Title: Re: Idk what I'm doing wrong exactly with variables
Post by: Antikore on September 15, 2020, 07:03:04 PM
did you try running two variables?
like 'defend' and 'defend_check'. it might help you out
wdym exactly?
Title: Re: Idk what I'm doing wrong exactly with variables
Post by: Gizgord on September 16, 2020, 06:44:03 AM
Code: [Select]
//Player 1 - Pick Key Press CP
if defend = 0
defend = 32
let's say here, wouldn't this be better if you did something like:
if defend_check = 0
defend = 32

maybe this happens simply because Command Prompt doesn't recognize the variables. I had a problem like that before. try running this code with 'game var's in place
Title: Re: Idk what I'm doing wrong exactly with variables
Post by: Antikore on September 16, 2020, 09:42:53 AM
let's say here, wouldn't this be better if you did something like:
if defend_check = 0
defend = 32

maybe this happens simply because Command Prompt doesn't recognize the variables. I had a problem like that before. try running this code with 'game var's in place
okay, lets see
Title: Re: Idk what I'm doing wrong exactly with variables
Post by: Antikore on September 16, 2020, 03:13:12 PM
Fixed: I tested changing the name
Looks like defend or defending doesn't work, but defendStatus and defendingS does
So. Its a bug report now?

EDIT: Nvm, defend and defending are built-in variables. Defend is used for adding defend ability to the player, and defending is to check the player's defending status.