Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   Just wondering if i doing this right (http://www.alice.org/community/showthread.php?t=5241)

SirThorfinn 10-16-2010 05:46 PM

Just wondering if i doing this right
 
1 Attachment(s)
For my FPS i want to have weapon switching and i was just experimenting in a separate world. Would you please tell if these methods for it are good if so i'm going to use it in my game.:D
[ATTACH]3738[/ATTACH]

Dameria 10-16-2010 07:11 PM

A lot of your methods are unnecessary, for example you have different "take out" and "put away" methods for each gun. You could have world method for "take out" and "put away" and even firing by using parameters, and by using the parameters for if/else statements within the methods to choose which gun to take out, all in 1 method.

SirThorfinn 10-16-2010 07:27 PM

The only reason the weapons had different take out and put away methods was because i wanted them to come up to the screen in different ways depending on the gun, plus the Glock had a weird center point so i had to make one for it anyway.

debussybunny563 10-16-2010 07:49 PM

[SIZE="2"]It's nice, but there's a bug with the M1014 and Glock that you can have both out at once. I think it has to do with shooting and switching weapons at the same time; having variables governing those will eliminate that (e.g. If <shooting> == <false>, weapon.switch; Else, Do Nothing;;If <switching> == <false>, weapon.shoot; Else, Do Nothing)

Anyway, D-dog's right; in my FPS I used one method with If/Elses to determine which weapon should be drawn. In the long run, it is extremely useful to be able to compact coding and save up on space.[/SIZE]

SirThorfinn 10-16-2010 08:50 PM

[QUOTE=debussybunny563;26810][SIZE="2"]It's nice, but there's a bug with the M1014 and Glock that you can have both out at once. I think it has to do with shooting and switching weapons at the same time; having variables governing those will eliminate that (e.g. If <shooting> == <false>, weapon.switch; Else, Do Nothing;;If <switching> == <false>, weapon.shoot; Else, Do Nothing)

Anyway, D-dog's right; in my FPS I used one method with If/Elses to determine which weapon should be drawn. In the long run, it is extremely useful to be able to compact coding and save up on space.[/SIZE][/QUOTE]

Ok cool, its only an experiment so i was sure there would be issues. And ill shorten the code as much as i can with your guys' idea but the Glock has a weird center point so it wouldn't work in a method like that, the other 2 would though.

Dameria 10-16-2010 09:00 PM

You can do the individual animations within the one method. You can put the exact animation to put the glock away in the same method that you put the AK47 away, you just put it in a different if/else statement away from the AK47's animation.

debussybunny563 10-16-2010 09:00 PM

[SIZE="2"]Are you sure?
Because with If/Elses you can put different method for each weapon, so I wouldn't think having a different animation for the Glock would be a problem.[/SIZE]

Dameria 10-16-2010 09:02 PM

[QUOTE=debussybunny563;26815][SIZE="2"]Are you sure?
Because with If/Elses you can put different method for each weapon, so I wouldn't think having a different animation for the Glock would be a problem.[/SIZE][/QUOTE]

Wow, your post was posted at literally the exact same time as I posted my previous comment. It was so fast that when I posted mine and it refreshed this post screen, it showed my comment and then yours right underneath mine, meaning that you posted in between the time of me clicking the post button and the screen refreshing again.

Never seen that happen before :eek:

SirThorfinn 10-16-2010 09:03 PM

oh thats what you mean, i thought you men't to have all the weapons move to the same position when you take them out and put them back, my bad i know what you mean.

debussybunny563 10-16-2010 09:04 PM

[SIZE="2"][QUOTE=Dameria;26816]Wow, your post was posted at literally the exact same time as I posted my previous comment. It was so fast that when I posted mine and it refreshed this post screen, it showed my comment and then yours right underneath mine, meaning that you posted in between the time of me clicking the post button and the screen refreshing again.

Never seen that happen before :eek:[/QUOTE]

FTW.



BTW, you're close to your 777th post.
EDIT: And this is my 515th.[/SIZE]


All times are GMT -5. The time now is 09:34 PM.

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