Net's Syntax Questions

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

Net's Syntax Questions

Postby Netjera » Tue Jan 26, 2010 12:19 pm

I thought I may as well make my own syntax thread, rather than cluttering up the forum with multiple one-liners. I seem to be trying to do complex operations, and the syntax references only seem to cover simple ones. Who knows - ? Maybe this will help someone else.
A woman on a mission - a budding artist looking for a place to take root, a builder looking for the right community - I'm looking for a home.
User avatar
Netjera
Frequent Poster
 
Posts: 127
Joined: Sun Jan 24, 2010 8:48 am
Location: United States

AND IF - Permitted? Syntax?

Postby Netjera » Tue Jan 26, 2010 12:22 pm

I keep getting a syntax error for this statement, but I can't figure out why. Is the use of multiple AND ... IF statements permitted? If so, what am I missing in the syntax? Do I need parenthesis somewhere?

Thanks!

Code: Select all
If PlayerOn = True AND If PlayerLeft = HotspotLeft AND If Playertop = HotspotTop then Hotspot(2).enabled = FALSE
A woman on a mission - a budding artist looking for a place to take root, a builder looking for the right community - I'm looking for a home.
User avatar
Netjera
Frequent Poster
 
Posts: 127
Joined: Sun Jan 24, 2010 8:48 am
Location: United States

Re: AND IF - Permitted? Syntax?

Postby reneuend » Tue Jan 26, 2010 12:42 pm

Netjera wrote:
Code: Select all
If PlayerOn = True AND If PlayerLeft = HotspotLeft AND If Playertop = HotspotTop then Hotspot(2).enabled = FALSE


Too many IFs! :wink:

Solution
Code: Select all
If PlayerOn = TRUE AND PlayerLeft = HotspotLeft AND Playertop = HotspotTop Then
    Hotspot(2).Enabled = FALSE
End If
---


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

Re: AND IF - Permitted? Syntax?

Postby Netjera » Tue Jan 26, 2010 2:11 pm

reneuend wrote:
Netjera wrote:
Code: Select all
If PlayerOn = True AND If PlayerLeft = HotspotLeft AND If Playertop = HotspotTop then Hotspot(2).enabled = FALSE


Too many IFs! :wink:

Solution
Code: Select all
If PlayerOn = TRUE AND PlayerLeft = HotspotLeft AND Playertop = HotspotTop Then
    Hotspot(2).Enabled = FALSE
End If


OH! Well, that's easy! I wish they'd put some of these things in a reference somewhere. I didn't know I could use just one If, I thought I needed one for every condition. >.<

Thanks!
A woman on a mission - a budding artist looking for a place to take root, a builder looking for the right community - I'm looking for a home.
User avatar
Netjera
Frequent Poster
 
Posts: 127
Joined: Sun Jan 24, 2010 8:48 am
Location: United States

Postby Netjera » Tue Jan 26, 2010 2:18 pm

Here's another one.. lol. I'm getting a "Type Mismatch" here, and I expect it's because I'm trying to manipulate an ActiveX component (3rd Person plugin, player object) and I'm not understanding something.

Code: Select all
PlayerOn = Component("ThirdPersonV10").Visible


What I'm trying to do, is determine if the Player is visible, since for some reason, the 3rd person plugin makes the player invisible on the frame, but visible when the game begins.

I also have these lines:
Code: Select all
PlayerLeft = Component("ThirdPersonV10").Left
PlayerTop = Component("ThirdPersonV10").Top


And they give the error as well. Here, I'm trying to determine where the player is located.

Basically, I'm attempting to do some simple collision checking. Where's the player located? Where is the hotspot located? (I'm using the plugin that moves the hotspot around (and all I can say is THANK YOU Lyberdoggy!) Basically, stuff needs to drop on the player, and then disappear when it hits him.
A woman on a mission - a budding artist looking for a place to take root, a builder looking for the right community - I'm looking for a home.
User avatar
Netjera
Frequent Poster
 
Posts: 127
Joined: Sun Jan 24, 2010 8:48 am
Location: United States

Postby reneuend » Tue Jan 26, 2010 4:24 pm

The only way what your doing will work is if the properties of those objects return a value. Also, your variable must be able to handle the variable type that is being returned. So, your variable should be a variant.

try sending the value of the property to output using msgbox:

msgbox Component("ThirdPersonV10").Visible
msgbox Component("ThirdPersonV10").Top
msgbox Component("ThirdPersonV10").Top

and see what it returns!

Sorry, I haven't used the 3rd person plugin so I don't know enough about it.
---


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

Postby mercedes » Tue Jan 26, 2010 4:28 pm

HI there..Welcome to the forums..:)


Basically, stuff needs to drop on the player, and then disappear when it hits him


If u want something to hit him then him dissappear when he gets hit..I would use the pictures that come with the plugin..

If u look in the External Folder of your Project's Properties..You're going to see many images that represent the [human or robot]..

I would use one of them in a hotspot [without plugin enabled] when something hits him...simply make that hotspot invisible:)

I hope that helps..There may be another way..that someone else knows about...this is the way I would do it..I'm not sure you need the plugin for what u are trying to do..You may only need the pictures..?

Just a thought..:)
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Netjera » Tue Jan 26, 2010 5:38 pm

Hi!

Thank you both for the replies!

@Mercedes: I'm not sure I understand what you mean. There's a hotspot and there's a player. The hotspot has a picture of a piece of furniture or an anvil in it. It moves downward. If the player is under it, and the pictures collide, then the anvil needs to disappear, and the player needs to take some damage. Or, alternately, if it were a coin or something, then it would need to be collected.

I need the 3rd person plugin because the player has to be able to move back and forth across the screen to catch stuff. I don't know of any other way to make him move?
A woman on a mission - a budding artist looking for a place to take root, a builder looking for the right community - I'm looking for a home.
User avatar
Netjera
Frequent Poster
 
Posts: 127
Joined: Sun Jan 24, 2010 8:48 am
Location: United States

Postby mercedes » Tue Jan 26, 2010 5:46 pm

HI there..:)

I need the 3rd person plugin because the player has to be able to move back and forth across the screen to catch stuff. I don't know of any other way to make him move?


I guess it depends on whether or not, u are moving him normally--[with clicking] If u are moving him normally..Then u make hotspots on the ground, and in those hotspots u use coordinates..the sprite then moves to it..once the player clicks them.

However if u are using hotspots and u want the sprite to take action and move without the user clicking any hotspots...then i would suggest only using the pictures and using the other plugin--xtreme- to move the sprite as a normal hotspot with a picture of a sprite in it..


Does that make better sense..? As far as i know the sprite can only be moved with the user clicking in places to move him too..
There may be a way with scripting..but I don't know of it..Not sure if anyone here has done that either..?..Could be wrong..:)
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Netjera » Tue Jan 26, 2010 6:06 pm

mercedes wrote:HI there..:)
I guess it depends on whether or not, u are moving him normally--[with clicking] If u are moving him normally..Then u make hotspots on the ground, and in those hotspots u use coordinates..the sprite then moves to it..once the player clicks them.

However if u are using hotspots and u want the sprite to take action and move without the user clicking any hotspots...then i would suggest only using the pictures and using the other plugin--xtreme- to move the sprite as a normal hotspot with a picture of a sprite in it..


Does that make better sense..? As far as i know the sprite can only be moved with the user clicking in places to move him too..
There may be a way with scripting..but I don't know of it..Not sure if anyone here has done that either..?..Could be wrong..:)


At present the player moves back and forth via clicks, but I have it set so that he doesn't have to go all the way to the location before changing direction. (That's an awesome feature!) If I used keyboard controls, think of using the left and right arrow to move back and forth under stuff. Sort of like an old-fashioned space invaders game.

I already am using Lyberodoggy's (sp?) plugin to move the hotspots that represent the items "falling". They work great. What I want them to do is to be disabled when the player "catches" them. So I've been trying to check to see when they occupy the same position. Using "GetMouseClick" doesn't work, since the player isn't going to a spot, he's moving back and forth across the screen.
A woman on a mission - a budding artist looking for a place to take root, a builder looking for the right community - I'm looking for a home.
User avatar
Netjera
Frequent Poster
 
Posts: 127
Joined: Sun Jan 24, 2010 8:48 am
Location: United States

Postby mercedes » Tue Jan 26, 2010 8:08 pm

I already am using Lyberodoggy's (sp?) plugin to move the hotspots that represent the items "falling". They work great. What I want them to do is to be disabled when the player "catches" them. So I've been trying to check to see when they occupy the same position. Using "GetMouseClick" doesn't work, since the player isn't going to a spot, he's moving back and forth across the screen.


http://www.adventuremaker.com/phpBB2/viewtopic.php?t=2663

btw..Is this where u downloaded the 3rd person plugin..? Going down in the thread to where ShadowHunter posts..[Should be a picture along with a demo] Just curious where u dl from..

I would download Keygaurd, therefore u can manipulate the keystrokes..so that u can use arrow keys on the keyboard..and move the sprite that way..

At this point, i'm a bit stumped as to whether or not all of these plugins work well together..3rd person+ [Doggie's] + Keyguard..

I see now what u are trying to do..Thinking of a Space invaders game..[Things are forever dropping?]
However i'm not familiar with Doggie's plugin, so i can't say if u can work it with keyguard..so that when the arrow key takes the sprite to where it's going...it catches the item.

Assuming i'm on the right track..

Can u not simply just disable using coordinates, [picture dissappears]once the sprite crosses that area..using Keygaurd..i wonder..Probably not..?--if its the other one that drops the [bombs/pictures]

I think only Lyberodoggy can answer this one..I just don't know his plugin..so i'm out of my realm..

He should be along soon though..:D
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby reneuend » Tue Jan 26, 2010 8:41 pm

I think you can achieve what you are trying to do with just Lyberodoggy's plugin and maybe keyguard, and some coding.
---


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

Postby Lyberodoggy » Tue Jan 26, 2010 11:35 pm

Yep, I wouldn't recommend the third person plugin. Instead, you should wait for shadowhunter's keyguard 5, which will allow using every possible keystroke. Then, using procedure calls to my plugin's main routine you can create a playable movable sprite and then with some code, detect if it collides with any of the falling pieces.

Regarding a problem with 3d person's visible property, it's probably caused because you are trying to put a boolean value (visible is set to either true or false) to an integer variable.
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Netjera » Sat Jan 30, 2010 12:14 am

Hmm... I'm trying to understand how that would be different than what I'm doing. I'm guessing that procedurally, it might look the same, but under-the-hood, the code for the two plugins is very different?

Why would keyguard have anything to do with it? (I'm still trying to figure keyguard out, but I'm not using keyboard controls. I'd prefer to use mouse click controls.)

Btw - has anyone ever been on NeoPets? There's a Garage Cleaning game, that has the same sort of structure I'm thinking of. There's a player at the bottom of the screen, and you click back and forth at the bottom of the screen to make the player run back and forth. (In that game, there's someone up top throwing stuff, which there won't be in my game. But the mechanics of moving the player, and the collisions should be similar, I would think.)

Sorry about asking all these odd questions. I feel like I'm limping along here, and I expected to have a better handle on things before now. I was hoping to have enough experience/information to make a definitive decision by next Wednesday, but I really don't feel like I do yet. I need to be much farther along in the next week, so I really know if this is going to work.
A woman on a mission - a budding artist looking for a place to take root, a builder looking for the right community - I'm looking for a home.
User avatar
Netjera
Frequent Poster
 
Posts: 127
Joined: Sun Jan 24, 2010 8:48 am
Location: United States

Postby mercedes » Sat Jan 30, 2010 7:59 am

If I used keyboard controls, think of using the left and right arrow to move back and forth under stuff. Sort of like an old-fashioned space invaders game.


Sorry, that's how KG got involved..I misunderstood it..I thought u wanted to do that with the keyboard..:D

I don't know if this will help, but its helped me in the past with codes..

http://www.adventuremaker.com/help/vbscript_reference.htm

http://www.adventuremaker.com/help/vbscript_techniques.htm

Did u try..;

If GetClickPositionX < 30 and GetClickPositionY <20 Then
Hotspot(1).enabled = False
End If

Best guess...You may have to put "Action" in front of it..
I would put that in the hotspots u click to move the man around--The one that he moves to to catch the item..?
But take a look at those pages..Also, If u try a code and its not working for u...Try posting it here, sometimes it's a matter of something small..I've not tested that code..and I made up the coordinates. I assume they would the coordinates of the hotspot that disables the item-where the man steps too..?
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Netjera » Sat Jan 30, 2010 6:19 pm

mercedes wrote:
If I used keyboard controls, think of using the left and right arrow to move back and forth under stuff. Sort of like an old-fashioned space invaders game.


Sorry, that's how KG got involved..I misunderstood it..I thought u wanted to do that with the keyboard..:D


Eek, my bad. >.< I was using it as an example of the type of game. I should've been a bit clearer. Sorry!

mercedes wrote:I don't know if this will help, but its helped me in the past with codes..

http://www.adventuremaker.com/help/vbscript_reference.htm

http://www.adventuremaker.com/help/vbscript_techniques.htm


Actually, I've almost got those two pages memorized. I think my problem is application. I read the syntax they give, and then when I try to use them, where I'm using them isn't right, or there's more to it than what the example covers. lol

mercedes wrote:Did u try..;

If GetClickPositionX < 30 and GetClickPositionY <20 Then
Hotspot(1).enabled = False
End If


No, I'm pretty sure I haven't tried that. But I will. :)

mercedes wrote:Best guess...You may have to put "Action" in front of it..
I would put that in the hotspots u click to move the man around--The one that he moves to to catch the item..?


Right now, I'm using the 3rd party plugin to move the player. I'm not sure if I can add that to the plugin script, or if I'd have to add it elsewhere. I might have to do what Lybero suggested and use his movement routines to move the player. I've been off my game the last couple of days, so I haven't had the chance to try anything yet. I'll let y'all know what happened after I do a little work.

Thanks again for all the patience!
A woman on a mission - a budding artist looking for a place to take root, a builder looking for the right community - I'm looking for a home.
User avatar
Netjera
Frequent Poster
 
Posts: 127
Joined: Sun Jan 24, 2010 8:48 am
Location: United States

Postby Netjera » Sun Jan 31, 2010 10:10 pm

Okay, I took out the 3rd person plugin. I made the following hotspots:

Hotspot 1: Sprite picture
Hotspot 2: Walk path

I set Hotspot 2 to use the Mobility plugin. When you click it, it moves HOTSPOT 1, which is similar to how the 3rd person plugin works. However, I can't figure out how to get it to move to JUST where I click, and no farther. If I X Destination to some number, it moves to that number, stops, and further clicking won't allow it to move again. If I set X Destination the length of the screen, to 640, then it moves all the way across and gets stuck there.

How do I get it to move when I click again? So it moves on first click, stops, and then when I click again, it moves again. In most cases, this might be in either direction, too.

Thanks in advance!
A woman on a mission - a budding artist looking for a place to take root, a builder looking for the right community - I'm looking for a home.
User avatar
Netjera
Frequent Poster
 
Posts: 127
Joined: Sun Jan 24, 2010 8:48 am
Location: United States

Postby mercedes » Mon Feb 01, 2010 12:14 am

How do I get it to move when I click again? So it moves on first click, stops, and then when I click again, it moves again. In most cases, this might be in either direction, too.


Hi there...Are u wanting to click the same hotspot over again..to move him..?

If so..you may have to set coordinates with variables..using an IF statement..Also make it so you have 3 hotspots maybe..?
One for the sprite
One to move the sprite
One for to set the area the sprite can move in..

So far..I've worked out to move him all the way to the right..using only one hotspot to click...
I'm working on that right now..I've taken a code [Juhu's]..and am manipulating it to fit here..But it needs help..and I"m not sure if that's what u want..[using only one hotspot-to move sprite]..Let me know..and I'll keep at it..:D

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

Postby Netjera » Mon Feb 01, 2010 1:18 am

You're wonderful! :)

What I did was make a hotspot that's the entire length of the window. (That's how they have you do it for the 3rd person plugin, so I assumed it would work here.) I just want to be able to click somewhere in the hotspot and have him move to where I've clicked. Click somewhere else in the hotspot, and have him move to where I click. Just like it works with the 3rd person plugin.
A woman on a mission - a budding artist looking for a place to take root, a builder looking for the right community - I'm looking for a home.
User avatar
Netjera
Frequent Poster
 
Posts: 127
Joined: Sun Jan 24, 2010 8:48 am
Location: United States

Postby mercedes » Mon Feb 01, 2010 10:15 pm

Ok..I"ve just re-read your post..You want to click the same hs and have him move to a different place..ok..yes that code wasn't what u wanted..I'm so distracted..I'll get on it asap..!~

Edit** Sorry it took me so long..today was crazy..

If it's just a matter of clicking the hotspot and having him move.. just use the move code..? Did u already try that..and it didn't' suit..?

Hotspot(3).move X*15,Y*15,W*15,H*15--example

setting coordinates properly of course..if u want to click it more than once..then use a variable counter..with an If statement..Or a select case..might work..better.

But u could try this;

Code: Select all
MyVariable = MyVariable - 1

If MyVariable = -1 Then
 Hotspot(3).move 120*15,45*15
End If


If MyVariable = -2 Then
Hotspot(3).move 25*15,35*15
End If



You could also do it like this...;

Code: Select all
MyVariable = MyVariable - 1

If MyVariable = -1 Then Hotspot(3).move 120*15,45*15

If MyVariable = -2 Then Hotspot(3).move 25*15,35*15


I don't think u want height and width..for that will mess with the sprite..lol..
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby juhuwoorps » Mon Feb 01, 2010 11:22 pm

I not sure what you searching for.
Is it something like this:
http://www.wuttiggames.com/downloads/slidertest.exe

click left or right besides the hotspot
juhuwoorps
Code Master
 
Posts: 622
Joined: Tue Jul 08, 2008 3:13 pm

Postby Netjera » Tue Feb 02, 2010 3:54 pm

juhuwoorps wrote:I not sure what you searching for.
Is it something like this:
http://www.wuttiggames.com/downloads/slidertest.exe

click left or right besides the hotspot


Yes! That's exactly how I want it to work. Although I'd want to center the sprite instead of having the left corner on the click location.

I was using a combination of Mercedes code, and the hotspot move plugin lyberodoggy put together, but I kept having disconnects. I was thinking that I needed to somehow make the hotspot on-the-fly. As in - click someplace and generate a hotspot at that point, move to it, then delete it. But I couldn't find anything that told me how to make the hotspot anywhere.

I'm really new to VBScript, and I haven't done very much programming, so I'm finding it hard to unravel the code examples people keep posting. It takes me a bit of time, and for that, I'm sorry.

Is there a way I can look at the code for this sample somehow?
A woman on a mission - a budding artist looking for a place to take root, a builder looking for the right community - I'm looking for a home.
User avatar
Netjera
Frequent Poster
 
Posts: 127
Joined: Sun Jan 24, 2010 8:48 am
Location: United States

Postby Netjera » Tue Feb 02, 2010 4:39 pm

Do you think something like this would work?


Code: Select all
set MyHotspot = CreateObject("AM.Hotspot")


It says in the Language Reference:

Other Functions

Function: CreateObject
Description: Creates an object of a specified type


And when I looked it up in the VBScript Reference it says,

CreateObject Function

Creates and returns a reference to an Automation object.

Code: Select all
CreateObject(servername.typename [, location])


Arguments:

servername

Required. The name of the application providing the object.

typename

Required. The type or class of the object to create.

location

Optional. The name of the network server where the object is to be created.

Remarks

Automation servers provide at least one type of object. For example, a word-processing application may provide an application object, a document object, and a toolbar object.

To create an Automation object, assign the object returned by CreateObject to an object variable:

Code: Select all
Dim ExcelSheet
Set ExcelSheet = CreateObject("Excel.Sheet")


If I understand this correctly, "Excel" is the name of the application creating the object, which in this case would be AdventureMaker, yes?
A woman on a mission - a budding artist looking for a place to take root, a builder looking for the right community - I'm looking for a home.
User avatar
Netjera
Frequent Poster
 
Posts: 127
Joined: Sun Jan 24, 2010 8:48 am
Location: United States

Postby Netjera » Thu Feb 04, 2010 5:24 pm

Maybe posting all my questions to one thread wasn't such a good idea, lol. I now have three questions backed up, and have another one. >.< *laughs*

Does anybody know if there's a way to change the order that hotspots appear when you stack them? In the preview, there's options for "Move to Bottom", "Move to Top", etc, but they don't appear to work, as the hotspot on top is always numbered last, and I can't seem to reorder them.

I'm trying to do two things:

1) In the frame window: Stack a bunch of hotspots in numerical order, with 1 on top and 52 on the bottom. Unfortunately, reordering doesn't seem to work. I still wind up with 52 on top, and 1 on the bottom.

2) During gameplay: "Deal" the hotspots (I'm using Lybero's mobility plugin - and it works great!), in a particular order. However, when I move the hotspots one on top of the other, the first one dealt is always the top, and the remainder of the cards deal UNDERNEATH it, instead of on top like a normal deal.

I'm basically making 52 stacked hotspots like a stack of cards. They're on the bottom of the screen. I'd like hotspot 1 on top, and hotspot 52 on the bottom. Then, during gameplay, the cards will deal in a normal Klondike solitaire pattern. (One in the first pile, two in the second, three in the third.)

Card position works (the cards are laying out in columns just fine). But when they're dealt, they are stacking underneath each other, instead of on top. If you need to see an example, let me know, and I'll show you what I mean, or tell you how to replicate it.

I'm trying to figure out how to make the cards appear to be stacking one on top of the other, during gameplay.
A woman on a mission - a budding artist looking for a place to take root, a builder looking for the right community - I'm looking for a home.
User avatar
Netjera
Frequent Poster
 
Posts: 127
Joined: Sun Jan 24, 2010 8:48 am
Location: United States

Postby reneuend » Thu Feb 04, 2010 5:54 pm

I've always managed this slightly differently. Instead of moving the hotspot, I just move the image from one hotspot to another. It's a bit more difficult to manage the code, but this is how I've always coded layers of hotspots.
---


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

Postby Netjera » Thu Feb 04, 2010 7:18 pm

reneuend wrote:I've always managed this slightly differently. Instead of moving the hotspot, I just move the image from one hotspot to another. It's a bit more difficult to manage the code, but this is how I've always coded layers of hotspots.


Hrm... I wouldn't even know where to begin with something like that. I did try something similar, by using extra frames and loading the pictures into the right hotspots. But using multiple hotspots has some advantages I'd like to retain.

For instance, if I have 52 hotspots in a stack, it actually looks like a stack. Also, I can then load exactly one card into one hotspot, randomly, and I have a fully randomized deck. (Of course, this still doesn't address my original problem of preventing a card from showing up more than once, which I still haven't solved.)

The only problem is that they're still stacking in reverse order, which doesn't make any sense. I expect they'd do that, whether I moved them or used a static hotspot anyhow, because of how hotspots are numbered.

I need some way to change the layers the hotspost are on.
A woman on a mission - a budding artist looking for a place to take root, a builder looking for the right community - I'm looking for a home.
User avatar
Netjera
Frequent Poster
 
Posts: 127
Joined: Sun Jan 24, 2010 8:48 am
Location: United States

Postby reneuend » Thu Feb 04, 2010 8:50 pm

What you need is an example! :-)

Unless someone is else can show you how to manipulate the z order of the hotspots...and I'm sure it can be done, I'll show you an example of how I would do it....lets give it 24 hours for someone else's reply....Lyberodoggy? You listening? :wink:
---


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

Postby Netjera » Thu Feb 04, 2010 10:02 pm

reneuend wrote:What you need is an example! :-)

Unless someone is else can show you how to manipulate the z order of the hotspots...and I'm sure it can be done, I'll show you an example of how I would do it....lets give it 24 hours for someone else's reply....Lyberodoggy? You listening? :wink:


Well, if you look above, juhuwoorps gave me a great example of how to get the player moving properly in my game. However, I can't access the code to see how he did it. But his version works exactly how I want my player to move.

My problem is, I'm bouncing back and forth between two games, at the moment, in order to see if AM is going to be viable for either/both of them. I swear I'll stop bouncing around, once I've made the decision, lol.

I have two games going: One where there's a player, in 3rd person view, manipulated back and forth across the screen, collecting stuff that's falling from above.

The second is sort of a solitaire game, and that's the one I'm struggling with today. I've got the deal working, but cards are dealing underneath each other instead of on top. I'm also still trying to get one card value to load into each hotspot, with no duplications, randomly. I don't want to end up with two 2 of Clubs in the same deck.

Thanks for trying to keep up with me!
A woman on a mission - a budding artist looking for a place to take root, a builder looking for the right community - I'm looking for a home.
User avatar
Netjera
Frequent Poster
 
Posts: 127
Joined: Sun Jan 24, 2010 8:48 am
Location: United States

Postby Lyberodoggy » Thu Feb 04, 2010 11:16 pm

currently you can't manipulate a Hotspot like a normal VbImagebox. But even if you could, VB6 doesn't let you set the zorder property during runtime. So the only way to bypass the problem with the Z order is to do as reneuend recommended, moving the images to a hotspot with a lesser index value. This would work fine if VB6 didn't assign an encrypted filename to the .picture property of the imagebox object. So you need to modify the picture loading method like this:
Go to vbs procedures, type
Code: Select all
Sub loadhspicture(index,filename)
loadapicture Hotspot(index), GetEncryptedFileName(filename)
hotspot(index).tag=filename
end sub

in the hotspot's advanced:
Code: Select all
i=GetHotspotNumber
If i>1 Then
   picture=Hotspot(i-1).tag
   LoadAPicture Hotspot(i-1), getencryptedfilename(Hotspot(i).tag)
   LoadAPicture Hotspot(i), getencryptedfilename(picture)
End If


It should work if you use the sub we made to load the pictures to the hotspots. The syntax should be
loadhspicture somenumberhere, Getpath(pathindex)+"filename.extention"
I think that gm should make this by default (I mean setting the hotspot's tag to the filename of the picture loaded to it).

With this technique you can also use standard algorithms like the bubblesort algorithm.

As for your other question, the CreateObject(servername.typename [, location]) syntax is used to create an automation object from a registered automation server, aka OCX and DLL files. The CreateObject should work with AM's hotspots, as long as you know the real servername of AM, which isn't "AM" of course (only gm and shadow know more about that).


Regarding to your randomization issues: Here's a little script I made not that long ago, which makes a joker draw, preventing double occurence. Hope it helps

Code: Select all
dim selected(5)
dim counter
dim numbers(45)
for i=0 to 44
   numbers(i)=i+1
next
do while counter<5
   sel=false
   randomize
   rand=int(rnd*45)+1
   for i=0 to 4
      if selected(i)=rand then
         sel=true
      end if
   next
   if sel=false then
      selected(counter)=rand
      'numbers(rand-1)=0
      counter=counter+1
   end if
loop
for i=0 to 44
   if i mod 5 = 0 then
      text=text+vbcrlf
   end if
   text=text+cstr(numbers(i))+vbtab
next
text=text+vbcrlf+"Selected numbers: "
for i=0 to 4
   text=text+cstr(selected(i))+", "
next
msgbox text,vbokonly,"Joker"
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Netjera » Fri Feb 05, 2010 1:10 am

Lyberodoggy wrote:currently you can't manipulate a Hotspot like a normal VbImagebox. But even if you could, VB6 doesn't let you set the zorder property during runtime. So the only way to bypass the problem with the Z order is to do as reneuend recommended, moving the images to a hotspot with a lesser index value.


Okay, let me say thank you for the response. Then let me also say - WOW! That's a LOT of information! Which it's probably going to take me hours to pick through.

So, I'll start with this paragraph right here, if you don't miind?

1) Zorder would be the depth or the "layer" the object is on?
2) So I'd have to place the hotspots manually, but in what order? I need to make sure that when the deal happens, it looks like the cards are laying on top of each other. Would that mean I'd need to put the lower numbered hotspots on the bottom or top? Also, the problem I'm having is that when placing the hotspots, no matter what I do, they ALWAYS number with the higher numbers on the top, so I CAN'T reorder them to put the lower numbers on top so they load first. This is where I'm stuck.
A woman on a mission - a budding artist looking for a place to take root, a builder looking for the right community - I'm looking for a home.
User avatar
Netjera
Frequent Poster
 
Posts: 127
Joined: Sun Jan 24, 2010 8:48 am
Location: United States

Next

Return to Adventure Maker General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests

cron