Game errors

Non-platform specific questions.

Re: Game errors

Postby DeltaLeeds » Sat Jul 28, 2012 2:59 am

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
Currently: Semi-Active.
Working on: Maybe putting my test games in gamejolt, polishing them a bit, but I still don't know when.
User avatar
DeltaLeeds
 
Posts: 693
Joined: Fri May 06, 2011 12:45 pm
Location: In front of my computer.
Score: 38 Give a positive score

Re: Game errors

Postby skydereign » Sat Jul 28, 2012 3:30 am

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--;
}
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Game errors

Postby DeltaLeeds » Sat Jul 28, 2012 5:30 am

Yay the character burns now,thanks Skyde.

P.S. How to leave shadow trails like some ninja in light speed?
Currently: Semi-Active.
Working on: Maybe putting my test games in gamejolt, polishing them a bit, but I still don't know when.
User avatar
DeltaLeeds
 
Posts: 693
Joined: Fri May 06, 2011 12:45 pm
Location: In front of my computer.
Score: 38 Give a positive score

Re: Game errors

Postby skydereign » Sun Jul 29, 2012 2:09 am

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.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Level 1-3 of my game

Postby DeltaLeeds » Mon Jul 30, 2012 9:50 am

Windows: https://dl.dropbox.com/s/wzf0jlupx7vnpy ... e.rar?dl=1
Linux: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.
Currently: Semi-Active.
Working on: Maybe putting my test games in gamejolt, polishing them a bit, but I still don't know when.
User avatar
DeltaLeeds
 
Posts: 693
Joined: Fri May 06, 2011 12:45 pm
Location: In front of my computer.
Score: 38 Give a positive score

Re: Game errors

Postby DeltaLeeds » Mon Jul 30, 2012 11:38 am

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?
Currently: Semi-Active.
Working on: Maybe putting my test games in gamejolt, polishing them a bit, but I still don't know when.
User avatar
DeltaLeeds
 
Posts: 693
Joined: Fri May 06, 2011 12:45 pm
Location: In front of my computer.
Score: 38 Give a positive score

Re: Game errors

Postby tzoli » Mon Jul 30, 2012 11:52 am

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;
Creepers are capable of climbing ladders, despite lacking arms. (Minecraft wiki)
User avatar
tzoli
 
Posts: 343
Joined: Sat Jun 12, 2010 6:54 pm
Location: Behind you
Score: 15 Give a positive score

Re: Game errors

Postby DeltaLeeds » Mon Jul 30, 2012 11:53 am

Hmmm they aren't so bad,I got an idea with the scripts,thanks Zoli, +1 for you :D
Currently: Semi-Active.
Working on: Maybe putting my test games in gamejolt, polishing them a bit, but I still don't know when.
User avatar
DeltaLeeds
 
Posts: 693
Joined: Fri May 06, 2011 12:45 pm
Location: In front of my computer.
Score: 38 Give a positive score

Re: Game errors

Postby DeltaLeeds » Mon Jul 30, 2012 12:39 pm

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?
Currently: Semi-Active.
Working on: Maybe putting my test games in gamejolt, polishing them a bit, but I still don't know when.
User avatar
DeltaLeeds
 
Posts: 693
Joined: Fri May 06, 2011 12:45 pm
Location: In front of my computer.
Score: 38 Give a positive score

Re: Game errors

Postby tzoli » Mon Jul 30, 2012 1:01 pm

Code: Select all
if(def > i){
i=1;
}

(i-damage;def-defence)
Creepers are capable of climbing ladders, despite lacking arms. (Minecraft wiki)
User avatar
tzoli
 
Posts: 343
Joined: Sat Jun 12, 2010 6:54 pm
Location: Behind you
Score: 15 Give a positive score

Re: Game errors

Postby DeltaLeeds » Tue Jul 31, 2012 10:30 am

Thanks Zoli :D

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?
Currently: Semi-Active.
Working on: Maybe putting my test games in gamejolt, polishing them a bit, but I still don't know when.
User avatar
DeltaLeeds
 
Posts: 693
Joined: Fri May 06, 2011 12:45 pm
Location: In front of my computer.
Score: 38 Give a positive score

Re: Game errors

Postby skydereign » Mon Aug 06, 2012 3:52 am

jonathang wrote:Thanks Zoli :D

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 ==.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Previous

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron