Gamestudio Links
Zorro Links
Newest Posts
What are you working on?
by 3run. 09/19/19 09:42
Any chance of PBR materials with A8?
by Quad. 09/18/19 18:00
Sierra Chart Plugin
by AndrewAMD. 09/18/19 14:03
3d model editor
by karmacomposer. 09/18/19 13:18
Can MED export to FBX?
by karmacomposer. 09/18/19 13:07
I cannot get the A8 game engine to show anything
by karmacomposer. 09/18/19 12:38
Script, Start Trading Immediately
by jcl. 09/18/19 08:38
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
12 registered members (Ayumi, 3run, AndrewAMD, Quad, saulius, 20BN, kvm, MatPed, 3 invisible), 613 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Dark_Light, oxygenjoe, web20tpo, tarekhazem, Juanjo
18290 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: 24
B
bbn1982 Offline OP
Newbie
bbn1982  Offline OP
Newbie
B

Joined: Jun 2018
Posts: 24
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

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: 24
B
bbn1982 Offline OP
Newbie
bbn1982  Offline OP
Newbie
B

Joined: Jun 2018
Posts: 24

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

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: 686
Chicago, IL
Dooley Offline
User
Dooley  Offline
User

Joined: May 2005
Posts: 686
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