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

A few scripting questions


Recommended Posts

im a begginer scripter here, and have some questions that i would some help on

#1: how would i script a warp to another map, i simply would like to know what kind of subscript i would use in the script to accomplish this, (with all of my questions, the idea for this is so i can get practice righting some of the scripts myself) i know there is a warp button, button, but the idea is to have a scripted click so it will warp you to a new map and change your class, which brings us to my second question
#2 how would i script a class change, that way i can include it in the same script as question #1, and have multiple class changes, for instance class 1 will change to 4, 2 changes to 5, etc. all on the same tile
and finally one more question, this one however, does not relate to question #1 or #2 at all
#3 how would i edit the eclipse script to change the players/friendly npcs, avatars from 64x32 to 64x64, again what i need this for, is so my avatars which are 64x32 when moving forward and back, become 32x64 when moving either left or right, if you look at my avatar on the forums you will get an idea why i need this

THANKS FOR ANY ANSWERS YOU CAN GIVE
Link to comment
Share on other sites

#1)```
Call PlayerWarp(Index, Map, X, Y)
```#2)```
If GetPlayerClass(Index) = 1 Then
Call SetPlayerClass(Index, 4)
ElseIf GetPlayerClass(Index) = 2 Then
Call SetPlayerClass(Index, 5)
ElseIf GetPlayerClass(Index) = 3 Then
Call SetPlayerClass(Index, 6)
Else
Call PlayerMsg(Index, "You're already an advanced class", 10)
End If
```OR
```
Select Case GetPlayerClass(Index)
Case 1
Call SetPlayerClass(Index, 4)
Case 2
Call SetPlayerClass(Index, 5)
Case 3
Call SetPlayerClass(Index, 6)
Case Else
Call PlayerMsg(Index, "You're already an advanced class", 10)
End Select
```#3)Requires source edits, which you need VB6 for, which you have to buy, and nobody on this forum is allowed to link you any sort of illegal alternative.
IF however you do already "own" a copy vb6, you can ask questions related to the source in the Source Questions board.
Link to comment
Share on other sites

U need a sendPlayerData(index) in the script, so like this:
```
If GetPlayerClass(Index) = 1 Then
Call SetPlayerClass(Index, 4)
Call SendPlayerData(index)
ElseIf GetPlayerClass(Index) = 2 Then
Call SetPlayerClass(Index, 5)
Call SendPlayerData(index)
ElseIf GetPlayerClass(Index) = 3 Then
Call SetPlayerClass(Index, 6)
Call SendPlayerData(index)
Else
Call PlayerMsg(Index, "You're already an advanced class", 10)
End If

```OR
```
Select Case GetPlayerClass(Index)
Case 1
Call SetPlayerClass(Index, 4)
Call SendplayerData(index)
Case 2
Call SetPlayerClass(Index, 5)
Call SendplayerData(index)
Case 3
Call SetPlayerClass(Index, 6)
Call SendplayerData(index)
Case Else
Call PlayerMsg(Index, "You're already an advanced class", 10)
End Select

```
Link to comment
Share on other sites

It probably does change ur class, but u don't notice it, try logging off and back on and see if there is a change in what it says on your CHARACTER when u r choosing a character on character select (it should have changed) I think, if u want a spritechange to occur along with the class change, u would have to script it in.  Hold on, can u constantly click on the tile and the same changing message comes up?
Link to comment
Share on other sites

@Diskmaster:

> U need a sendPlayerData(index) in the script, so like this:
> ```
> If GetPlayerClass(Index) = 1 Then
> Call SetPlayerClass(Index, 4)
> Call SendPlayerData(index)
> ElseIf GetPlayerClass(Index) = 2 Then
> Call SetPlayerClass(Index, 5)
> Call SendPlayerData(index)
> ElseIf GetPlayerClass(Index) = 3 Then
> Call SetPlayerClass(Index, 6)
> Call SendPlayerData(index)
> Else
> Call PlayerMsg(Index, "You're already an advanced class", 10)
> End If
>
> ```OR
> ```
> Select Case GetPlayerClass(Index)
> Case 1
> Call SetPlayerClass(Index, 4)
> Call SendplayerData(index)
> Case 2
> Call SetPlayerClass(Index, 5)
> Call SendplayerData(index)
> Case 3
> Call SetPlayerClass(Index, 6)
> Call SendplayerData(index)
> Case Else
> Call PlayerMsg(Index, "You're already an advanced class", 10)
> End Select
>
> ```

you don't need to use the sendplayerdata(index) with classchanging..

however SetPlayerClass(Index, #) does NOT have any visual changes, it just sets the class number to the one you put in the script.. if you want to change the sprite/stats, you have to do some additional scripting
```
Call SetPlayerClass(Index, 4)
Call SetPlayerSTR(Index, GetClassSTR(4))
Call SetPlayerDEF(index, GetClassDEF(4))
Call SetPlayerMAGI(Index, GetClassMAGI(4))
Call SetPlayerSpeed(Index, GetClassSpeed(4))
Call SetPlayerSprite(Index, GetVar("\Classes\Class4.ini", "CLASS", "MaleSprite"))
Call PlayerMsg(Index, "You are now a " & GetPlayerClassName(Index) & ".", 15)
Call SendPlayerData(Index)
```
Link to comment
Share on other sites

Well, I probably have it working, but still not the way I want it, all I need is for your avatar to be changed, nothing else, however, if the only way to do that is along with stat changes (or if its just simpler that way) i can live with it) if someone could explain how to do this it would help, but prior, im going to post the current script i have that i have tried using, incase there is anything wrong.

' Executes when a player clicks on an OnClick tile.
Sub OnClick(Index, Script)
Select Case Script
Case 0
If GetPlayerClass(Index) = 0 Then
Call SetPlayerClass(Index, 4)
            Call SetPlayerSTR(Index, GetClassSTR(4))
                    Call SetPlayerDEF(index, GetClassDEF(4))
                                    Call SetPlayerMAGI(Index, GetClassMAGI(4))
                      Call SetPlayerSpeed(Index, GetClassSpeed(4))
            Call SetPlayerSprite(Index, GetVar("\Classes\Class4.ini", "CLASS", "MaleSprite"))
            Call PlayerMsg(Index, "You are now a " & GetPlayerClassName(Index) & ".", 15)
            Call SendPlayerData(Index)  
                      Else
            Call PlayerMsg(Index, "You have beamed down to the planet", 10)
                      End If
Link to comment
Share on other sites

```
' Executes when a player clicks on an OnClick tile.
Sub OnClick(Index, Script)
Select Case Script
Case 0
If GetPlayerClass(Index) = 0 Then
Call SetPlayerClass(Index, 4)
            Call SetPlayerSprite(Index, GetVar("\Classes\Class4.ini", "CLASS", "MaleSprite"))
            Call SendPlayerData(Index)  
                      Else
            Call PlayerMsg(Index, "You have beamed down to the planet", 10)
                      End If
```
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...