Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Old
Techique
Guest
 
Status:
Posts: n/a
Default 05-20-2010, 07:32 PM

HAHA! i see now thanks alot
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 05-20-2010, 07:34 PM

Your welcome, any more questions I am glad to help.


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Old
Techique
Guest
 
Status:
Posts: n/a
Default 05-21-2010, 11:27 AM

Hey dameria, if you there i was wondering how i could approach ammunition for the guns? i was thinking the same variable as health. but is there an easier way?
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 05-21-2010, 03:54 PM

Just use a number variable called "ammo" and set it to the amount you want for that gun. Then, in the method where you shoot, say "if(ammo > 0), do the shoot method and decrement "ammo" by 1. You can then have a reloading method where you do the animation of reloading the gun, and at the end of the animation you do "ammo = (amount of ammo you want in the gun)". Once you do that you will have a system where you only shoot if you have a set amount of ammo in the gun, and once you run out you have to reload.

You can even go a step more realistic (only if you want) and have a limited amount of ammo overall, which could be another number variable called "totalAmmo", and in the reloading method you do "if((amount of ammo you want in gun) > totalAmmo), ammo = (amount of ammo you want in gun) - totalAmmo, else ammo = (ammount of ammo you want in gun)". Tell me if this does not make sense to you and maybe I will make an example.


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Old
Watsamax1
Senior Member
 
Watsamax1's Avatar
 
Status: Offline
Posts: 155
Join Date: Aug 2009
Default 05-21-2010, 09:13 PM

It makes no sense . Id like a ammo system probably infinite ammo but you still gotta reload. I dont get what to do. Like where to put what. Lie put ammo= total ammo if it goes in reload or shoot.


___________________________________________________

Watsamax Industries
Games Produced for Watsamax Industries Inc. 2010
Watsamax Industries: New York
Watsamax@gmail.com
http://www.facebook.com/profile.php?id=100001253371874#!/profile.php?id=100001253371874&v=wall
http://www.youtube.com/user/Watsamax
___________________________________________________
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 05-21-2010, 09:14 PM

Quote:
Originally Posted by Watsamax1 View Post
It makes no sense . Id like a ammo system probably infinite ammo but you still gotta reload. I dont get what to do. Like where to put what. Lie put ammo= total ammo if it goes in reload or shoot.
Do you want me to make an example world?


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Old
Watsamax1
Senior Member
 
Watsamax1's Avatar
 
Status: Offline
Posts: 155
Join Date: Aug 2009
Default 05-21-2010, 09:26 PM

OMG I LOVE YOU it work it really works!!!!!!!! WWWOOOO:eek :!!! yeah! thank you. your getting on the credits. Im working no a dinosaur shoot em up. its kinda like Jurassic park/tomb raider 3/ my imagination. Question now is health. um like an attack. i plan on if near so many meters t-rex attack. Also cutscene i cannot figure em out.


___________________________________________________

Watsamax Industries
Games Produced for Watsamax Industries Inc. 2010
Watsamax Industries: New York
Watsamax@gmail.com
http://www.facebook.com/profile.php?id=100001253371874#!/profile.php?id=100001253371874&v=wall
http://www.youtube.com/user/Watsamax
___________________________________________________
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 05-21-2010, 09:36 PM

Quote:
Originally Posted by Watsamax1 View Post
OMG I LOVE YOU it work it really works!!!!!!!! WWWOOOO:eek :!!! yeah! thank you. your getting on the credits. Im working no a dinosaur shoot em up. its kinda like Jurassic park/tomb raider 3/ my imagination. Question now is health. um like an attack. i plan on if near so many meters t-rex attack. Also cutscene i cannot figure em out.
Congrats, and by the way this whole thread is basically about the health system, so you can just look at previous posts to see what I told the other guy to do.

Also, for cutscenes you will have to create boolean variables like "canPlay", and you have to put EVERY method that you can do while playing the game in an "if(canPlay)" if statement before running each method, and drag the code for the method inside the if else statement (remember, EVERY method that allows the player to do something in the game, this includes moving, reloading, shooting methods, etc). You will have to create one of these if/elses for every method that is active while the game is played, but not the cutscenes. Have a the world variable "canPlay" set to true as the initial value (unless you want a cutscene in the beginning, then set it to false and put the code "canPlay = true" at the end of the cutscene). Then at every cutscene method (you will have to create a method for each cutscene and put the animation within that method), you will have to set "canPlay" to false as the first line of code (this will prevent the character from being able to move, shoot, reload, etc) and set "canPlay" to true at the end of the cutscene. Once you do this you should be able to control the cutscene without any interruptions from the player until the cutscene is over.

Tell me if this helped or just made you really confused. If you need help on the cutscenes themselves, that will be harder because that involves creativity, and you have to do that yourself (unless of course you want someone to help you create the actual cutscene to make it more realistic, but then it will not be created by you).


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Old
Watsamax1
Senior Member
 
Watsamax1's Avatar
 
Status: Offline
Posts: 155
Join Date: Aug 2009
Default 05-21-2010, 09:52 PM

I may get it. But i just noticed if i reload i get infinite ammo and i dont have t reload


___________________________________________________

Watsamax Industries
Games Produced for Watsamax Industries Inc. 2010
Watsamax Industries: New York
Watsamax@gmail.com
http://www.facebook.com/profile.php?id=100001253371874#!/profile.php?id=100001253371874&v=wall
http://www.youtube.com/user/Watsamax
___________________________________________________
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 05-21-2010, 10:07 PM

Quote:
Originally Posted by Watsamax1 View Post
I may get it. But i just noticed if i reload i get infinite ammo and i dont have t reload
What should happen is that you can only shoot the amount of times that there are bullets in the gun, but once the bullets in the clip run out you can reload, putting more bullets in the clip. Are you saying that you never need to reload, and you just keep shooting without it ever stopping? If so then make sure that either the shooting event being called in the events bar, or the entire shooting method itself if within a large if/else statement with what I said in the post before.

If its still not working right, take a print screen and upload the image of the code to the forums (you can black out the animation if you don't want to to see that part) and I can see what you did. If you do this though, make sure everything is showing including the world variables, the method for shooting, and the events bar where you called in the shooting method.

Or you can just ask and I will make a quick example and upload it on this thread. I think that many people will like to see an example anyways because they might be interested in a reloading example for their own worlds.


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.