Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (Quad, AndrewAMD, Imhotep, TipmyPip, Edgar_Herrera), 809 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
A Gun ... #477522
07/04/19 11:34
07/04/19 11:34
Joined: Jun 2018
Posts: 29
B
bbn1982 Offline OP
Newbie
bbn1982  Offline OP
Newbie
B

Joined: Jun 2018
Posts: 29
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

A WDL-SCRIPT (a weapon) (text must be in a WDL-FILE) > name.wdl < ...

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


SOUND fire_weapon = "shot8.wav"; /*weapon shoot sound , must be in same folder as script*/

var ammo = 100; /* amount of bullets (decrease when shooting */

PANEL cross001 /* the aim*/
{
pos_x = 960; /* x position of aim (on screen)*/
pos_y = 530; /* y position of aim (on screen*/
bmap = "cross.pcx"; /* bitmap to use (must be in same folder , as script*/
flags = SHOW | OVERLAY; /*show immidiately and hide black surfaces*/
}

function gun() /* the weapon , include it in MAIN FUNCTION "gun()"; to trigger the gun */
{
while(ammo > 0) /* while ammo is higher then 0 */
{
if(key_ctrl == 1)||(mouse_left == 1) /*if those are pressed*/
{
ammo-=1; /*decrease ammo*/
vec_set(temp,camera.x); /* copy temp (how long the bullet goes) to camera.x*/
temp.x = 1000000; /*distance to trace (how long the bullet goes)*/
vec_rotate(temp,camera.pan); /*rotate , the trace distance (how long the bullet goes) (with the cameras pan value)*/
trace_mode = ignore_me + ignore_passable + activate_shoot; /* ignore that , and make entitis with "my.enable_shoot = on" sensitive , to being shoot at*/
trace(camera.x,temp); /* shoot 10000000 forward*/
snd_play(fire_weapon,100,1);/* play this sound when shooting (must be in the same folder as script)*/
wait(3); /* wait this before shooting again (pushing MOUSE_LEFT or CTRL)*/
}
wait(1);
}
}



/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Needed something to do ..

/B

Re: A Gun ... [Re: bbn1982] #477523
07/04/19 11:48
07/04/19 11:48
Joined: Jun 2018
Posts: 29
B
bbn1982 Offline OP
Newbie
bbn1982  Offline OP
Newbie
B

Joined: Jun 2018
Posts: 29

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Something ...

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


I have one more thing to say , change this "wait(3);" , to slower the shooting , it became a little bit to fast ..


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Needed something to do ..

/B

Re: A Gun ... [Re: bbn1982] #477534
07/04/19 16:36
07/04/19 16:36
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline
User
Dooley  Offline
User

Joined: May 2005
Posts: 868
Chicago, IL
wait(3) might not help.

using a negative value will change the wait to seconds

wait(-1) will make it wait one second between shots.
wait(-.25) will make it wait a quarter of a second, etc...


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1