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

WiseRock

Members
  • Posts

    499
  • Joined

  • Last visited

    Never

Posts posted by WiseRock

  1. > I'm glad that you were able to convert it, but I must say this is not a good way to go about making a Day/Night system, it's inefficient..it will cause lag and other problems and so on and so forth. Not to mention you need tiles? I can see it being used for Dx7, but in Dx8 why not just use more advanced rendering methods.
    >
    > In any case, good job upon releasing for those who need it anyway.
    >
    > Regards,
    >
    > DeathTheKid

    Thanks and I dont know how to do advanced rendering.
  2. Is there any way to host my server World-Wide without portfowoarding or Hamachi.

    I tried using [http://www.touchofde…-up-no-ip-pics/](http://www.touchofdeathforums.com/community/index.php?/topic/129241-setting-up-no-ip-pics/) web direct but then an error pops up Address in Use.
  3. Here is a cool addon that will allow you to set whether an npc spawns during the day, night, or both.

    First find this in sub UpdateMapLogic:

    ```

    [size]' //////////////////////////////////////[/size]

    ' // This is used for spawning an NPC //

    ' //////////////////////////////////////

    Change that whole part down to End Sub to this:

    ' //////////////////////////////////////

    ' // This is used for spawning an NPC //

    ' //////////////////////////////////////

    ' Check if we are supposed to spawn an npc or not

    If MapNpc(mapnum).NPC(x).Num = 0 And Map(mapnum).NPC(x) > 0 Then

    If TickCount > MapNpc(mapnum).NPC(x).SpawnWait + (NPC(Map(mapnum).NPC(x)).SpawnSecs * 1000) Then

    ' See if we are using the day/night system. If we are act accordinly, otherwise just spawn the mob

    If Options.DayNight = 1 Then

    ' Check for gametime, this is an addition in 1.4.2\. We're only

    ' spawning NPCs that are allowed to spawn in the current time

    ' of the day.

    If DayTime = True And NPC(Map(mapnum).NPC(x)).SpawnAtDay = 1 Then

    Call SpawnNpc(x, mapnum)

    ElseIf DayTime = False And NPC(Map(mapnum).NPC(x)).SpawnAtNight = 1 Then

    Call SpawnNpc(x, mapnum)

    End If

    Else

    ' Not using Day/Night, so just spawn it regardless.

    Call SpawnNpc(x, mapnum)

    End If

    End If

    End If

    ' Despawn mobs if the day/night system is active.

    If Options.DayNight = 1 Then

    ' Righto, let's see if we need to despawn an NPC until the time of the day changes.

    ' Ignore this if the NPC has a target.

    If MapNpc(mapnum).NPC(x).target = 0 And Map(mapnum).NPC(x) > 0 And Map(mapnum).NPC(x) <= MAX_NPCS Then

    If DayTime = True And NPC(Map(mapnum).NPC(x)).SpawnAtDay = 0 Then

    DespawnNPC mapnum, x

    ElseIf DayTime = False And NPC(Map(mapnum).NPC(x)).SpawnAtNight = 0 Then

    DespawnNPC mapnum, x

    End If

    End If

    End If

    Next

    End If

    DoEvents

    Next

    ' Make sure we reset the timer for npc hp regeneration

    If GetTickCount > GiveNPCHPTimer + 10000 Then

    GiveNPCHPTimer = GetTickCount

    End If

    ' Make sure we reset the timer for door closing

    If GetTickCount > KeyTimer + 15000 Then

    KeyTimer = GetTickCount

    End If

    End Sub

    ```

    Add this at the bottom of MapNPCRec

    ```

    SpawnWait As Long

    ' dot/hot

    DoT(1 To MAX_DOTS) As DoTRec

    HoT(1 To MAX_DOTS) As DoTRec

    ```

    Add this at the bottom of modGlobals

    ```

    Public KeyTimer as Long

    ```
    Next Find this sub : Sub SpawnMapNpcs

    Change the whole sub to this :

    ```

    Sub SpawnMapNpcs(ByVal mapnum As Long)

    Dim i As Long

    For i = 1 To MAX_MAP_NPCS

    If Map(mapnum).NPC(i) > 0 And Map(mapnum).NPC(i) <= MAX_NPCS Then

    If Options.DayNight = 1 Then

    If DayTime = True And NPC(Map(mapnum).NPC(i)).SpawnAtDay = 1 Then

    Call SpawnNpc(i, mapnum)

    ElseIf DayTime = False And NPC(Map(mapnum).NPC(i)).SpawnAtNight = 1 Then

    Call SpawnNpc(i, mapnum)

    End If

    Else

    Call SpawnNpc(i, mapnum)

    End If

    End If

    Next

    End Sub

    ```

    In modTypes under npcrec add:

    ```

    SpawnAtDay As Byte

    SpawnAtNight As Byte

    ```

    Add this to the bottom of modGameLogic:

    ```

    Sub DespawnNPC(ByVal mapnum As Long, ByVal NPCNum As Long)

    Dim i As Long, Buffer As clsBuffer

    ' Set the NPC data to blank so it despawns.

    MapNpc(mapnum).NPC(NPCNum).Num = 0

    MapNpc(mapnum).NPC(NPCNum).SpawnWait = 0

    MapNpc(mapnum).NPC(NPCNum).Vital(Vitals.HP) = 0

    ' clear DoTs and HoTs

    For i = 1 To MAX_DOTS

    With MapNpc(mapnum).NPC(NPCNum).DoT(i)

    .Spell = 0

    .Timer = 0

    .Caster = 0

    .StartTime = 0

    .Used = False

    End With

    With MapNpc(mapnum).NPC(NPCNum).HoT(i)

    .Spell = 0

    .Timer = 0

    .Caster = 0

    .StartTime = 0

    .Used = False

    End With

    Next

    ' send death to the map

    Set Buffer = New clsBuffer

    Buffer.WriteLong SNpcDead

    Buffer.WriteLong NPCNum

    SendDataToMap mapnum, Buffer.ToArray()

    Set Buffer = Nothing

    'Loop through entire map and purge NPC from targets

    For i = 1 To Player_HighIndex

    If IsPlaying(i) And IsConnected(i) Then

    If Player(i).Map = mapnum Then

    If TempPlayer(i).targetType = TARGET_TYPE_NPC Then

    If TempPlayer(i).target = NPCNum Then

    TempPlayer(i).target = 0

    TempPlayer(i).targetType = TARGET_TYPE_NONE

    SendTarget i

    End If

    End If

    End If

    End If

    Next

    End Sub

    ```

    OK now for the client side:

    FormWork: frmEditor_NPC

    1\. Somewhere make a Check box and name it : chkSday

    Set the caption to: Spawn during day

    2.Near it make another checkbox and name it : chkSnight

    Set the caption to : Spawn at night

    Add this code to the bottom of frmEditor_NPC:

    ```

    ' day night

    Private Sub chkSDay_Click()

    NPC(EditorIndex).SpawnAtDay = chkSDay.Value

    End Sub

    Private Sub chkSNight_Click()

    NPC(EditorIndex).SpawnAtNight = chkSNight.Value

    End Sub

    ```
    In modGameEditors find this in NpcEditorInit: .scrlAnimation.Value = NPC(EditorIndex).Animation

    Under it add this:

    ```

    .chkSDay.Value = NPC(EditorIndex).SpawnAtDay

    .chkSNight.Value = NPC(EditorIndex).SpawnAtNight

    In modTypes under npcrec add this:

    SpawnAtDay As Byte

    SpawnAtNight As Byte

    ```
  4. Ok after this tutorial you will have a working day and night system for DX8.. Basically we are making a game time that starts and stops when you turn on/off your server. In the map editor there is a new layer being drawn that is the darkness effect. You have the option to choose where and if this new layer is drawn so you can make lights, campfires and other things that will cause the light to not appear.. Its not the best looking thing in the world but heck its pretty cool to have this if your using DX8 still.. This was ripped from an older engine made by Stein so all credits are to him for creating this and little credit to me for converting it. Thanks to Justn for ripping it ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png)

    >! ![](http://i46.tinypic.com/6s43z8.jpg)
    >!
    >! Lets start with the Server
    >! >! modConstants']
    >! add this
    >! ```
    >! ' Game Time
    >! Public Const GAME_MINUTES_PER_SECOND = 1
    >! ```
    >! >! **modDatabase'**]
    >! Find this
    >! ```
    >! PutVar App.Path & "\data\options.ini", "OPTIONS", "Website", Options.Website
    >! ```
    >! Now go to Load Options and and this to the bottom
    >! ```
    >! Options.DayNight = Val(GetVar(App.Path & "\data\options.ini", "OPTIONS", "DayNight"))
    >! ```
    >! >! **modGeneral**']
    >! find:
    >! ```
    >! ' Initialize the random-number generator
    >! Randomize ', seed
    >! ```
    >! add this below
    >! ```
    >! ' Set the game time to the middle of the day.
    >! GameMinutes = 0
    >! GameHours = 12
    >! DayTime = True
    >! ```
    >! Find:```
    >! ' load options, set if they dont exist
    >! ```
    >! replace all of it with
    >! ```
    >! ' load options, set if they dont exist
    >! If Not FileExist(App.Path & "\data\options.ini", True) Then
    >! Options.Game_Name = "Eclipse Origins"
    >! Options.Port = 7001
    >! Options.MOTD = "Eclipse Origins."
    >! Options.Website = "http://www.touchofdeathforums.com/smf/"
    >! Options.DayNight = 1 'New part
    >! SaveOptions
    >! Else
    >! LoadOptions
    >! End If
    >! If Options.DayNight = 0 Then 'New
    >! frmServer.Label8.Visible = False 'New
    >! frmServer.lblGameTime.Visible = False 'New
    >! End If
    >! ```
    >! >! **modGlobals**']
    >! add this to bottom
    >! ```
    >! ' Game Time
    >! Public GameMinutes As Byte
    >! Public GameHours As Byte
    >! Public DayTime As Boolean
    >! ```
    >! >! **modTypes'**]
    >! add to bottom of Options rec
    >! ```
    >! DayNight As Byte
    >! ```
    >! >! **modServerLoop'**]
    >! Find:
    >! ```
    >! If Tick > tmr1000 Then
    >! If isShuttingDown Then
    >! Call HandleShutdown
    >! End If
    >! tmr1000 = GetTickCount + 1000
    >! End If
    >! ```
    >! Replace with:
    >! ```
    >! If Tick > tmr1000 Then
    >! If isShuttingDown Then
    >! Call HandleShutdown
    >! End If
    >! ' Change the game time.
    >! If Options.DayNight = 1 Then
    >! GameMinutes = GameMinutes + GAME_MINUTES_PER_SECOND
    >! If GameMinutes > 59 Then
    >! GameMinutes = 0
    >! GameHours = GameHours + 1
    >! If GameHours > 23 Then
    >! GameHours = 0
    >! End If
    >! End If
    >!
    >! ' See if we need to switch to day or night.
    >! If DayTime = True And GameHours > 19 Then
    >! DayTime = False
    >! SendGameTime
    >! GlobalMsg "Darkness has fallen upon these Lands!", Yellow
    >! ElseIf DayTime = False And GameHours > 7 And GameHours < 19 Then
    >! DayTime = True
    >! SendGameTime
    >! GlobalMsg "The Sun has risen across the Kingdom!", Yellow
    >! End If
    >! ' Update the label
    >! If DayTime = True Then
    >! frmServer.lblGameTime.Caption = "(Day) " & Trim(STR(GameHours)) & ":" & Trim(STR(GameMinutes))
    >! Else
    >! frmServer.lblGameTime.Caption = "(Night) " & Trim(STR(GameHours)) & ":" & Trim(STR(GameMinutes))
    >! End If
    >! End If
    >! tmr1000 = GetTickCount + 1000
    >! End If
    >! ```
    >! >! **modSeverTCP**']
    >! ```
    >! Sub SendGameTime()
    >! Dim Buffer As clsBuffer
    >! Set Buffer = New clsBuffer
    >! Buffer.WriteLong SSendTime
    >! If DayTime = True Then
    >! Buffer.WriteLong 1
    >! Else
    >! Buffer.WriteLong 0
    >! End If
    >! SendDataToAll Buffer.ToArray()
    >! Set Buffer = Nothing
    >! End Sub
    >! ```
    >! >! **modPlayer**']
    >! Find **' Send some more little goodies, no need to explain these**
    >! add this to the end of the calls
    >! ```
    >! Call SendGameTime
    >! ```
    >!
    >! add```
    >! SSendTime
    >! ```
    before the SMSG
    >! find Public Enum MapLayer
    >! add
    >! ```
    >! Night
    >! ```
    >!
    >! >! ```
    >! Public DayTime As Boolean
    >! ```
    >!
    >! add this in Render_Graphics:
    >! ```
    >! ' Render Night
    >! If DayTime = False Or frmEditor_Map.optLayer(6).Value = True Then
    >! For X = 0 To Map.maxX
    >! For Y = 0 To Map.maxY
    >! DrawNightTile X, Y
    >! Next
    >! Next
    >! End If
    >! ```
    >! add this at the bottom of the module
    >! ```
    >! Public Sub DrawNightTile(ByVal x As Long, ByVal y As Long)
    >! Dim rec As RECT, i As Long
    >! With Map.Tile(x, y)
    >! i = MapLayer.Night
    >!
    >! ' skip tile if tileset isn't set
    >! If (.layer(i).Tileset > 0 And .layer(i).Tileset <= NumTileSets) And (.layer(i).x > 0 Or .layer(i).y > 0) Then
    >! ' sort out rec
    >! rec.Top = .layer(i).y * PIC_Y
    >! rec.Bottom = rec.Top + PIC_Y
    >! rec.Left = .layer(i).x * PIC_X
    >! rec.Right = rec.Left + PIC_X
    >! ' render
    >! RenderTexture Tex_Tileset(.layer(i).Tileset), ConvertMapX(x * PIC_X), ConvertMapY(y * PIC_Y), .layer(i).x * 32, .layer(i).y * 32, 32, 32, 32, 32, -1
    >! End If
    >!
    >! End With
    >! End Sub
    >! ```
    >!
    >! add this at the bottom of InitMessages
    >! ```
    >! HandleDataSub(SSendTime) = GetAddress(AddressOf HandleSendTime)
    >! ```
    >! at the bottom add
    >! ```
    >! Private Sub HandleSendTime(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
    >! Dim Buffer As clsBuffer
    >! Dim Temp As Byte
    >! Set Buffer = New clsBuffer
    >! Buffer.WriteBytes Data()
    >! Temp = Buffer.ReadLong
    >! If Temp = 1 Then DayTime = True
    >! If Temp = 0 Then DayTime = False
    >! Set Buffer = Nothing
    >! End Sub
    >! ```
    >! >! modEnumerations']
    >! Add this before the SMSG
    >! ```
    >! SSendTime
    >! ```
    >! and add this in Public Enum MapLayer
    >! ```
    >! Night
    >! ```
    >! >! modTypes']
    >! add this before the end type in OptionsRec
    >! ```
    >! NightTile As Byte
    >! ```
    >! >! modDatabase']
    >! add this in SaveOptions above the Error Handler
    >! ```
    >! Call PutVar(Filename, "Graphics", "Night", str(Options.NightTile))
    >! ```
    >! then add this in LoadOptions below the Options.Debug = 0
    >! ```
    >! Options.NightTile = ##
    >! ```
    Now find this: **Options.Debug = GetVar(Filename, "Options", "Debug")**
    >! add
    >! ```
    >! Options.NightTile = GetVar(Filename, "Graphics", "Night")
    >! ```
    >! >! Ok for the **Form Work**
    >! **Client Side-
    >! FrmEditor_Map:**
    >! Find the map layers radio buttons… Copy and paste one of them. Make sure you paste it inside of the frame: fraLayers.. After you have pasted it **make sure the index is set to 6**.
    >! Now Add this to the bottom of frmEditor_map:
    >! ```
    >! Private Sub optLayer_Click(Index As Integer)
    >! If Index = Night Then
    >! scrlTileSet.Value = Options.NightTile
    >! scrlTileSet_Change
    >! scrlTileSet.Enabled = False
    >! Else
    >! scrlTileSet.Enabled = True
    >! End If
    >! End Sub
    >! ```
    >! **Server Form Work-**
    >! **frmServer**
    >! 1.Anywhere on the server panel make a label named: **label 8**
    >! set the caption to : **Game Time:**
    >! 2\. Beside it make a label named: **lblGameTime**
    >! Set the caption to : **xx:xx**
    >! **OK in your Server/Data Folder open options.ini and add this to the bottom: daynight=1**
    >! **In your client/datafiles/ folder open the config.ini and add this to the bottom:**
    >! **```
    >! [Graphics]
    >! Night= 113
    >! [b][/b]
    >! You have finshed the tutorial!
    >! Download the attachment and put it in Tilesets and put as number 113 Do not edit the picture in any way!!
    >! [spoiler][img]http://i48.tinypic.com/2mr8zfc.jpg[/img][/spoiler]
    >! Now you should have a nice Day and Night system
    ```**
  5. Hey Deathbeam great system could you implant some of your features from PR to ER? like

    A Character Creation.

    Day and Night System like It goes with if its 2:00 PM its day time and if its 9:00 PM its Night Time

    The Chat-box disappears when you hit enter but the text stays and the txtSend box stays.

    The Woodcutting and those kind of skills

    The Recent News from EA when you login

    Things that I would recommand: That you could code your self

    Auction House system. Like a better version where you can go talk to a NPC and the Auction House will pop up all Rendered up a looking cool

    In your event system could you do like an option where you can show the Sprite of the Event of the Face of the sprite of the event

    After some of these features this engine will maybe become THE BEST engine in Eclipse.

    P.S I know that you don't use tutorials so you would like to code these by your self that is fine ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png)

    > This seems really nice but I cant quite get it to work without the runtime libraries. The link appears to be dead. :/

    here you are

    [http://www.touchofdeathforums.com/community/index.php?/topic/132432-eclipse-runtimes-dx8/unread/](http://www.touchofdeathforums.com/community/index.php?/topic/132432-eclipse-runtimes-dx8/unread/)
  6. > There's your answer ^
    >
    > If you're using Eclipse Stable, then go for it!

    Using EO Nightly

    > actualy if you can change packets i think it should work,,, >.>but tut isnt explained good for somethings o-o
    >
    > and edits needed in mod handle data…
    >
    > (parse,senddata,sep_char,end_char) < these dont work in eo just telling you,

    How would I convert it?
×
×
  • Create New...