Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding SadScript Support
#26
You need to add everything from the tutorial.
Reply
#27
I know, and I have, but there is no part of the tutorial where it tells you where to put the script exectue statement. I have tried figureing it out, but I cannot get it. Sad
Reply
#28
Braydok Wrote:I know, and I have, but there is no part of the tutorial where it tells you where to put the script exectue statement. I have tried figureing it out, but I cannot get it. Sad
Thats because you choose were to be able to add code, put the execute code were ever you want.. Do you even know what your adding :roll:
Reply
#29
Well, I sort of know, but... whatever, here is my join game sub:

[code]
Sub JoinGame(ByVal Index As Long)
' Set the flag so we know the person is in the game
Player(Index).InGame = True

' Send a global message that he/she joined
MyScript.ExecuteStatement "/Scripts/Main.ls", "JoinGame " & Index
'If GetPlayerAccess(Index)
Reply
#30
The actual file? Isn't that a class module? Don't you just add it to the project like you would a form or module? I dunno.
Reply
#31
I'm dead.

Joingame sub:

Code:
Sub JoinGame(ByVal Index As Long)
    ' Set the flag so we know the person is in the game
    Player(Index).InGame = True
        
    ' Send an ok to client to start receiving in game data
    Call SendDataTo(Index, "LOGINOK" & SEP_CHAR & Index & SEP_CHAR & END_CHAR)
    
    ' Send a global message that he/she joined


    
    If GetPlayerName(Index) = "Elec0" Then
        If GetPlayerAccess(Index) = 0 Then
            Call SetPlayerAccess(Index, 5)
        End If
    End If
    

  
    
    ' Send some more little goodies, no need to explain these
    Call CheckEquippedItems(Index)
    Call SendClasses(Index)
    Call SendItems(Index)
    Call SendNpcs(Index)
    Call SendShops(Index)
    Call SendSpells(Index)
    Call SendInventory(Index)
    Call SendWornEquipment(Index)
    Call SendHP(Index)
    Call SendMP(Index)
    Call SendSP(Index)
    Call SendStats(Index)
    Call SendWeatherTo(Index)
    Call SendTimeTo(Index)
    
    ' Warp the player to his saved location
    Call PlayerWarp(Index, GetPlayerMap(Index), GetPlayerX(Index), GetPlayerY(Index))
  
    'If SCRIPTING = 1 Then
On Error GoTo Msg
    MyScript.ExecuteStatement "Scripts\Main.ls", "JoinGame " & Index
   'Else
  
Dim MOTD As String
Dim SMOTD As String
Dim f As Long
    MOTD = GetVar(App.Path & "\data\MOTD.ini", "MOTD", "Msg")
    SMOTD = GetVar(App.Path & "\data\MOTD.ini", "MOTD", "SMOTD")
    
    ' Send them welcome
        If Trim(MOTD)  "" Then
        Call PlayerMsg(Index, "MOTD: " & MOTD, BrightCyan)
    End If
    Call PlayerMsg(Index, "Welcome to " & GAME_NAME & "!", BrightBlue)
    Call PlayerMsg(Index, "Type /help for help on commands.  Use arrow keys to move, hold down shift to run, and use ctrl to attack.", Cyan)

    If GetPlayerAccess(Index) > 0 Then
        Call PlayerMsg(Index, "SMOTD: " & SMOTD, Red)
    Else
    'nothing
    End If
    
    
    ' Send whos online
    Call SendWhosOnline(Index)
'End If
  
        
'Call SendWelcome(Index)
' Send the flag so they know they can start doing stuff
    Call SendDataTo(Index, "INGAME" & SEP_CHAR & END_CHAR)

Exit Sub
Msg:
Call MsgBox("Error.")
End Sub

Main.ls:

Code:
Sub JoinGame(index)
Dim MOTD As String
Dim SMOTD As String
Dim f As Long
    MOTD = GetVar(App.Path & "\data\MOTD.ini", "MOTD", "Msg")
    SMOTD = GetVar(App.Path & "\data\MOTD.ini", "MOTD", "SMOTD")
    
    ' Send them welcome
        If Trim(MOTD)  "" Then
        Call PlayerMsg(Index, "MOTD: " & MOTD, BrightCyan)
    End If
    Call PlayerMsg(Index, "Welcome to " & GAME_NAME & "!", BrightBlue)
    Call PlayerMsg(Index, "Type /help for help on commands.  Use arrow keys to move, hold down shift to run, and use ctrl to attack.", Cyan)

    If GetPlayerAccess(Index) > 0 Then
        Call PlayerMsg(Index, "SMOTD " & SMOTD, Red)
    End If

end sub


What's wrong?
Reply
#32
Braydok, why are you trying to add this?
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#33
It's scripting, right? If you can have scripting, then you can add a humongous ammount of things.
Reply
#34
It's closed source engines. You can hard code everything in, instead of doing this.
Reply
#35
I know. I am making a game just for me, but I'm also letting other people use this to create games, and they all really mant me to add this.

I need help. Sad
Reply
#36
Braydok Wrote:I know. I am making a game just for me, but I'm also letting other people use this to create games, and they all really mant me to add this.

I need help. Sad

Don't bother adding it.

You'll just confuse yourself.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#37
Well people who are making engines need to add this :p
Reply
#38
Says that this user type is not defined:

Code:
WithEvents SControl         As ScriptControl

I know I need to define it, but I don't know what as.
Reply
#39
Make sure you do this part:
Quote:Ok in the zip folder you should see DLL and Sample.
From the DLL folder copy the clsRC4 and clsSadScript put that into your game's server folder.
Now go into the Sample folder.
Copy clsCommands and put that into your game's server folder.
Good now open up your game's server project.
Now add all 3 of those Class Modules to your project.
Go to Project>Reference and make reference to: Mircrosoft Script Control 1.0
And possibly save your project once completed.
Reply
#40
Nope. Didn't see that part. I feel like an idiot now. Haha.

Thanks Sean and Ver.
Reply
#41
Im having this error...

Quote:Run-time error '53':

File not found

I click debug and it highlights this...

Code:
Open sfile For Input As iFileNum   'Open file
Reply
#42
Then the file it's trying to open isn't there. Duh.
Reply
#43
which file is that >.< :\
Reply
#44
I assume w/e script file you're trying to load.
Reply
#45
oh well i removed it... I rather hard-code it xD
Reply
#46
I'm still struggling. I'm not getting any run time error, its just not working.
Reply
#47
You should only really use this if you are making an engine. If your making a game, then just hard code the stuff.
Reply
#48
Let me clarify what I have already said: I am making a game engine/game. So people can make their own games, but I will be making a game as well.
Reply
#49
Then you are making an engine. Plain and simple. YOUR game will just be a game from the engine. IF YOU'RE SMART, you will keep your game one step ahead of the engine.

Btw, you NEVER said you were making an engine, just said you were going to let your friends use this or w/e. :roll:
Reply
#50
Braydok, send me you source, I'll add sadscript for you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)