Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   Questions and Comments (http://www.alice.org/community/forumdisplay.php?f=9)
-   -   need urgent help (http://www.alice.org/community/showthread.php?t=7801)

intel8080 12-13-2011 04:36 PM

need urgent help
 
please, could some one tell me, that how can i reload bullets and how can i set each bullet false by firing every time...

suppose, i have 5 bullets..every time i fire, each bullet should be vanish accordingly, how can i make this method?

TauTrumpsPi 12-14-2011 01:52 PM

Invisible Bullets
 
What I would do is make a variable called Counter, the increase it by 1 every time a bullet is fired. After that, make a bunch of if/else statements to see which number counter is at, and under those if/else statements set the proper bullet to isShowing == false.

dakota95 12-14-2011 02:05 PM

[QUOTE=intel8080;44591]please, could some one tell me, that how can i reload bullets and how can i set each bullet false by firing every time...

suppose, i have 5 bullets..every time i fire, each bullet should be vanish accordingly, how can i make this method?[/QUOTE]

would using one bullet work? It would work faster than multiple bullets and it is easier. You could just tell it to move back to the gun a split second after it is fired. The only problem with it, is that there is no limit to the amount of times you can fire.

waqar 12-19-2011 02:59 PM

1 Attachment(s)
I guess this maybe helpfull for u :)

Joker899 12-19-2011 10:07 PM

Having bullets move back and forth between the gun tends to not work. The bullets ignore frames and any detection or bullet collision you had is ineffective.

Usually I use a method similar to this: [url]http://www.alice.org/community/showthread.php?t=4861[/url]

That's the basic bullet collision detection I use (Look for the cone in the objects, that is the detector).

Also to keep track of bullets I use a number variable and some 3D text.

Lets say for example I use
[CODE]
3dtext set value (int (world.bulletvariable) as a string)
[/CODE]

Use this in a infinite loop and it will keep track of your ammo.
Have the default setting of the variable be your max ammo in clip.
Now whenever you shoot just drag the variable in the shoot mechanism and choose [B]decrement (world.bulletvariable) by 1[/B]. This will then adjust your ammo accordingly.

When you reload, just drag the variable into the reload mechanism and have it [B]set (world.bulletvariable) to (30 or whatever your max ammo is)[/B]

Works like a charm. If I went a bit off-topic--sorry. Hope this helped.

waqar 12-20-2011 08:57 PM

believe me why go hard when u can do it in an easy way check out the FPS i made its working pretty cool w/o this bulllet detection thing i set that if mouse clicked on enemies do following methods check it out
[url]http://dl.dropbox.com/u/52144883/COUNTER%20AT%20KIET.a2w:[/url])

for screen shots and other link go here

[url]http://alice.org/community/showthread.php?p=44966#post44966[/url]


All times are GMT -5. The time now is 08:10 PM.

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