Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Diffrent classes start in diffrent places?


gdog12356
 Share

Recommended Posts

Yes.

In Sub AddChar, find:
```
        Player(index).Map = START_MAP
        Player(index).x = START_X
        Player(index).y = START_Y
```
Use the code I gave you previously in your last request (GetPlayerClass(index)) to check if the player has a class, and if so, change the Map, X and Y.
Link to comment
Share on other sites

@Soul:

> Yes.
>
> In Sub AddChar, find:
> ```
>         Player(index).Map = START_MAP
>         Player(index).x = START_X
>         Player(index).y = START_Y
> ```
> Use the code I gave you previously in your last request (GetPlayerClass(index)) to check if the player has a class, and if so, change the Map, X and Y.

soo,

```
If GetPlayerClass = 1 Then
        Player(index).Map = 1
        Player(index).x = 4
        Player(index).y = 4
        If else Continue

        Player(index).Map = START_MAP
        Player(index).x = START_X
        Player(index).y = START_Y
```
would this work? I do not know what to put instead of else if. Basically im trying to say if it isnt equal to this continue.
Link to comment
Share on other sites

@Soul:

> Rules:
> 1\. You must have an End If for every If unless the If is one statement long.
> 2\. Use Else to go on if the first isn't true, and ElseIf if you want to check the statement. Google "vb6 if syntax" for more.

```
If GetPlayerClass = 1 Then
        Player(index).Map = 1
        Player(index).x = 4
        Player(index).y = 4
        else

        Player(index).Map = START_MAP
        Player(index).x = START_X
        Player(index).y = START_Y

```
?? wat bout now? :D?
Link to comment
Share on other sites

@Soul:

> Only problem with that is that it's like you're setting x to 1 and then setting x to 2\. What is x now? 2\.
>
> You want to use an Else instead of that End If and then move the End If under the .y = START_Y.

```
        If GetPlayerClass = 1 Then
        Player(index).Map = 1
        Player(index).x = 4
        Player(index).y = 4
        else

        Player(index).Map = 2
        Player(index).x = START_X
        Player(index).y = START_Y
        end if

```
what bout now?
Link to comment
Share on other sites

@βluΣ:

> -code-
> what bout now?

Yes, that'll work if you only have two classes. If you want to have more than two, you need an ElseIf. Example:
```
        If GetPlayerClass(index) = 1 Then
            Player(index).Map = 1
            Player(index).x = 4
            Player(index).y = 4
        ElseIf GetPlayerClass(index) = 2 Then
            Player(index).Map = 2
            Player(index).x = START_X
            Player(index).y = START_Y
        ElseIf GetPlayerClass(index) = 3 Then
            ' code for class 3 here.
        End If

```
Also: I just realized you were missing the Index in GetPlayerClass. GetPlayerClass requires the identity of the player (or index, if you will) to be passed to it, so it knows which player's class to get.
Link to comment
Share on other sites

thank you :). It really helped that you guided me throught the coding process and explaining things to me, seeing as i have never coded before. thanks again! :). So should i replace the code in Sub AddChar without the changes, with the one that you guided me to make?
Link to comment
Share on other sites

@βluΣ:

> thank you :). It really helped that you guided me throught the coding process and explaining things to me, seeing as i have never coded before. thanks again! :). So should i replace the code in Sub AddChar without the changes, with the one that you guided me to make?

Yes, replace the old code in AddChar (this):
```
        Player(index).Map = START_MAP
        Player(index).x = START_X
        Player(index).y = START_Y

```
With the one that you made.
Link to comment
Share on other sites

Have you followed all the steps as outlined [here](http://www.touchofdeathforums.com/smf/index.php/topic,68399.msg736833.html#msg736833)? Mainly the step where you install Visual Basic 6 Service Pack 6?

Also, "the word doesn't seem to have anything wrong in it," yeah, no. That's not how programming works. When something doesn't work you post exactly what doesn't work.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...