Character hotspot [SOLVED]

This forum is meant for requesting technical support or reporting bugs.

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

Character hotspot [SOLVED]

Postby Morsy » Thu Mar 22, 2012 8:04 pm

Can you make a hotspot that is only enabled if the character walks near it? (I have a chair in one frame and want the character to be able to sit on it only if he is near it. Kind of weird if hes really far away and he just teleports to the chair :lol: )
And the character is the Third Person.
Last edited by Morsy on Sun Apr 15, 2012 5:29 pm, edited 1 time in total.
User avatar
Morsy
Active Member
 
Posts: 88
Joined: Wed Feb 08, 2012 11:15 pm
Location: USA

Postby Lyberodoggy » Thu Mar 22, 2012 11:13 pm

It is possible. You can use the plugin's current position coordinates

Code: Select all

Dim CurrentPositionX
Dim CurrentPositionY
CurrentPositionX = Component("ThirdPersonV2").Object.GetCurrentPositionX
CurrentPositionY = Component("ThirdPersonV2").Object.GetCurrentPositionY
if CurrentPositionX > minimumdistanceX AND CurrentPosition X < maximumdistanceX AND CurrentPositionY > minimumdistanceY AND CurrentPositionY < maximumdistanceY then
'code that activates the sitting animation
end if


Just replace the distances with actual coordinates (you can use a hotspot for visualization and then take the hotspot.top, hotspot.left, hotspot.top+hotspot.height and hotspot.left+hotspot.width properties if you like)
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Re: Character hotspot

Postby mercedes » Fri Mar 23, 2012 5:08 am

Morsy wrote:Can you make a hotspot that is only enabled if the character walks near it? (I have a chair in one frame and want the character to be able to sit on it only if he is near it. Kind of weird if hes really far away and he just teleports to the chair :lol: )
And the character is the Third Person.


What you can try too if you like;

Have the hotspot with chair disabled in the Frame's Advanced properties..
Hotspot(1).enabled = False

Then enable the chair..in the last hotspot the character uses to walk to it..So create a hotspot..next to the chair..And use this code;
Hotspot(1).enabled = True

When i made my game..3rd person...I used several little hotspots so the character could walk in a given space..only..

Instead of using big ones..where the character could walk all over the big one..I used several small ones; This way it would look like it was still on the ground at all times...and not up above the floor-Or he wouldn't look like he was in a strange position near a chair or table..He was always grounded.. so to speak..
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Re: Character hotspot

Postby Morsy » Tue Mar 27, 2012 4:36 am

mercedes wrote:
Morsy wrote:Can you make a hotspot that is only enabled if the character walks near it? (I have a chair in one frame and want the character to be able to sit on it only if he is near it. Kind of weird if hes really far away and he just teleports to the chair :lol: )
And the character is the Third Person.


What you can try too if you like;

Have the hotspot with chair disabled in the Frame's Advanced properties..
Hotspot(1).enabled = False

Then enable the chair..in the last hotspot the character uses to walk to it..So create a hotspot..next to the chair..And use this code;
Hotspot(1).enabled = True

When i made my game..3rd person...I used several little hotspots so the character could walk in a given space..only..

Instead of using big ones..where the character could walk all over the big one..I used several small ones; This way it would look like it was still on the ground at all times...and not up above the floor-Or he wouldn't look like he was in a strange position near a chair or table..He was always grounded.. so to speak..

Thanks so much!!! :mrgreen: You're really helpful :D My game is turning out great!
User avatar
Morsy
Active Member
 
Posts: 88
Joined: Wed Feb 08, 2012 11:15 pm
Location: USA

Re: Character hotspot

Postby Giuseppe » Tue Mar 27, 2012 11:49 am

mercedes wrote:
Morsy wrote:Can you make a hotspot that is only enabled if the character walks near it? (I have a chair in one frame and want the character to be able to sit on it only if he is near it. Kind of weird if hes really far away and he just teleports to the chair :lol: )
And the character is the Third Person.


What you can try too if you like;

Have the hotspot with chair disabled in the Frame's Advanced properties..
Hotspot(1).enabled = False

Then enable the chair..in the last hotspot the character uses to walk to it..So create a hotspot..next to the chair..And use this code;
Hotspot(1).enabled = True

When i made my game..3rd person...I used several little hotspots so the character could walk in a given space..only..

Instead of using big ones..where the character could walk all over the big one..I used several small ones; This way it would look like it was still on the ground at all times...and not up above the floor-Or he wouldn't look like he was in a strange position near a chair or table..He was always grounded.. so to speak..


why don't work Hotspot(1).enabled = False. I see the picture in the hotsot always.
Giuseppe
Frequent Poster
 
Posts: 147
Joined: Wed Mar 12, 2008 12:01 pm

Postby mercedes » Tue Mar 27, 2012 2:54 pm

Hotspot().enabled = False...only works to disable the hotspot..Not make it invisible..

If you want the picture to disappear..or become invisible, you can use;

Code: Select all
Action.LoadApicture Hotspot(1), ""


Keeping in mind..if the user clicks it..and there are other actions in the hotspot..they will take place.

You can use both codes..if you need too..:)
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Giuseppe » Tue Mar 27, 2012 3:24 pm

ahhhhhhhhh..ok thanks.
Giuseppe
Frequent Poster
 
Posts: 147
Joined: Wed Mar 12, 2008 12:01 pm

Postby Morsy » Wed Mar 28, 2012 11:40 pm

mercedes... Helping people one post at a time
User avatar
Morsy
Active Member
 
Posts: 88
Joined: Wed Feb 08, 2012 11:15 pm
Location: USA

Postby reneuend » Thu Mar 29, 2012 2:24 am

Yeah. I think she should be a moderator!!! :wink:
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby Morsy » Thu Mar 29, 2012 8:49 pm

reneuend wrote:Yeah. I think she should be a moderator!!! :wink:
Yup :mrgreen:
User avatar
Morsy
Active Member
 
Posts: 88
Joined: Wed Feb 08, 2012 11:15 pm
Location: USA

Postby mercedes » Fri Mar 30, 2012 8:26 am

Thanks Guys!~ :D
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests