Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Attribute Question
#1
Ok, first let me explain the situation. I've coded in a new attribute into a blank MS2E (first real programming project) that opens up a form when the tile is stepped on. Now I'm trying to link the attribute tile I made to a certain number. I want to be able to use a scroll bar to select a number, say, 1 from 100, and have it only apply to that one tile, I.e. If I set the tile number to 2, when the tile is stepped on it checks the members account to see if it has that number assigned to it, and if so it opens the form. I can do the If statement to open the form, but I'm at a loss to create the scrollbar, and have it save that number into the map file. Can anyone help me out?
Reply
#2
You'll have to add a form that pops up when you lay down this tile attribute from the mapeditor. The form will allow you to choose these numbers you need to store. Then its just a matter of what to do server side.

I don't have much time to go into detail right now, but presuming no one else replies to this to help, I'll explain it a little more in depth later.
Reply
#3
Okay, a little more.

Check out how the Warp attribute opens up a new form which stores data for a Map, X location, and Y location. You'll basically need to do the same thing. You'll be assigning a number to the tile's .Data1, .Data2, or .Data3 variables. You've already assigned the .Type attribute from what you tell me so far.

Code:
If frmMirage.optWarp.Value = True Then
    .Type = TILE_TYPE_WARP
    .Data1 = EditorWarpMap
    .Data2 = EditorWarpX
    .Data3 = EditorWarpY
End If

Then you'll have to add a variable to the PlayerRec. Either server side, or client and server side, depending on what you're trying to do with it exactly.
Reply
#4
Ok, I tried to go from where you told me too. I failed miserably, but hey, thats just me. It finally dawned on me in a car ride, that I was overthinking this entirely. I finally got it to work (YAY!) However, I'm not familiar enough with scroll bars. I can't figure out how to increase the max number for the scrollbar (i used the warp scrollbar, and the max for my scrollbar is 15. Can you tell me where to change this? And is there an option to turn off 0 as a value for the scrollbar, or do I have to code that in somewhere? Thank's for the help last time Sonire.
Reply
#5
Click the scrollbar, and look at it's properties menu (where you name the scrollbar and what not)
[Image: properties.png]
The properties you're looking for are Min and Max.
Reply
#6
Wow, I completely overlooked that. Guess that'll teach me to try to program before work while trying to get dressed so I'm not late *_*

*Edit* Maybe you can help me out one more time. Below is some lines of code I've come up with.

This line creates an item in the account thats called ownership and set to 0 automatically

(Server Side)

Code:
Call PutVar(FileName, "CHAR" & i, "Ownership", STR(Player(Index).Char(i).Ownership))

These lines are the code I used Client Side to save an "Owner" tile

Code:
Private Sub cmdOk_Click()
    EditorOwner = scrlOwn.Value
    Unload Me
End Sub

This is the part in the map editor that I've figured out (at least I'm pretty sure) saves the attribute for EditorOwner in the Map file.

Code:
If FrmMapeditor.OptOwner.Value = True Then
                        .Type = TILE_TYPE_OWNER
                        .Data1 = EditorOwner
                        .Data2 = 0
                        .Data3 = 0
                    End If

What I would like to do is write an If/Else statement, causing the attribute on the tile to only activate if
the number I set in the map editor is equal too the number I set on the members account (defaulted at 0). I know this
is going to be done server side, that's where the attribute coding is, however I don't know how to call the .data1 from this tile or the Ownership set in the .ini (Yes, I know .ini files suck, but I don't plan on converting to Binary until more of the coding is done up, and I have a better understanding of VB, please hold the flaming)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)