Scripts / Which side of entity

Author
Message
TazMan
GameGuru TGC Backer
13
Years of Service
User Offline
Joined: 20th Jan 2011
Location: Worldwide Web
Posted: 14th Feb 2016 13:32
Hello I was wondering if there is any way of checking which side of an entity the player is on. I ask because I have a falling axe that drops to one side so my script check to see if the player is near but does not take into account which side.

Thanks in advance.
HP Pavilion Laptop, AMD A8-4555M APU with Radeon(tm) Graphics HD Graphics 1.6GHz, 8GB Memory, 64 Bit Operating System (Windows 10), 1 TB Hard Drive.

I've got something to say - It's better to burn out than fade away.
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 14th Feb 2016 15:46
Not idea.
As I can see this is like a trap. Any chance to force axe to face player, instead of guess where he is?

Quote: "LookAtPlayer(e)
Forces the entity to face the player."


perhaps taking at count the player/axe coordinates; IE: if axe X is closest to player X than Y or Z, so surely the axe is left or right from the player, if negative value (-4343) is at the left side, otherwise it is at the right side, or something like that. Of course idea need to be realize a bit.

3com

Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
TazMan
GameGuru TGC Backer
13
Years of Service
User Offline
Joined: 20th Jan 2011
Location: Worldwide Web
Posted: 15th Feb 2016 11:12
Thanks 3com I want the designer to be able to place it where they like and it not move. I am not sure it is as simple as X and Z position I think it might need an eqation which is why I decided to ask on the forum.

I am not even sure it can be done.
HP Pavilion Laptop, AMD A8-4555M APU with Radeon(tm) Graphics HD Graphics 1.6GHz, 8GB Memory, 64 Bit Operating System (Windows 10), 1 TB Hard Drive.

I've got something to say - It's better to burn out than fade away.
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 15th Feb 2016 16:54
Would be nice if you relize the idea a bit, perhaps via vid or img (if you can, of course); I'm not sure about getting the point right, so I've some questions about, like:

a- Does the axe wil be always place over the player (up side)?
b- Does the axe is intended to rotate accordingly, in order to match the righ side if required?

Well, I've done some model to try for recreate scene, but something say me than that's not exactly the point.

Video in Max



3com

Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 15th Feb 2016 17:28


This might help, not sure ...

Cheers.
TazMan
GameGuru TGC Backer
13
Years of Service
User Offline
Joined: 20th Jan 2011
Location: Worldwide Web
Posted: 15th Feb 2016 17:37 Edited at: 15th Feb 2016 17:38
The problem is this:


Sorry the video is not very smooth.

I only want the player to be hurt if they are on the side where the axe drops.

Now I know how to find the angle of the player within the level but I don't know how to get the angle of the axe within the level. If I could do this I think I could work out the area that is the correct side.

Is there any way to find the angle of an entity in the level?.
HP Pavilion Laptop, AMD A8-4555M APU with Radeon(tm) Graphics HD Graphics 1.6GHz, 8GB Memory, 64 Bit Operating System (Windows 10), 1 TB Hard Drive.

I've got something to say - It's better to burn out than fade away.
TazMan
GameGuru TGC Backer
13
Years of Service
User Offline
Joined: 20th Jan 2011
Location: Worldwide Web
Posted: 15th Feb 2016 17:49
Thanks cybernescence that works perfectly and I think I can work with it, all I need to do now is find a way of determining whether the axe has been turned around.
HP Pavilion Laptop, AMD A8-4555M APU with Radeon(tm) Graphics HD Graphics 1.6GHz, 8GB Memory, 64 Bit Operating System (Windows 10), 1 TB Hard Drive.

I've got something to say - It's better to burn out than fade away.
perelect
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 15th Feb 2016 17:56
You also have these for the entity angle.

g_Entity[e]['anglex'] -- x Rotation Angle
g_Entity[e]['anglez'] -- z Rotation Angle
g_Entity[e]['angley'] -- y Rotation Angle



Desktop: Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (8 CPUs), ~3.6GHz, Windows 8.1 64-bit, 16 GB Ram, NVIDIA GeForce GTX 750 Ti, Display Memory: 4018 MB. Resolution 1360x768, Passmark 3528.
Laptop: 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
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 15th Feb 2016 18:22


this will return 1 if the entity is looking at the player within the distance and angle set

i.e.
if EntityLookingAtPlayer(e,150,10) == 1 then
Prompt("you are less than 150 away and i can see you")
end
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 15th Feb 2016 19:48
Surely you've some script running axe animation, maybe something like:



3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
TazMan
GameGuru TGC Backer
13
Years of Service
User Offline
Joined: 20th Jan 2011
Location: Worldwide Web
Posted: 16th Feb 2016 09:06 Edited at: 16th Feb 2016 10:24
Thanks guys that is everything that I need. you have all been very helpfull as I new you would.

Edit:
With a slight change of cybernescence's code I managed to check to see if I was on the dangerous side of the Axe no matter what rotation it had.

HP Pavilion Laptop, AMD A8-4555M APU with Radeon(tm) Graphics HD Graphics 1.6GHz, 8GB Memory, 64 Bit Operating System (Windows 10), 1 TB Hard Drive.

I've got something to say - It's better to burn out than fade away.

Login to post a reply

Server time is: 2024-12-22 13:15:19
Your offset time is: 2024-12-22 13:15:19