Scripts / A Cash, Leveling, Purchasing and level discount Purchasing Script

Author
Message
AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 13th Feb 2014 12:16 Edited at: 3rd Mar 2014 08:21
Hey all just wanted to share these and anyone and everyone is free to copy and edit these as they wish. I definitely can't claim sole creation though as i had a lot of help in these by Conjured Entertainment and smallg and cant thank them enough for reading my attempts at scripting and pointing out where i went wrong so thank you both.



all my scripts are in the zipped folder attached, Note i also included the modified Global script to work with them so just copy them to script bank and all should be ok

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home
AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 13th Feb 2014 12:26 Edited at: 13th Feb 2014 13:21


Feel free to visit and edit the public FPSCR resource wiki page



http://fpscrresource.wikispaces.com/home
TattieBoJangle
10
Years of Service
User Offline
Joined: 7th Jan 2014
Location: United Kingdom
Posted: 13th Feb 2014 13:03
Aww man this is soo good thanks

AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 13th Feb 2014 13:04
No Problem but just realised this bit is not needed on the pickup experiance script its at the bottom and does no harm but to tidy it up should delete this bit:







i will edit the original post

Feel free to visit and edit the public FPSCR resource wiki page



http://fpscrresource.wikispaces.com/home
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 13th Feb 2014 18:14
seems like you got everything working for u and very nice wiki too



@tattie; sinister is creepy... that music

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Jerry Tremble
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 5th Nov 2012
Location: Sonoran Desert
Posted: 14th Feb 2014 15:01
That is awesome! We now have COUPONS! I can now kill baddies AND save money, too! Just awesome, thanks!
PM
AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 14th Feb 2014 15:03
i have made a better script to deal with level changes and according price changes but these are not finished yet but i will upload them when they are

Feel free to visit and edit the public FPSCR resource wiki page



http://fpscrresource.wikispaces.com/home
J0linar
GameGuru TGC Backer
14
Years of Service
User Offline
Joined: 3rd Feb 2010
Location: Vienna, AT
Posted: 15th Feb 2014 13:45
nicely done and thanks for sharing

http://j0linar.blogspot.co.at/
PM
Avram
GameGuru TGC Backer
18
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 15th Feb 2014 19:18
Whoa, this is great so easy to achieve, compared to FPI scripts

no signature
almightyhood
11
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 21st Feb 2014 17:29
cool, now if only we could get a fuller levelling system with some form of perks or something m8, that would be awesome, but im guessing abit harder to do lol.. still great work with everything so far

have fun stay safe

hood
PM
AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 21st Feb 2014 17:47
Yeah I am planning something along those lines we just need a few more options we can use for lua to affect things like weapon damage, damage resistance and the such. Will start work on it as soon as we have these options

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home
Conjured Entertainment
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 23rd Feb 2014 01:12
This is really nice. I like your random amount for the cash pickup. Sweet



Quote: " we just need a few more options "


I can hardly wait to get more key presses than just the E key.

MK83
GameGuru TGC Backer
18
Years of Service
User Offline
Joined: 10th Jun 2006
Location: Greeneville, TN USA
Posted: 24th Feb 2014 21:02 Edited at: 24th Feb 2014 21:04
Im having a problem with the test build freezing on initializing Physics. any ideas? could you upload an .fpm?

mk83 Productions



PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 25th Feb 2014 00:17 Edited at: 25th Feb 2014 00:27
MK83 wrote: "Im having a problem with the test build freezing on initializing Physics. any ideas? could you upload an .fpm?"


that's a script error i'm sure, if you alt-tab away there should be an error message giving u some idea of what is wrong

if there isnt an error its likely that you are using a valid command that isnt yet compatible with FPSC-R (but LUA recognises it thus no error... just a lock up)

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
MK83
GameGuru TGC Backer
18
Years of Service
User Offline
Joined: 10th Jun 2006
Location: Greeneville, TN USA
Posted: 25th Feb 2014 01:05
Quote: "if you alt-tab away there should be an error message giving u some idea of what is wrong"
The display cash script works, Im having trouble with cash pick up. see error attached.

mk83 Productions



PM
shakyshawn8151
11
Years of Service
User Offline
Joined: 9th Nov 2013
Location: United States
Posted: 25th Feb 2014 01:25
hmmm, I made the scripts and there in the scriptbank, also added the

currentcash = 0

charexp = 0

charlvl = 0

chardiscount = 1

to the globals like you said, but when I start a test on a blank world with just a gun (any gun) I get this

"Runtime Error 7023 - Limb does not exist at line 27680"



I tested without a gun and it starts fine.



any help guys? not really a huge coder, but I know a bit. going to do a few more tests to see if I can fix this. but like i said im not a big coder, i'm sure its just me not doing something right.

www.youtube.com/shakyshawn8151
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 25th Feb 2014 15:13
MK83 wrote: "The display cash script works, Im having trouble with cash pick up. see error attached."


i might be wrong but it looks like a problem with the playsound(e) if you comment/remove it does it work then? (i'm guessing you are using a custom entity without any sound set up for it)

otherwise it might be a varible that is set to 0 or not set at all (or simply a typing error but without seeing the code i cant tell)



shakyshawn8151 wrote: "hmmm, I made the scripts and there in the scriptbank, also added the

currentcash = 0

charexp = 0

charlvl = 0

chardiscount = 1

to the globals like you said, but when I start a test on a blank world with just a gun (any gun) I get this

"Runtime Error 7023 - Limb does not exist at line 27680"



I tested without a gun and it starts fine.



any help guys? not really a huge coder, but I know a bit. going to do a few more tests to see if I can fix this. but like i said im not a big coder, i'm sure its just me not doing something right.

"




which beta are u using? there was an error before with setting guns at startup rather than picking them up, did using guns work before you tried these scripts?

can't see anything here that would cause an issue like that

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
MK83
GameGuru TGC Backer
18
Years of Service
User Offline
Joined: 10th Jun 2006
Location: Greeneville, TN USA
Posted: 25th Feb 2014 17:24 Edited at: 25th Feb 2014 17:38
removing playsound(e) does not help. Here's the script. and thanks for your help.



-- LUA Script - precede every function and global member with lowercase name of script + '_main'

-- Player Collected cash system



-- Standard player distance math

function cash_main(e)



PlayerDX = g_Entity[e]['x'] - g_PlayerPosX;

PlayerDY = g_Entity[e]['y'] - g_PlayerPosY;

PlayerDZ = g_Entity[e]['z'] - g_PlayerPosZ;

PlayerDist = math.sqrt(math.abs(PlayerDX*PlayerDX)+math.abs(PlayerDY*PlayerDY)+math.abs(PlayerDZ*PlayerDZ));



if PlayerDist < 80 then

--Display Text

Prompt("Press E to pickup cash, cash =" .. currentcash);

-- Detect if player push the E key

if g_KeyPressE == 1 then

-- makes the cash pickup a random number between 10 and 50 and then multiplies it by 10

currentcash = currentcash + (math.random(10,50) * 10);

PlaySound0(e);

Destroy(e);

end

end

end



The only script from the first post, I can get to work is the display cash. all the rest crash.

mk83 Productions



PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 25th Feb 2014 21:18 Edited at: 25th Feb 2014 21:24
i just noticed the currentcash varible is set to 0 in globals, give it a value (anything above 0) and relaunch FPSC-R, that should work.



if not check you named the files correctly (cash.lua etc)

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 25th Feb 2014 22:01
Setting the variable to 0 shouldn't be an issue, I currently have all mine set to 0 I might upload a zip file with the scripts straight from my script bank including the global script as they work perfectly for me, I will have to do this tommorow when I'm back home however.

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home
MK83
GameGuru TGC Backer
18
Years of Service
User Offline
Joined: 10th Jun 2006
Location: Greeneville, TN USA
Posted: 27th Feb 2014 19:35
Quote: " I might upload a zip file with the scripts straight from my script bank including the global script"


Great!!

mk83 Productions



PM
madwarren
10
Years of Service
User Offline
Joined: 27th Jan 2014
Location: Texas
Posted: 27th Feb 2014 20:41
Thanks for these!
PM
MK83
GameGuru TGC Backer
18
Years of Service
User Offline
Joined: 10th Jun 2006
Location: Greeneville, TN USA
Posted: 1st Mar 2014 04:12 Edited at: 1st Mar 2014 04:15
@AuShadow, where did you go??



Quote: " I might upload a zip file with the scripts straight from my script bank including the global script"

mk83 Productions

[URL=http://imageshack.us/photo/my-images/32/e5i8.png/][IMG]h
PM
AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 1st Mar 2014 10:16
Yeah sorry been fairly busy lately and away from the computer, will try and get them up tomorrow arvo, on nightshift at the moment

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home
AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 2nd Mar 2014 08:27
ok here's the scripts as i had them working attatched to this post including global.lua just replace the standered one (dont forget to back it up but), they're zipped as .7z

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home
MK83
GameGuru TGC Backer
18
Years of Service
User Offline
Joined: 10th Jun 2006
Location: Greeneville, TN USA
Posted: 2nd Mar 2014 19:24 Edited at: 2nd Mar 2014 19:26
@AuShadow, thanks for the scripts, I put them in and tried all at once, part work and still some don't. I attached a list of what does and does not work for me.

mk83 Productions

[URL=http://imageshack.us/photo/my-images/32/e5i8
PM
AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 2nd Mar 2014 19:45
OK I will have to check these in v5 when I get a chance to(doing this from my phone), not sure when it'll be as I have a lot on for the next week. I was using 1.0045 when I made the scripts. If I get a chance to I'll let you know when I have checked them. In the meantime however can you tell me what's happening as in it crashes or it doesn't add the weapon or what the scripts are doing as this will make it easier to know what to fix. If it is crashing with an error message can you tell me what the error message is and I'll be in a much better position to try and fix it, cheers

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home
MK83
GameGuru TGC Backer
18
Years of Service
User Offline
Joined: 10th Jun 2006
Location: Greeneville, TN USA
Posted: 2nd Mar 2014 23:18
@AuShadow, Hi, they were crashing and getting hung up on initializing physics before. Now they don't crash fpscr. They just don't do anything. And yes, I'm using beta 5. At least over half work now. lol Thanks for the help by the way. And Im not in any hu
PM
AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 3rd Mar 2014 08:19
I Just tested all on my computer the exact scripts i put in the zipped folder on v5, and all worked, im afraid without knowing the error codes(when FPSCR freezes on loading use alt TAB to see the error pop up) then i'm stuck as to how to help, has anyone else tried the scripts,



note i will remove the scripts at the top of this page and put the zip folder there instead

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home
MK83
GameGuru TGC Backer
18
Years of Service
User Offline
Joined: 10th Jun 2006
Location: Greeneville, TN USA
Posted: 3rd Mar 2014 17:54 Edited at: 3rd Mar 2014 19:50
@AuShadow, hi, Solved it. I was not putting the items on a table. just the ground. they MUST be placed on a table!!!!

mk83 Productions

[URL=http://imageshack.us/photo/my-images/32/e5i8.png/][IMG]http://imageshack.us/scaled/thum
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 3rd Mar 2014 23:18
really? lol that's weird

works fine on the ground for me so not sure what's happening with your version but at least you have a working script to use for testing.. hopefully the next update will fix that bug for u

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 4th Mar 2014 07:28
Ahh I believe the problem then is the distance check must be too close then if you increase the distance check it should then work on the ground

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home

Login to post a reply

Server time is: 2024-12-22 01:07:02
Your offset time is: 2024-12-22 01:07:02