Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Vairable Distances DBC

Author
Message
Ginga
18
Years of Service
User Offline
Joined: 3rd Jul 2006
Location: Dorset, England
Posted: 11th Jul 2006 16:59
O dear, here i am with yet anotha wall to climb, hopefully someone will be able to give me a 'leg-up'

Basically, on my FPS im making, i want each weapon to have a certain range, tho when i change weapon the range doesnt hange with it.

The code will be a little sketchy, but bear with me.
I created an array 'weapon(4,6)' which holds the info for each weapon 'Range,Power,Ammo,MaxAmmo,MaxClip,Clip' This will never change, so i created other arrays for each type that r variables 'Range(4)'
when you change weapons, value 'G' changes eg. Pistol = 1 shotgun = 2 etc etc.

i use this code to fire the weapon


this code is the Shootbullet subroutine


no matter which weapon i use, it creates a sphere for the bullet at my co-ords and doesnt move it, yet when i change range(G) for a number like 500 it places it in the correct position.

Also, when i changed my weapon array from (1,6) to (4,6)as i added more weapons, i lost the texture on the first weapon but all the others were fine. am rather confused about this now.

If this made no sense, let me know and i'll try to write it out better.
Crit
18
Years of Service
User Offline
Joined: 24th May 2006
Location:
Posted: 11th Jul 2006 17:31
seems like "move object 200,range(G)" should be
move object 200,weapon(G,1)

Also, declare G as a global variable at the top of your program.

CHESS ENCOUNTER
Demo
WIP
Ginga
18
Years of Service
User Offline
Joined: 3rd Jul 2006
Location: Dorset, England
Posted: 12th Jul 2006 01:41
cheers ears, i should of mention tho, that i originally had it as 'move object 200,weapon(G,1)' and that didnt work either, which sucked beyond belief. I'll try declaring it and let you know what happens.

Login to post a reply

Server time is: 2024-11-27 15:33:30
Your offset time is: 2024-11-27 15:33:30