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 / Keystating to change weapons... Read on to find out what I'm talking about...

Author
Message
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 15th Jun 2004 02:00
Yeah how do you change weapons via 1,2,3,etc... above the letters I tryed using

to have it change weapons, but it doesn't seem to work, anybody know of alternate commands or how to fix this on DBCenhanced?

Got anime?
I do.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 15th Jun 2004 02:57
Use your code and the chart below for the keys your interested in

KEYSTATE(scancode # from chart) will return 1 if that key is pressed, 0 if not




* DBP_NETLIB_v1.3 - NOW WITH VARIABLE WATCHER! * Click Logo
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 15th Jun 2004 02:58
....wait did you mean the "rest" of the code??


* DBP_NETLIB_v1.3 - NOW WITH VARIABLE WATCHER! * Click Logo
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 15th Jun 2004 04:08
Well, I have to press 1 to change to one gun, and so I enter

and it doesn't work...
So do you know commands for the number keys Or am I missing something to make it work?

Got anime?
I do.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 15th Jun 2004 04:27
rem If user presses the 1 Key (scancode value 2)
if keystate(2)=1
...do whatever code
endif


* DBP_NETLIB_v1.3 - NOW WITH VARIABLE WATCHER! * Click Logo
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 15th Jun 2004 22:51
Tryed that already but it doesn't seem to work.

Got anime?
I do.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 15th Jun 2004 23:36
is that code within your main loop? It needs to be in the loop for it to work


* DBP_NETLIB_v1.3 - NOW WITH VARIABLE WATCHER! * Click Logo
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 15th Jun 2004 23:44
Yeah it is...
I need to know the answer because after that I want to implement variables for a hud that shows which gun is highlited and and then advance it so there are even more variables that state which gun is being used so it changes the different huds being used. It's a code from the code base at heart but originally it had the up,down,and left key as the buttons to press to change guns, which allowed it to work perfectly fine, but once I made it a keystate it stopped working I can't remember the name of the code in the code base but it's for DBC if you want to see it and it's called changing weapons or something, so if you can help me that would be great...

Got anime?
I do.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 16th Jun 2004 00:03
why not just paste the code here?


* DBP_NETLIB_v1.3 - NOW WITH VARIABLE WATCHER! * Click Logo
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 16th Jun 2004 01:02
Okay...
here it is...

Hope that helps.
See this code works perfectly fine, I even changed the object 2 to object 10 since that's what I want in my game, so let's see what ya got.

Got anime?
I do.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 16th Jun 2004 01:08
So this works


But this doesn't?



CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 16th Jun 2004 01:13


this works


* DBP_NETLIB_v1.3 - NOW WITH VARIABLE WATCHER! * Click Logo
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 16th Jun 2004 01:56
This is odd...
It still doesn't work in my program but it works in the original snippet...
Somethings telling me that it's got to do with the order of that the code, but that's just me and I'm just odd.

Got anime?
I do.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 16th Jun 2004 02:01
it may be working for you all along. If you notice LIT and I both posted the same code independently and it works for both of us... maybe try backing your camera up a little?


try this code




* DBP_NETLIB_v1.3 - NOW WITH VARIABLE WATCHER! * Click Logo
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 16th Jun 2004 02:33
Sorry bout the problem I stated after both of you claiming it to work, but I alas manged to have it work for myself. I'll post if I need help with the advancedments to the snippet, wheras it highlights a different hud and the huds vary depending on inventory, os don't declare this thread dead!
(Hey! That rhymed!)

Got anime?
I do.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 16th Jun 2004 04:32
did backing the camera up help?
both versions worked here.

good luck


* DBP_NETLIB_v1.3 - NOW WITH VARIABLE WATCHER! * Click Logo
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 16th Jun 2004 15:00
No I had the same variable in the main loop and not in the main loop, I took the one in the main loop out and it worked perfectly fine...

Remember this thread won't be dead from here on out, I will ask more question related to guns in the players inventory and highliting parts of the huds to know which gun is being used.
So stay tuned!

Got anime?
I do.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 16th Jun 2004 15:52
Quote: "No I had the same variable in the main loop and not in the main loop"


Ok 2 things. 1)I don't understand what you just said, and 2)For future reference if we ask you to "post the code", please post the code that you are using and isn't working - not the clean code you downloaded from the codebase. If you download from the CB and then start making alterations to that code, when you start having problems it won't help you to show us the "clean" code from the CB, we need the tweaked version as thats what not working!


* DBP_NETLIB_v1.3 - NOW WITH VARIABLE WATCHER! * Click Logo
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 16th Jun 2004 22:34
I thought you meant the code from the codbase, my bad.
What I meant though was I stated what the variable a should start out as before the main loop and in the main loop I had the same statment, so I'm guessing that the program thought that even if I keystated to change a to 2 that it thought a should stay as 3...

Got anime?
I do.
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 19th Jun 2004 16:10
Okay, time for the next step...
when a=3 I want to make it so it goes into melee combat, at the moment I don't have any models of arms with hands clenched in fists, so I thought I'd use cylinders for the moment, anyone have a good snippet for showing the cylinders jab or other stuff on mouse click?

Got anime?
I do.

Login to post a reply

Server time is: 2024-09-22 14:36:16
Your offset time is: 2024-09-22 14:36:16