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.

FPSC Classic Scripts / plrtouched=1

Author
Message
A dude
14
Years of Service
User Offline
Joined: 15th Mar 2010
Location: The Solar System
Posted: 6th Aug 2012 16:55
Is there a command like "plrtouched=X" or is there an equivalent? plrdistwithin isn't good enough because I want the player to be exactly touching the object for an entity to spawn.

Thanks
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 6th Aug 2012 17:22
Unless I missed an update in the source, there is no command as such yet. The only one is the "plrdistwithin" and you would need to set a low value. It works for some entities, while others you are practically standing on them and no reaction happens. For example, we have landmines and use the "plrdistwithin=30". The player is standing right on the entity before the script continues. We have encountered a few entities where a low "distance within" still does not work (it could be the collision sphere is causing this interference) and either adjust the value or find an entity that allows us to "touch" the entity before the script continues.


Twitter: @NFoxMedia
Marc Steene
FPSC Master
18
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 6th Aug 2012 18:20
To debug this kind of stuff like player distance to find the right distances, add the follow line of script to the main script of the entity:

:always:debugvar=$DIS

BlackFox, I know you use an older version of the engine (1.18) which I don't think has the debugvar feature, maybe it would be something to add to help for debugging purposes (if you don't have a similar command already). You can also use it with the other internal variables like entity positions, camera positions, entity health etc.


Official LightStorm Engine BETA Tester
/?m=forum_view&t=190541&b=21
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 6th Aug 2012 18:24
Quote: "BlackFox, I know you use an older version of the engine (1.18) which I don't think has the debugvar feature, maybe it would be something to add to help for debugging purposes (if you don't have a similar command already). You can also use it with the other internal variables like entity positions, camera positions, entity health etc."


We're using v1.17, and already have our own debug commands coded in our source for things like this. You are correct, it is very useful and works great with the variable system coded in.


Twitter: @NFoxMedia
A dude
14
Years of Service
User Offline
Joined: 15th Mar 2010
Location: The Solar System
Posted: 6th Aug 2012 23:29
How does the debugvar command work?
A dude
14
Years of Service
User Offline
Joined: 15th Mar 2010
Location: The Solar System
Posted: 8th Aug 2012 16:10 Edited at: 8th Aug 2012 17:11
What variable do I need to type?
EDIT: I really need some help here because plrdiswithin doesn't work. Picture attached showing the problem.

Attachments

Login to view attachments
Marc Steene
FPSC Master
18
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 8th Aug 2012 22:20
What variable are you trying to debug? For user made variables you just need to type the name in, i.e. debugvar=slots, for internal variables, add a $ i.e. debugvar=$DIS.

In a script it would be:

:always:debugvar=$DIS


Official LightStorm Engine BETA Tester
/?m=forum_view&t=190541&b=21
A dude
14
Years of Service
User Offline
Joined: 15th Mar 2010
Location: The Solar System
Posted: 9th Aug 2012 01:05
I'm trying to debug the distance between the object and the player.
Marc Steene
FPSC Master
18
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 9th Aug 2012 10:47
Quote: "I'm trying to debug the distance between the object and the player."


Well, I've already written the line of code you need twice, it does help if you read the support that you're given.


Quote: "To debug this kind of stuff like player distance to find the right distances, add the follow line of script to the main script of the entity:

:always:debugvar=$DIS"


Quote: "In a script it would be:

:always:debugvar=$DIS"



Official LightStorm Engine BETA Tester
/?m=forum_view&t=190541&b=21
A dude
14
Years of Service
User Offline
Joined: 15th Mar 2010
Location: The Solar System
Posted: 9th Aug 2012 16:59 Edited at: 9th Aug 2012 17:13
Oh sorry I thought $DIS was meant X!

EDIT: It works but since the distance from the entity varies when the player goes from left to right it won't really work for me. I think they should really put plrtouching=X in the next update.

Login to post a reply

Server time is: 2024-11-23 21:19:47
Your offset time is: 2024-11-23 21:19:47