Reload (All Editors, But I don't know about Jamagic or whatever, just read it.)
Author: | Shawn Wolfram
|
Submitted: | 9th September, 2003
|
Views: | 4319
| Rated: |
|
|
This topic is on how to reload your game... J/k, put that knife away.
Anywho, As you thought, this article is how to reload like guns and such. Why am I writing this? Because it seems that all the games I see now a days have really strange ones that make no sense.
Okay, first things first, you need two counters, one will be your gun's clip (The smaller the easier, just to make sure you know) and the other one is your clip stock (Doesn't matter how large it is).
Now the coding. Obviously your going to have to make it so when you shoot your gun, it takes away from the clip and not the clip stock.
So, this part is complicated... To explain that is, but I'll try, seeing as how I did this many times. (I'm not talking about explaining, because that is hard, anyways, I'll shut up and get back to it.)
Okay, Start off with making an alterable value that stops the reload proccess from repeating, and for each of these events that you make just have it so it changes say Alterable Value A to 1 and then have a seperate event that says like every 5 milliseconds change Alterable Value A to 0. Now lets start the hard part.
Now lets say that your clip size is like 8. Make the first event something like If the Clip stock is greater than 8 and the clip is equal to 0 and AlterValue A is equal to 0, then subtract 8 from clip stock and add 8 to clip and change AlterValue A to 1.
Did you get all that? Okay, now you just copy that event, but at the conditions, change the clip stock to greater than 7 and the clip to equal to 1. Then change the subtraction to 7 and then the addition to 7 as well. Now just repeat this untill you get down to 0. (Yes do 0 as well.) But wait, there's more.
Now you have to do an series of events for if you do not have enough bullets. Start off with if the clip stock is equal to 7 and the clip is equal to 0. Then you just have the clip stock loose 7 and add 7 to the clip, and of course the AlterValue. Now you copy and make a second event. Change the clip stock in the conditions to equal 6, but then you change the clip to Less than or Equal to 1. Then change it so that the clip stock looses 6 and the clip gets 6. Then you just repeat untill you get to 0 again.
So that's that, I hope that this is helpful. And if I see another game that has a reloading system with only a clip stock, or pool or what ever, then I'll shoot you. Not really but still. And just remember that the more complicated the game, the better the game you will have. Not really but still. Now I'd better shut it before I start ranting again, so farewell, and good luck with your games everyone!
|
|
|