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

Postby Lyberodoggy » Fri Feb 05, 2010 7:09 am

Netjera wrote: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.


Well, as you said, zorder is the depth. Think of it like a Z axis, since the 2D axes are X and Y.
So, when a Hotspot is loaded, or "created", it is automatically included in the next available position in the Hotspots() control array. So if you have 5 hotspots and create a new one, it is moved upwards and its index becomes 6.
You can't reorder them during runtime, so you have to use a technique similar to the one described in my previous post.
User avatar
Lyberodoggy
Administrator
 
Posts: 2519
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Lyberodoggy » Fri Feb 05, 2010 7:16 am

Netjera wrote: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.


Create a keyguard routine to check if the player has clicked anywhere and get the coordinates, then use the plugin's main method to go there. I will write some code when I get back from school
User avatar
Lyberodoggy
Administrator
 
Posts: 2519
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Netjera » Fri Feb 05, 2010 1:08 pm

Lyberodoggy wrote:Well, as you said, zorder is the depth. Think of it like a Z axis, since the 2D axes are X and Y.
So, when a Hotspot is loaded, or "created", it is automatically included in the next available position in the Hotspots() control array. So if you have 5 hotspots and create a new one, it is moved upwards and its index becomes 6.
You can't reorder them during runtime, so you have to use a technique similar to the one described in my previous post.


Okay, so basically, it won't matter what order the hotspots are in? Just put them in the layout, and the code will do the rest?

I originally had 28 hotspots for the solitaire layout, and then placed the pictures within them, in a certain order by activating each hotspot and making the card "backs" visible in order. This gave the illusion of a deal, but you missed the nice "card movement" that I get by actually moving the hotspot. It sounds to me like this is a similar approach, although much more complicated.

Would you guys mind explaining the benefits versus how I *was* doing it? If I'm not going to be able to make it look like the cards are moving, then I'd like to stick with the simplest method to do things that I can find. If all coding is required, I'll do it - and I certainly want to learn - but the whole point of switching from TGB to AM was to make as much of my life easier as possible, and it's beginning to look like maybe I didn't really do that.

I had 28 hotspots laid in a standard solitaire pattern. When the game began, you clicked on the "deck" hotspot, which was only a single "card", and that began a process whereby a card appeared face down in each of the slots, one at a time. I did this by literally just making each hotspot visible one at a time. Then, I had each card "flip" by randomly loading in a card picture. What is the difference between what I did, and the code you've suggested?

Sorry about being so dense, I'm going to print up the code you posted and pick through it one sentence at a time, a little later today.
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 » Fri Feb 05, 2010 1:29 pm

could you upload a sample project to work on? Currently I 'm trying to modify Mobility Xtreme to suit your needs (I 'm going to make it so that you can use variables instead of constant values for the destination of the hotspot and that will enable going to another position the second time the hotspot is moved)
User avatar
Lyberodoggy
Administrator
 
Posts: 2519
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Netjera » Fri Feb 05, 2010 7:07 pm

Lyberodoggy wrote:could you upload a sample project to work on? Currently I 'm trying to modify Mobility Xtreme to suit your needs (I 'm going to make it so that you can use variables instead of constant values for the destination of the hotspot and that will enable going to another position the second time the hotspot is moved)


Sure, how do I do that? Do I need to create an .exe, or just zip up the project folder or something?
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 » Fri Feb 05, 2010 7:13 pm

We need a project folder. If you don't wan't your project to go public on this forum you should either create another project containing the frames you have problems with or send the uploaded file link to selected debuggers or both
User avatar
Lyberodoggy
Administrator
 
Posts: 2519
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Netjera » Fri Feb 05, 2010 7:16 pm

Lyberodoggy wrote:We need a project folder. If you don't wan't your project to go public on this forum you should either create another project containing the frames you have problems with or send the uploaded file link to selected debuggers or both


It's all test projects atm, anyways. I'm basically working in pieces, before I even create a "real" project. This particular piece, was to get the animation working. Next step is to go back to the random routine and try to get the pictures loading properly.

I'll have to zip and load from the other computer. I haven't transferred the work files to this one yet. >.< But at least you'll see how I was trying to handle the animation, and why it looked funny.

Thanks a lot.
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 » Sat Feb 06, 2010 4:47 am

Okay, here it is finally. Sorry about the wait, it was a long day and included a trip to the doctor - yay! XD

Thanks for going to all the trouble to look at it.
Attachments
NewDeal.rar
Just the card deal.
(188.18 KiB) Downloaded 162 times
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 » Sat Feb 06, 2010 9:44 am

I did it (Yay)
changed most of the code. Added three variables, changed the way the hotspots where moving and added another vbscript procedure. Check them out and tell me if you are satisfied or if you need anything else :)
Here's the modified project:
Attachments
NewDealmod.zip
(200.15 KiB) Downloaded 177 times
Last edited by Lyberodoggy on Mon Feb 08, 2010 1:51 pm, edited 1 time in total.
User avatar
Lyberodoggy
Administrator
 
Posts: 2519
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Netjera » Sat Feb 06, 2010 8:00 pm

Okay, in order to make sure I'm understanding how things work, and how/why they interrelate, I've broken out all the code I could find, and I've grouped them under relevant sections, in the order (I think) they'd be called. My comments/questions are in italics.

1) Variables (Hotspot 13)
xdp : x destination point?
ydp : y destination point?
idx : index?

Since these were in the variables section of the hotspot, are they initializing when the frame starts, or not until the hotspot is clicked?

2) Frame Properties: Advanced: Execute VBScript code immediately after the frame has appeared

for i = 1 to 12 : increment a counter
Hotspot(i).move Hotspot(13).left,Hotspot(13).top : move a hotspot with index i to the location of Hotspot 13?
Next

xdp=440 : set the starting value of the x destination point
ydp=50 : set the starting value of the y destination point
idx=0 : set the starting value of the index

If the variables are being initialized in the variables window, why reinitialize them here? Also, why are we moving the hotspots to Hotspot 13? Is that a lateral (x/y move) or is the z move?

3) Hotspot Properties: When the hotspot is clicked, execute some VBScript code

idx=idx + 1 : increment the index value by one
ydp = ydp + 10 : increase the y destination point to allow for "stacking"

idx was initialized in the variables section, then set to 0 in the frame properties. Is there ever a hotspot with index 0, or is it an empty placeholder until the next section begins?

4) Hotspot Properties: Plugins: Move a hotspot when the hotspot is clicked (These parameters exist only in Hotspot 13 or in other hotspots as well?)

The hotspot index: 13 : Why 13 again? Because it's the last in the stack?
Initial x:
Initial y:
Step increase x: 10
Sept increase y: 4.5
Right limit: 640
Left limit: 0
Down limit: 480
Up limit: 100
x Destination: xdp
y destination: ydp
time modifier: 10
Execute some vbs after movement: if idx<=13 then Action.SimulateHotspotClick(13):ReplaceHS 13,idx : It looks to me as if the idx value starts at 0, and then increments up to 12 in Frame Properties. It is then compared to a certain number (Hotspot 13, again), and if it's less than that number, Hotspot 13 is clicked. (Why?) Then the indexes are swapped? I'm not sure I understand what's happening here. :(

This section answered a couple of questions I had, just by existing, lol. I wondered if you could set any of the parameters here to variables, as I knew that would make coding a lot easier. That being understood: can I set ANY of these parameters to a variable, or just certain ones? Also, will this work with other plugins?

Also, on code execute only has the one small line, so I wondered if it was possible to execute more than one line of code there. I'm guessing the ":" allows me to string together more than one thing?


5) Procedures (This procedure is only called from the plugin parameters of Hotspot 13?)

subReplaceHS (index, sindex) (Where are these parameters coming from? Were they defined elsewhere or created here?)

index = 2*index-13 (This produces a negative number or 0. I'm not sure why?)

' store the current coordinates
xp = Hotspot(index).left
yp = Hotspot(index).top

Okay, so we've picked up the coordinates of the hotspot with index "index".

'move the hotspot where the previous is
Hotspot(index).move Hotspot(sindex).left, Hotspot(sindex).top

(Where was sindex defined? I couldn't find it anywhere.)

'replace with previous
Hotspot(sindex).move xp, yp

We're moving hotspot sindex to the coordinates of hotspot index, so I'm assuming that hotspot index must be considered the "previous" hotspot. I'm not sure why we're moving to the previous one and not some other location though. I might be having trouble visualizing without a diagram. Doh

End Sub


Thank you so much for helping me! Sorry I'm such a pain about figuring stuff out. Hopefully, if I can understand what we're doing, I'll be able to figure out how to do it myself next time.
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 » Sun Feb 07, 2010 12:10 am

This is my best guess..for I can't see the game..it's a rar file :x --[inside joke--for the doggie :D)] and I thought to save him time..by answering some of the questions..I hope i'm right..:D

1---
Since these were in the variables section of the hotspot, are they initializing when the frame starts, or not until the hotspot is clicked?


If you see variables in the Variables section of the hotspot itself, under the variable tab..Or under the Advanced tab of that hotspot, It means when the hotspot is clicked..or simulated clicked..from somewhere else..

2) Frame Properties: Advanced: Execute VBScript code immediately after the frame has appeared

If the variables are being initialized in the variables window, why reinitialize them here? Also, why are we moving the hotspots to Hotspot 13? Is that a lateral (x/y move) or is the z move?[/i][/b]

The variables window; Is another way, where u create the variables, you still have to "initialize" them for them to play out. You can create any variable in the variables window..and or hotspot variable tab. In other words, you can create them either place.
If u want a variable to play out in a certain hotspot, then make them in that hotspot using variable tab..and initialize them.
If u want to create a variable for it to initialize at some point in your project, be it global procedures or frame's properties, then use the window..It's the same place, only a different way of getting to it..so to speak:) It lists all of the variables in the project. I hope that makes sense..and I hope i am getting what u are asking..

for i = 1 to 12 :

i is the variable.

Hotspot(i).move Hotspot(13).left,Hotspot(13).top : move a hotspot with index i to the location of Hotspot 13?
Next


In other words..any hotspot from 1-12 once clicked will move hotspot 13 once initiated..For "i" is equal to hotspot 1-12 -At least i think so..


3) Hotspot Properties: When the hotspot is clicked, execute some VBScript code

idx=idx + 1
ydp = ydp + 10 :


Each are being increased by 1's and 10's..be it clicks/pixels or moves..not sure


idx was initialized in the variables section, then set to 0 in the frame properties. Is there ever a hotspot with index 0, or is it an empty placeholder until the next section begins?


idx-is a variable, it was set to 0, because he didn't want it to initialize yet. 0 means-don't do anything yet... until it equals 1~ so to speak. Again the variable section--which i think u mean window?.. is only listing the variables..:)


5) Procedures (This procedure is only called from the plugin parameters of Hotspot 13?)

subReplaceHS (index, sindex) (Where are these parameters coming from? Were they defined elsewhere or created here?)
(Where was sindex defined? I couldn't find it anywhere.)


Do u see a Global Procedures link on the side..?

I believe there should be a subroutine in there called subReplaceHS [index, sindex)- What u are seeing is him "calling it" to play..as far as i can tell..:)

I hope that helps!!~ :D
Last edited by mercedes on Sun Feb 07, 2010 2:09 am, edited 1 time in total.
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Lyberodoggy » Sun Feb 07, 2010 1:46 am

Netjera wrote:1) Variables (Hotspot 13)
xdp : x destination point?
ydp : y destination point?
idx : index?
Exactly :)
Since these were in the variables section of the hotspot, are they initializing when the frame starts, or not until the hotspot is clicked?
all initialized when the frame starts because the hotspot will be self clicked 13 times.
2) Frame Properties: Advanced: Execute VBScript code immediately after the frame has appeared

for i = 1 to 12 : increment a counter
Hotspot(i).move Hotspot(13).left,Hotspot(13).top : move a hotspot with index i to the location of Hotspot 13?Arrange all the cards behind the top one.
Next

xdp=440 : set the starting value of the x destination point
ydp=50 : set the starting value of the y destination point
idx=0 : set the starting value of the index

If the variables are being initialized in the variables window, why reinitialize them here? Also, why are we moving the hotspots to Hotspot 13? Is that a lateral (x/y move) or is the z move?
the z move is simulated via swaping the hotspots. It's x, y. as for the variables, they are not initialized in the variables window, they are just Dimed
3) Hotspot Properties: When the hotspot is clicked, execute some VBScript code

idx=idx + 1 : increment the index value by one
ydp = ydp + 10 : increase the y destination point to allow for "stacking"

idx was initialized in the variables section, then set to 0 in the frame properties. Is there ever a hotspot with index 0, or is it an empty placeholder until the next section begins?
the first loop will add 1 to the idx var giving it a value of 1, hence the 0 initialization
4) Hotspot Properties: Plugins: Move a hotspot when the hotspot is clicked (These parameters exist only in Hotspot 13 or in other hotspots as well?)
Only hotspot 13 is moved. Then it is swapped with another hotspot and moved again
The hotspot index: 13 : Why 13 again? Because it's the last in the stack?
Initial x:
Initial y:
Step increase x: 10
Sept increase y: 4.5
Right limit: 640
Left limit: 0
Down limit: 480
Up limit: 100
x Destination: xdp
y destination: ydp
time modifier: 10
Execute some vbs after movement: if idx<=13 then Action.SimulateHotspotClick(13):ReplaceHS 13,idx : It looks to me as if the idx value starts at 0, and then increments up to 12 in Frame Properties. It is then compared to a certain number (Hotspot 13, again), and if it's less than that number, Hotspot 13 is clicked. (Why?) Then the indexes are swapped? I'm not sure I understand what's happening here. :(
idx increments up to 13, moving every hotspot and itslef. When the hotspot reaches the position, it swaps itself with a hotspot with a lesser zorder and it moves again, changing the coordinates and the hotspot to be replaced with, This happens again and again untill idx equals 13 which would mean that every hotspot has been moved
This section answered a couple of questions I had, just by existing, lol. I wondered if you could set any of the parameters here to variables, as I knew that would make coding a lot easier. That being understood: can I set ANY of these parameters to a variable, or just certain ones? Also, will this work with other plugins?
no. the plugins need to be programmed to get a variable input. I added variable support for both destination coordinates in the latest version of MX just to solve this problem. Maybe in the future, it will support variable input in every field
Also, on code execute only has the one small line, so I wondered if it was possible to execute more than one line of code there. I'm guessing the ":" allows me to string together more than one thing?


yep. ":" works as a command delimeter here
5) Procedures (This procedure is only called from the plugin parameters of Hotspot 13?)

subReplaceHS (index, sindex) (Where are these parameters coming from? Were they defined elsewhere or created here?)
the sub isn't called from the plugin. It is called via the code in the "execute some vbs after movement" field and calling this procedure with the syntax
ReplaceHS hs1,hs2
hs1, hs2 being integers will assign those values to the local variable parameters of the sub

index = 2*index-13 (This produces a negative number or 0. I'm not sure why?)
no, this will always give 13. It wasn't meant to be there, I just forgot to get it out while clearing the code off the experiments I did before getting the final result
' store the current coordinates
xp = Hotspot(index).left
yp = Hotspot(index).top

Okay, so we've picked up the coordinates of the hotspot with index "index".

'move the hotspot where the previous is
Hotspot(index).move Hotspot(sindex).left, Hotspot(sindex).top

(Where was sindex defined? I couldn't find it anywhere.)
input by the coder during the procedure call
'replace with previous
Hotspot(sindex).move xp, yp

We're moving hotspot sindex to the coordinates of hotspot index, so I'm assuming that hotspot index must be considered the "previous" hotspot. I'm not sure why we're moving to the previous one and not some other location though. I might be having trouble visualizing without a diagram. Doh
this code just finalizes the hotspot swaping, by moving the top "dealing" hotspot back to the stack to redeal.
End Sub


Thank you so much for helping me! Sorry I'm such a pain about figuring stuff out. Hopefully, if I can understand what we're doing, I'll be able to figure out how to do it myself next time.


I 've answered your questions inside the quote. Hope I helped
User avatar
Lyberodoggy
Administrator
 
Posts: 2519
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Netjera » Sun Feb 07, 2010 2:28 am

Okay, I think I understand what we're doing. Because the hotspots "stack" in the order they're made, we're rearranging them on the fly. Is this actually changing the order of the stack, or just an illusion based on location?

Also, why is the old version of AM and the plugin giving me an xdest error? Is that because it won't take variables in the plugin parameters tab? Or for some other reason? Is it something I can fix?

I tried to alter the code to account for 28 cards (I think I was successful) but it threw that error again since I was trying to do it in 4.5. =/
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 » Sun Feb 07, 2010 9:55 am

Just copy the latest plugin to 4.5's plugins folder. It's exactly what you thought. The older versions don't support variables
User avatar
Lyberodoggy
Administrator
 
Posts: 2519
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Netjera » Sun Feb 07, 2010 11:43 pm

Awesome awesome!

Okay... here's another question. (Went on to work on another segment meanwhile.)

I have copied this function from the AM website language reference. It appears to do exactly what I want to do, which is generate a random number between two other numbers:

function RandomValue (MIN,MAX)
randomize
RandomValue = int(rnd*(MAX-MIN+1))+MIN
End Sub

However, whenever I put it into the VBScript Global Procedures tab, and try to "Apply" or "Okay" it says:

The Scripting Engine returned the following message: Expected Function.

It IS a function. What am I doing wrong, please?
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 » Sun Feb 07, 2010 11:51 pm

hey..:)

Try End Function...instead of End Sub..
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Netjera » Sun Feb 07, 2010 11:56 pm

mercedes wrote:hey..:)

Try End Function...instead of End Sub..


Doh! >.< You're joking right?

:oops:
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 » Mon Feb 08, 2010 1:08 am

The guide is WRONG! It's not me, honest! lol

(I wish I'd thought of it, tho.) XD
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 » Mon Feb 08, 2010 1:15 am

Okay, here's another one. I think I might be using the hotspot tags wrong. I've set up this little procedure and it's giving me a "type mismatch" error at runtime.

sub setHotspotTags

Hotspot(1).tag = 1
Hotspot(2).tag = 2
Hotspot(3).tag = 3
Hotspot(4).tag = 4
Hotspot(5).tag = 5
Hotspot(6).tag = 6
Hotspot(7).tag = 7
Hotspot(8).tag = 8
Hotspot(9).tag = 9
Hotspot(10).tag = 10
Hotspot(11).tag = 11
Hotspot(12).tag = 12
Hotspot(13).tag = 13

End Sub
Last edited by Netjera on Mon Feb 08, 2010 1:19 am, edited 1 time in total.
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 08, 2010 1:18 am

Hey..:)

Sometimes..when it gives u a type mismatch error..it usually tells u what the error is...like for instance it will say...Type Mismatch-- hotspot 1..ect..

Is there any chance it's saying that this time..?

Also it might be the sub--[name of it]...When u call it in the frame's properties..or else where..make sure u type the name correctly..
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Netjera » Mon Feb 08, 2010 1:21 am

mercedes wrote:Hey..:)

Sometimes..when it gives u a type mismatch error..it usually tells u what the error is...like for instance it will say...Type Mismatch-- hotspot 1..ect..

Is there any chance it's saying that this time..?


No, I figured it out. I was calling it wrong in the frame procedures. I was calling sethotspots instead of setHotspotTags.

Sorry. :( I should never code when I'm sick, lol. I'm bad enough when I'm well! :)
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 » Mon Feb 08, 2010 1:55 pm

Netjera wrote:Okay, here's another one. I think I might be using the hotspot tags wrong. I've set up this little procedure and it's giving me a "type mismatch" error at runtime.

sub setHotspotTags

Hotspot(1).tag = 1
Hotspot(2).tag = 2
Hotspot(3).tag = 3
Hotspot(4).tag = 4
Hotspot(5).tag = 5
Hotspot(6).tag = 6
Hotspot(7).tag = 7
Hotspot(8).tag = 8
Hotspot(9).tag = 9
Hotspot(10).tag = 10
Hotspot(11).tag = 11
Hotspot(12).tag = 12
Hotspot(13).tag = 13

End Sub


you should try inputing the numbers as strings, since .tag property is defined as a string
Code: Select all
sub setHotspotTags
for i = 1 to 13
Hotspot(i).tag = cstr(i)
next
End Sub



as for the randomization code, I 'd recommend using the Random Events plugin that is included in the LDG plugins pack.
User avatar
Lyberodoggy
Administrator
 
Posts: 2519
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Netjera » Mon Feb 08, 2010 11:57 pm

Hey Lybero,

In that fix for the z hotspots, you set xdp and ydp to static values in the Frame Properties code tab of Hotspot 13. I need to have the cards move to different locations, based on which card it is.

Card 52 needs to go to 20, 100
Card 51 needs to go to 108, 100
Card 50 needs to go to 108, 115
...
Card 25 needs to go to 548, 190 (Final card in this particular layout)

What's the best way to approach that, any ideas?
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 » Tue Feb 09, 2010 2:30 pm

you will probably have to use a technique that you don't know yet. Just tell me how many columns and rows are there and ho do you want the cards to be placed.
User avatar
Lyberodoggy
Administrator
 
Posts: 2519
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Netjera » Tue Feb 09, 2010 6:10 pm

Well, I notice that in frame properties you set up the initial locations as a constant, and then in the properties of Hotspot 13, you increment the ydp when you increment the index.

Is there any reason I couldn't increment the xdp there as well? If so, would something like this work?

Code: Select all
' If this is the first card, deal it alone to the first column
If Hotspot(index) = 52 then
xdp = 20
ydp = 100
' If this is the second card, deal it to the top of the second column
Else If Hotspot(index) = 51
xdp = 108
ydp = 100
' If this is the third card, deal it 15 below the top of column two
Else If Hotspot(index) = 50 then
xdp = 108
ydp = ydp + 15
' If this is the fourth card, deal it to the top of the third column
Else If Hotspot(index) = 49 then
xdp = 196
ydp = 100
' If these are the next two cards from column three, increment them
Else If Hotspot(index) <= 48 and >= 47 then
xdp = 196
ydp = ydp + 15
' If this is the top card of column four, deal it there
Else If Hotspot(index) = 46 then
xdp = 284
ydp = 100
' If these are the next three cards of column four, increment them
Else If Hotspot(index) < = 45 and >= 42 then
xdp = 284
ydp = ydp + 15
...
and so on.


I'm doing a standard 28 card deal into a Klondike solitaire pattern. (One card in the first column, 2 in the second, 3 in the third, 4 in the fourth.) Once this works properly, all cards will be face-down, except the exposed cards. (I've left them all face up so I can be sure it's randomizing the deal correctly, and it is.) If you've ever played Windows Solitaire, you've played Klondike.

I've got the deal working, and a "shuffle" working (totally random card draw), but when I tried to accommodate your code to a 52 card deck and a 28 card move, I started to have some issues. I'm *thinking* it's one of two things - either the start location is throwing it off, or the fact that I have moves going on in each individual card (at present), and I'll need to code that as above, and remove it from the hotspot move plugin tab.

If you need to see the new code, I can try to zip it up and PM it to you. I'm kind of hoping to solve this myself, though. :) I'm starting to become familiar with where code is called from, and that's making it a little easier to track. :)
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 » Tue Feb 09, 2010 10:40 pm

Ok I ll let you work on it a bit and if you don't figure it out just post here :)
User avatar
Lyberodoggy
Administrator
 
Posts: 2519
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Netjera » Wed Feb 10, 2010 3:06 am

I got it working, except it's not actually moving the cards, they're just appearing where they need to be. >.<

Is the loop in the Frame Properties window what's actually controlling the move? I took it out because it was messing up my other subroutines, and it didn't seem to affect card placement. >.<
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 » Wed Feb 10, 2010 4:21 pm

No, that shouldn't be a problem :S
User avatar
Lyberodoggy
Administrator
 
Posts: 2519
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Netjera » Wed Feb 10, 2010 6:09 pm

Lyberodoggy wrote:No, that shouldn't be a problem :S


Okay, here's another question: Which mobility plugin files should I have in the directory? At one point, AM threw an error, telling me I had a duplicate, so I took out the "earlier" file. Now I'm wondering if I needed both. >.<

I *think* I took out 2.0 and left in 2.1.
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 » Wed Feb 10, 2010 7:51 pm

in order to be backwards compatible, my plugin uses the same internal name even though the filename changes. You should remove the oldest plugin (2.0) from the plugins folder, or it will seem as a duplicate of the same internal plugin.
User avatar
Lyberodoggy
Administrator
 
Posts: 2519
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

PreviousNext

Return to Adventure Maker General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron