Scripts / V1.0071 HURTPLAYER script command

Author
Message
Yurif74
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 1st Aug 2013
Location: italy
Posted: 11th Jun 2014 14:36
does anyone know how to use it?

from the changelog:

Scripting

HURTPLAYER command added



Amiga 4000 CSMK1 68060@50mhz, 200mb fast, CV64 4mb, Scandoubler, MiniThylacine 4 port USB, FastAta MKVI 4000, DVD+RW, HDD 120gb pio 5.
almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 11th Jun 2014 14:41
yeah sort of, smallg told me to put in the following into a script

the 15 is the damage dealt per second for me and can be changed.
might depend on the script, pm me if you want to look at it all its 1 of my competition scripts that smallg made for me im not putting it in the forums though yet anyways.

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
AuShadow
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 11th Jun 2014 14:45
@hood could you possibly share that script with me? And don't worry I'm out of the comp

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
almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 11th Jun 2014 14:55
I sent it to you m8 lol.. in pm bit compact though maybe copy paste into notepad+ or something to read it right m8

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
Yurif74
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 1st Aug 2013
Location: italy
Posted: 11th Jun 2014 15:01
then.. i added this script to a barrel:



when i get closer i get hurted by 100 units per second. script work but if i place more than 18 toxic barrel on level, fpsc:r crash at physics message during loading WITHOUT ANY ERROR



Amiga 4000 CSMK1 68060@50mhz, 200mb fast, CV64 4mb, Scandoubler, MiniThylacine 4 port USB, FastAta MKVI 4000, DVD+RW, HDD 120gb pio 5.
almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 11th Jun 2014 15:05
yes there is still abug with custom scripts at moment m8, forgot to tell you that sorry 17 is the max custom scripts at any 1 time on a map it seems... so 17 barrels with hurt damage or 5 of your automatic doors and 12 barrels not to great but it has been reported so hopefully we get it fixed sooner than later... glad it helped you though m8 that's the same thing sort of that I have used it for

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
Yurif74
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 1st Aug 2013
Location: italy
Posted: 11th Jun 2014 15:13 Edited at: 11th Jun 2014 15:28
thanks mate, i will forgot the compo as it's absolutely useless to have max 17 custom scripts in a game. i have lot of ideas that can't fit into *ONLY* 17 custom scripts..

i hoped that this V1.0071 hotfix solved this problem... too bad



Amiga 4000 CSMK1 68060@50mhz, 200mb fast, CV64 4mb, Scandoubler, MiniThylacine 4 port USB, FastAta MKVI 4000, DVD+RW, HDD 120gb pio 5.
almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 11th Jun 2014 15:39
well apparently there is sort of a fix m8, but I have not tried it cos im not a scripter like you but if you add the following to the script at the top just above the _main (e) it might fix things?



I will also give it ago and see what happens but I don't really know what im doing lol...

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
tomjscott
User Banned
Posted: 11th Jun 2014 15:53 Edited at: 11th Jun 2014 15:54
The init function fixes the issue. I just confirmed it.





System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.007
BarZaTTacKS
10
Years of Service
User Offline
Joined: 3rd Feb 2014
Location:
Posted: 11th Jun 2014 16:08
Did that init function fix the limit? What did it fix?
PM
tomjscott
User Banned
Posted: 11th Jun 2014 16:09
Quote: "Did that init function fix the limit? What did it fix?"


It fixes the script limit issue.

System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.007
BarZaTTacKS
10
Years of Service
User Offline
Joined: 3rd Feb 2014
Location:
Posted: 11th Jun 2014 16:17
I just asked this in a different thread but what does init do differently? What is going on when adding that to a script that is not happening when you dont have it?
PM
tomjscott
User Banned
Posted: 11th Jun 2014 16:56
Quote: "I just asked this in a different thread but what does init do differently? What is going on when adding that to a script that is not happening when you dont have it?"


That part only Lee knows I think. I'm pretty sure init isn't part of Lua itself, but rather just a method by which Lee has provided for entity initialization. Why it fixes an internal bug in his code only he can say probably.

System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.007
Yurif74
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 1st Aug 2013
Location: italy
Posted: 11th Jun 2014 17:17
i confirm it, actually it fixes my scripts, even the toxic barrel one gooooooood!!!!
thank you almightyhood!!



Amiga 4000 CSMK1 68060@50mhz, 200mb fast, CV64 4mb, Scandoubler, MiniThylacine 4 port USB, FastAta MKVI 4000, DVD+RW, HDD 120gb pio 5.
tomjscott
User Banned
Posted: 11th Jun 2014 18:35
Very odd that this HurtPlayer command is a damage every second and not just subtracting the specified damage on a one shot basis. That seems like it was designed for a specific purpose and we're getting it as-is. Far better would be a single shot damage, which would allow us to code our own damage over time if necessary and use it for one shot damage like custom enemy hits.

Now I need to get busy working on a one-shot damage workaround using this. I wonder if the damage is subtracted immediately when the function is called and then a timer is set internally. If so then we could probably do something like:



Which would presumably subtract 50 damage and then immediately prevent it from firing again. Has anyone tried this?

System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.007
almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 11th Jun 2014 18:49
I tested 25 hurtplayer barrles on a map today, it killed me.. which of course is the point only I was not near the barrels...
yes yes I know check the check player distance did that was along way off from them all, seems to me there might be some kind of bug with the hurtplayer and the _init as every test I did resulted in a fail from what I could tell, either I died way to fast or I was not close enough to get hurt and still did. maybe I did something wrong im not sure but something is up with hurt player and the _init working together for me.

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
tomjscott
User Banned
Posted: 11th Jun 2014 18:53
You do need to make sure that if a script is used by multiple entities that you are uniquely associated to each entity otherwise you could have problems where all scripts are acting sort of as one. So even if you were just in range of one then you might get hurt from all of them. I'd have to see the script to know how it's being coded, but it seems like that might be your problem.

System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.007
tomjscott
User Banned
Posted: 11th Jun 2014 18:56
Hmmm. I just looked up earlier in this thread at the toxic barrel script and it doesn't seem like what I was suggesting could happen in this case. Is that the script you are using or something modified from that?

System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.007
almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 11th Jun 2014 18:57
yeah sounds about right to me the damage I was taking was killing me in about 2 seconds flat @15 damage per second x25 that's about right.. but not to worry

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
tomjscott
User Banned
Posted: 11th Jun 2014 19:14
Quote: "yeah sounds about right to me the damage I was taking was killing me in about 2 seconds flat @15 damage per second x25 that's about right.. but not to worry"


Yeah, but it shouldn't happen if you're just using that sample script from this thread. It can happen if you have a local variable defined in your entity script and are relying on that local variable to be unique per entity. Each entity would actually use the same local variable unless you define it as a table and then assign that entity's e value as an index into the table. So, if you are still getting this issue without any such local variable then there probably is another issue going on.

System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.007
almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 11th Jun 2014 19:32
im no coder so don't know what smallg has in it or what is in it what it does so not to worry it will get sorted at some point in time im sure.

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
tomjscott
User Banned
Posted: 11th Jun 2014 19:34
Quote: "im no coder so don't know what smallg has in it or what is in it what it does so not to worry it will get sorted at some point in time im sure."


No problem. I'd be happy to help if you need it. I'd have to see the full script though. But no worries. I hope you get it all worked out in time.

System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.007
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 11th Jun 2014 20:40
it's not per second, only per second in the script i gave him because it was using a timer
the HurtPlayer(e,v) does damage depending on if the code is met or not (i.e. if you put it after a distance check it'll constantly update (as fast as possible - bassed on fps i guess) while you are next to the entity

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
tomjscott
User Banned
Posted: 11th Jun 2014 20:44
Quote: "it's not per second, only per second in the script i gave him because it was using a timer"


That's good to know. From the initial responses on how it worked it sounded like people were saying the function itself works that way, not the script you implemented. I'm happy to hear it is a one-shot deal. I don't want to have to code some workaround.

System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.007
Yurif74
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 1st Aug 2013
Location: italy
Posted: 12th Jun 2014 10:48
Yes, if there is no time check, the PlayerHurt(e,v) command remove energy every time is called, so it could drain all your energy in some seconds even with little values!
this command is very useful, i done a lot of entities that hurt player, even a radioactive barrel with "radiation clicks" sound when you get closer to it (but not too close to hurt you). i tried on a zone and it work perfectly, i can create radioactive areas in my level
a command like HealPlayer(e,v) would be very useful too



Amiga 4000 CSMK1 68060@50mhz, 200mb fast, CV64 4mb, Scandoubler, MiniThylacine 4 port USB, FastAta MKVI 4000, DVD+RW, HDD 120gb pio 5.
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 12th Jun 2014 11:15
i would assume using a negative value would "heal" the player

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11

Login to post a reply

Server time is: 2024-04-20 05:26:49
Your offset time is: 2024-04-20 05:26:49