hotbox properties

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

hotbox properties

Postby Loll » Fri May 22, 2009 3:51 pm

Is there anyway to disable a hotbox using code

its usually possible to use the checkboxes but the variable list gets longer. If it was possible to set/read variables of higher than value 0/1 it would be great.

I'm trying to disable a box after having dragged an object on it once

Is it possible to use arrays I tried with no success. My programing knowledge is quite small and largely based some twenty year old basic lessons. But one of the problems I forsee is having to cope with several hundred variables.

thanks

Loll
Loll
Member
 
Posts: 41
Joined: Tue Jun 10, 2003 1:17 pm

Re: hotbox properties

Postby reneuend » Fri May 22, 2009 4:42 pm

Loll wrote:Is there anyway to disable a hotbox using code


Yes: Hotspot(1).Enabled = False 'be sure to replace 1 with the index of your hotspot

Loll wrote:its usually possible to use the checkboxes but the variable list gets longer. If it was possible to set/read variables of higher than value 0/1 it would be great.


Yes: Using advanced tab, you can change the variable's value to anything you want. If you want to advance the value each time the code is reached, you can increment the variable: myvar = myvar + 1

Loll wrote:I'm trying to disable a box after having dragged an object on it once


Do you still want the object to be visible?
I assume you mean dragging an inventory item to a hotspot. If so, then go to the advanced tab for this event and add the following:

Code: Select all
'check to see if hotspot is already disabled
'if not, then disable it
if Hotspot(1).Enabled = True then
  Hotspot(1).Enabled = False
end if


Loll wrote:Is it possible to use arrays I tried with no success. My programing knowledge is quite small and largely based some twenty year old basic lessons. But one of the problems I forsee is having to cope with several hundred variables.


Global arrays aren't supported, but local arrays are. To get around this, I use delimited strings and parse for the correct value. It works very similar to a single dimensional array.

example:
Code: Select all
strPseudoArray = "value1;value2;value3:value4"

'use my subroutine to get the value you want
strVal3 = GetWord(3, strPseudoArray, ";")

'this returns the third value in the delimited string: value3


Put this code in your procedures:
Code: Select all
Function GetWord(index,text,delimiter)

  index = index - 1
  aJournal = Split(text, delimiter)

  If index > ubound(aJournal) then Exit Function

  GetWord = ltrim(aJournal(index))

End Function


Hope that helps! :)
---


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

Postby Loll » Sat May 23, 2009 1:28 pm

Eh Thanks a bunch,

nice new stuff to play with

cheers Loll :)
Loll
Member
 
Posts: 41
Joined: Tue Jun 10, 2003 1:17 pm


Return to Adventure Maker General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests

cron