Page 2 of 2
Re: Game errors

Posted:
Sat Jul 28, 2012 2:59 am
by DeltaLeeds
Now I want to make an enemy "Burn" the player for a limited time,so the player loses 1 HP really fast for 3 seconds.. So how to do that?
EDIT:Sorry for double post
Re: Game errors

Posted:
Sat Jul 28, 2012 3:30 am
by skydereign
One way is to set an actor variable to some positive value. As long as that value is greater than 0, reduce it and lower hp.
player -> Draw Actor -> Script Editor
[code]if(burn>0)
{
burn--;
hp--;
}
Re: Game errors

Posted:
Sat Jul 28, 2012 5:30 am
by DeltaLeeds
Yay the character burns now,thanks Skyde.
P.S. How to leave shadow trails like some ninja in light speed?
Re: Game errors

Posted:
Sun Jul 29, 2012 2:09 am
by skydereign
One way is to create an actor, with the animation you want to be the trail, and create it in the draw event. You probably want to not create it every frame though. Other then that just destroy the after image actor, with a timer for instance.
Level 1-3 of my game

Posted:
Mon Jul 30, 2012 9:50 am
by DeltaLeeds
Windows:
https://dl.dropbox.com/s/wzf0jlupx7vnpy ... e.rar?dl=1Linux:Not yet
Mac:Not yet
P.S. I can make the trails now Skyde,but I want to make the trails appear 1 by 1.
Re: Game errors

Posted:
Mon Jul 30, 2012 11:38 am
by DeltaLeeds
How to set minimum number for something...How do I say this?...Ok let me show a script example
Collision=>Tweet=>Player.LifeVar-=rand(10);//You see the damage could be 0,I want the minimum damage to be 7. How to do that?
Re: Game errors

Posted:
Mon Jul 30, 2012 11:52 am
by tzoli
Well I know two ways which aren't the perfect way but the effect is the same:
1.You only randomize to 3 and then give to it 7
- Code: Select all
int i;
i=rand(3) + 7;
Player.LifeVar-=i;
2.(worse one)
- Code: Select all
int i;
i=rand(10);
if(i<7){
i=7;
}
Player.LifeVar-=i;
Re: Game errors

Posted:
Mon Jul 30, 2012 11:53 am
by DeltaLeeds
Hmmm they aren't so bad,I got an idea with the scripts,thanks Zoli, +1 for you

Re: Game errors

Posted:
Mon Jul 30, 2012 12:39 pm
by DeltaLeeds
I'm trying to make an RPG version of my game. Its doing great,the problem is, I want the enemy to damage me by 1 when my defense is too high for it,instead of adding my HP,how to do that?
Re: Game errors

Posted:
Mon Jul 30, 2012 1:01 pm
by tzoli
- Code: Select all
if(def > i){
i=1;
}
(i-damage;def-defence)
Re: Game errors

Posted:
Tue Jul 31, 2012 10:30 am
by DeltaLeeds
Thanks Zoli

The player couldn't lvl up for some reason. This is the script I used.
Player=>Draw Actor=>Script
- Code: Select all
Player.Level==ExpHaven/50+(Level*Level);//ExpHaven=Total XP
P.S We start from level 0. (I've made us start from level 1 but it still doesn't work)
Why couldn't the player level up?
Re: Game errors

Posted:
Mon Aug 06, 2012 3:52 am
by skydereign
jonathang wrote:Thanks Zoli

The player couldn't lvl up for some reason. This is the script I used.
Player=>Draw Actor=>Script
- Code: Select all
Player.Level==ExpHaven/50+(Level*Level);//ExpHaven=Total XP
P.S We start from level 0. (I've made us start from level 1 but it still doesn't work)
Why couldn't the player level up?
There is a difference between == and =. If you want to set a variable equal to the right side, you use a single equal. If you want to compare the two sides (like in an if statement) you use ==. Your code won't change Player.Level's value because it uses ==.