Hotspot Porblem

This forum is meant for posting anything related to Adventure Maker that doesn't fit in the other forums.Please post technical questions in the Technical Support Forum!

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

Hotspot Porblem

Postby Rocket_Ronnie » Mon Mar 03, 2008 6:16 pm

Hi everyone , Im new here and I have a question. I search in forum but I cant find anyting fit or maybe I missed it.
so, how to disable hotspot after using something from inventory? I click "manage inventory item" and then dag&drop "item" on hotspot what I want to disable after drop item on hotspot, but in "hotspot properites" (example: key in hotspot) in "action" theres no option to disable pernamently. How can I do taht? any scripts?

I dont wanna go to another frame because this part of game is related with other frames and If I use this option I must duplicate all frames of this section of game.

Maybe is another way to do something like this? Someone have any idea?
Rocket_Ronnie
Junior Member
 
Posts: 10
Joined: Fri Feb 29, 2008 12:16 am
Location: Poland

Postby Lyberodoggy » Mon Mar 03, 2008 7:24 pm

Hello and welcome to the Forums

Why to hide that hotspot? I think it wouldn't spoil anything if it stayed there...
Anyway, go to the hotspot which gives you the item.
In the advanced tab select execute VBS and enter this simple code
Code: Select all
TakenItem=1

Go to VBS Variables and create an integer variable called TakenItem
Go To manage inventory items, drag and drop the item you want in the hotspot(s) you want to disable.
Go to advanced.
Enter these lines:
Code: Select all
If TakenItem=1 Then
If HasItem("key") = "False" Then
Hotspot(Action.GetHotspotNumber).Enabled="False"
End If
End If

Remember to change "key" with "your_item"
Lastly go to VBS Procedures, copy paste this:
Code: Select all
Function HasItem(ItemName)

HasItem = "False"
For Each X in InventoryItemObject
If X.Tag = ItemName Then
HasItem = "True"
End If
Next

End Function


It worked for me so it should work in your project too...
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Rocket_Ronnie » Mon Mar 03, 2008 8:24 pm

oh sorry I forget to write HIDE and disable , this hide is most important.

I added picture which shows what result I mean :)
Original picture in frame is without padlock and then hotspot with padlock. When player drop key on this padlock then hotspot must hide and disable pernamently because when someone back to this frame must see show-case without padlock.

Like I wrote in last post I cant use function "go to another frame" because links on every frame aim at the end to this frame so then I must create copies of every frame with new links.

Sorry for my english:P I hope everything is clear now.
Attachments
mygame.jpg
mygame.jpg (120.59 KiB) Viewed 8538 times
Rocket_Ronnie
Junior Member
 
Posts: 10
Joined: Fri Feb 29, 2008 12:16 am
Location: Poland

Postby Candle » Mon Mar 03, 2008 8:29 pm

Look at this screen shot.
See the first box.
Attachments
2008-03-03_132736.jpg
2008-03-03_132736.jpg (32.18 KiB) Viewed 8534 times
Please don't PM me questions, ask here in the forums!
``````````````
Between grand theft and a legal fee, there only stands a law degree.
User avatar
Candle
Administrator
 
Posts: 3077
Joined: Sat Feb 07, 2004 2:21 am
Location: Rudy's Bar

Postby Lyberodoggy » Mon Mar 03, 2008 8:41 pm

No candle, he wants to use an item on that hotspot not click it.
Sorry for my code Rocket_Ronnie, you are right, it temporarily disables the hotspot. To disable it permanently fix this:
Code: Select all
If TakenItem=1 Then
If HasItem("key") = "False" Then
Hotspot(Action.GetHotspotNumber).Enabled="False"
'add this line to the code:
Padlock_unlocked=1
End If
End If

Create an integer variable called Padlock_unlocked, go to the padlock hotspot and under variables check this hotspot must be enabled only if the following variables are 0. Enter the Padlock_unlocked variable there and done.
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Rocket_Ronnie » Mon Mar 03, 2008 8:47 pm

I need to DROP an item and then hide and disable, this box show action when the hotspot is clicked.

When I click "Manage inventory" then drop "key" on hotspot with padlock appear "hotspot properites" (key in hotspot) in "action" theres no option to disable pernamently.
Rocket_Ronnie
Junior Member
 
Posts: 10
Joined: Fri Feb 29, 2008 12:16 am
Location: Poland

Postby Rocket_Ronnie » Mon Mar 03, 2008 8:52 pm

Oh its ok Lyberodoggy, It was my foult coz I forgot to write HIDE :) Ok so I try Your new advice now... :)
Rocket_Ronnie
Junior Member
 
Posts: 10
Joined: Fri Feb 29, 2008 12:16 am
Location: Poland

Postby Rocket_Ronnie » Mon Mar 03, 2008 9:38 pm

Something is wrong, hotspot won't hide :/ Code everywhere is like You wrote me, I checked it. hmm

Global procedure

Code: Select all
Function HasItem(ItemName)
HasItem = "False"
For Each X in InventoryItemObject
If X.Tag = ItemName Then
HasItem = "True"
End If
Next

End Function


hotspot with "key"

Code: Select all
TakenItem=1


VBS on item drag&drop

Code: Select all
If TakenItem=1 Then
If HasItem("key") = "False" Then
Hotspot(Action.GetHotspotNumber).Enabled="False"
Padlock_unlocked=1
End If
End If


Integer variables: TakenItem & Padlock_unlocked

on hotspot with padlock properites: variables/the hotspot must be enable
d only if "Padlock_unlocked" value 0
Where is bug?
Rocket_Ronnie
Junior Member
 
Posts: 10
Joined: Fri Feb 29, 2008 12:16 am
Location: Poland

Postby Lyberodoggy » Mon Mar 03, 2008 10:01 pm

Make sure your item's internal name is spelled right. If for example it's Key and not key, then that is causing the bug.
Did you check the debug session in runtime to see if all variables are set right?
You can also use the "change variable value" under variables when drag&drop the item to set Padlock_unlocked=1


I 'm attaching a sample project, download it and see what's wrong with your project (be sure to check my projects vars, procedures and everything)
Attachments
testagain.rar
This is a sample project to solve your problem
(124.15 KiB) Downloaded 309 times
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Rocket_Ronnie » Mon Mar 03, 2008 11:17 pm

Oh thank You so much! :) Step by step I checked Your testgame and one thing I must change. I forgot about "key on hotspot" variable properties :)
now everything works! :D thx again :)
Attachments
tabel.jpg
tabel.jpg (35.05 KiB) Viewed 8506 times
Rocket_Ronnie
Junior Member
 
Posts: 10
Joined: Fri Feb 29, 2008 12:16 am
Location: Poland

Postby GM-Support » Tue Mar 04, 2008 7:03 am

Hi,

I guess this is solved now, but, just to clarify in case someone else reads this topic, what you want to do can be done without any scripting, using only the options that are under the "variables" tab.

(Please correct me if I missed something)

GM-Support
GM-Support
Forum Admin and Games Page admin
 
Posts: 2221
Joined: Thu Jun 05, 2003 7:52 pm

Postby Lyberodoggy » Tue Mar 04, 2008 6:44 pm

It would be usefull if there was an option in the Actions Tab of drag n drop item on hotspot.
It could be done without so much scripting but not without any scripting at all I think.
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Lyberodoggy » Tue Mar 04, 2008 6:49 pm

Yep, now that I see it, it can be done without any scripting at all, forgive me for not noticing that before.


I 'm so embarassed... :oops:

I 'm ataching a project in which the problem is solved without a single line of code
Attachments
testagain.rar
Fixed File, sorry again.
(125.11 KiB) Downloaded 309 times
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Rocket_Ronnie » Tue Mar 04, 2008 11:45 pm

hehe now everything is more clearly and easier :P

I dont wanna create a new topic so I ask here because this problem is related with hotspots too.

Like in the picture for ex. we hav 3 hotspots and I want to make
oneClick - display missage and
doubleClick - go to frame

or

mouse cursor on hotspot - display misage
oneClick - go to frame

Someone can help me how to make it?
Attachments
mapka.jpg
mapka.jpg (67.88 KiB) Viewed 8444 times
Rocket_Ronnie
Junior Member
 
Posts: 10
Joined: Fri Feb 29, 2008 12:16 am
Location: Poland

Postby Lyberodoggy » Wed Mar 05, 2008 12:04 pm

You can use Keyguard 3.0 plugin to show text over hotspot or you can create two hotspots instead of one, making the first showing the text, then disappearing so that the second (going to frame) is clickable
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Rocket_Ronnie » Wed Mar 05, 2008 1:57 pm

thank U again :)
Rocket_Ronnie
Junior Member
 
Posts: 10
Joined: Fri Feb 29, 2008 12:16 am
Location: Poland

Postby Lyberodoggy » Wed Mar 05, 2008 5:34 pm

I see your game is in your language... Too bad I would like to try it but I don't know polish (is that spelled right?)
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Rocket_Ronnie » Wed Mar 05, 2008 8:05 pm

Oh dont worry , Now I only train and discover programm, this is only demo ,so in polish lang. :)

In future we'll (with one friend) make full version with many options, futures and riddles in english too. :)

We'r writing script scenario,
I waiting for a good weather to take pictures suitable for story.
Etc :)

When game will be finnished then I'm surly write at forums about it and share with You and all users :)

...its shame but at the moment we even dont hav testing title lol
Action gonna happen mostly on garden terrain and forest, railroad and many other places finding on suburbs of city where we live.
Rocket_Ronnie
Junior Member
 
Posts: 10
Joined: Fri Feb 29, 2008 12:16 am
Location: Poland

Postby Lyberodoggy » Thu Mar 06, 2008 1:07 pm

Reminds me of my first steps :P

Okay, waiting for a project of you
Farewell
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens


Return to Adventure Maker General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests