Scripts / Do we have a way to read when a gun is fired and count the amount of ammo for each weapon for the player?

Author
Message
perelect
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 2nd Jul 2015 00:27 Edited at: 2nd Jul 2015 00:58
Do we have a way to read when a weapon is fired, and or the ammo count for that weapon.

I cannot seem to find a way to read a value for either.

I need it to track how many shots are fired to compare to how many kills were made to create a shooting accuracy percentage of the player.

Cheers

EDIT: Also do we have an always active command that goes into the FPE as well?
I may be old, but at least my memory still ....hmmm

Pavilion dv6 Notebook, Intel(R) Core(TM) i5-2410M CPU @ 2.30 GHz, Win 7 64 bit, 16 GB Ram, Radeon (TM) HD 6490M, 2336 MB Memory. Resolution 1366x768, Intel(R) HD Graphics 3000. (WEI 5.8)
!nullptr
Forum Support
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 2nd Jul 2015 01:53
This has been a request of mine for a long time too perelect. Have some kids games waiting for ammo count so I can do a high score system and/or transfer the count to a new level.

On the last one, no idea. Do you mean "Always Active" on characters presumably?
AKA SisterMatic (Steam)
Development/ Gaming Rigs
Sys 1: i7-4770 (3.5)/16Gb/128 SSD/3Tb/970gtx/2 x 23, 1 x 27 LCD - Sys 2: i7/8Gb/670gtx/1.5Tb/1 x 23 LCD - Sys 3: Amd Quad/8Gb/645gtx/1Tb/30" LCD
PM
perelect
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 2nd Jul 2015 02:48
Thanks !nullptr

I will look for your request and add a comment to it as well.


Quote: "On the last one, no idea. Do you mean "Always Active" on characters presumably?"


Yes, "AlwaysActive" on any entity will do.
I am making up a list of all the different FPE commands we have.

I thought it was alwaysactive =1, but that doesn't seem to work for me....

Next Question....

How do you round a number down to, x amount of decimal places?
I'm just converting the shot distances from inches to kilometres.

I'm looking at [href=http://www.lua.org/manual/5.1/manual.html ]http://www.lua.org/manual/5.1/manual.html [/href] for a reference.

Cheers
I may be old, but at least my memory still ....hmmm

Pavilion dv6 Notebook, Intel(R) Core(TM) i5-2410M CPU @ 2.30 GHz, Win 7 64 bit, 16 GB Ram, Radeon (TM) HD 6490M, 2336 MB Memory. Resolution 1366x768, Intel(R) HD Graphics 3000. (WEI 5.8)
perelect
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 2nd Jul 2015 05:04
Update....
Quote: "Next Question....

How do you round a number down to, x amount of decimal places?
I'm just converting the shot distances from inches to kilometres.
"


Ok, I finally found a way to round a number..

Using the string.format command.

TextColor(60,74,3,"TotalDistMtrs: "..(string.format("%.3f",totaldistancekmls)),255,255,255)

So...
..(string.format("%.3f",totaldistancekmls)) will give you the number to 3 decimal places.
where:
totaldistancekmls is a variable for the number. ie 0.2368524254
%.3f is to 3 places. ie 0.236
so %.2f is to 2 places.






I may be old, but at least my memory still ....hmmm

Pavilion dv6 Notebook, Intel(R) Core(TM) i5-2410M CPU @ 2.30 GHz, Win 7 64 bit, 16 GB Ram, Radeon (TM) HD 6490M, 2336 MB Memory. Resolution 1366x768, Intel(R) HD Graphics 3000. (WEI 5.8)
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 2nd Jul 2015 13:39
agreed on the ammo / mouse press requests... kinda weird they're still missing but i'm sure it'll come when lee gets time

it is alwaysactive =1

i see you already found the rounding, i've always used this from google (same thing but in function form)
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
perelect
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 2nd Jul 2015 23:54
Thanks, smallg

I don't know why alwaysactive =1, isn't working for me, but I do modify everything I can .. maybe its time for a reinstall.

Cheers
I may be old, but at least my memory still ....hmmm

Pavilion dv6 Notebook, Intel(R) Core(TM) i5-2410M CPU @ 2.30 GHz, Win 7 64 bit, 16 GB Ram, Radeon (TM) HD 6490M, 2336 MB Memory. Resolution 1366x768, Intel(R) HD Graphics 3000. (WEI 5.8)
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 3rd Jul 2015 18:49
if it's only for a specific model i would try deleting the .bin and .dbo file for it and checking again
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Scene Commander
Support Manager
16
Years of Service
User Offline
Joined: 3rd May 2008
Location:
Posted: 4th Jul 2015 15:11
I also agree that these would really add to GameGuru. After the performance work, we will be launching a new voting system, so if users want us to work on LUA scripting, we will do that.

We actually already have a list of around 150 requested commands waiting to be added .

SC
i7-4770s 3.10ghz - Geforce GTX 650ti
perelect
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 5th Jul 2015 03:24
Quote: " We actually already have a list of around 150 requested commands waiting to be added . "


Wow that would be great !!!!

My vote is for more scripting commands.

I may be old, but at least my memory still ....hmmm

Pavilion dv6 Notebook, Intel(R) Core(TM) i5-2410M CPU @ 2.30 GHz, Win 7 64 bit, 16 GB Ram, Radeon (TM) HD 6490M, 2336 MB Memory. Resolution 1366x768, Intel(R) HD Graphics 3000. (WEI 5.8)

Login to post a reply

Server time is: 2024-05-08 21:33:29
Your offset time is: 2024-05-08 21:33:29