Eclipse - Free 2D Mmorpg Maker
September 02, 2010, 10:20:11 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Shop Arcade chat Login Register  
 
 
   
 
collapse

* No Spam Or Websites

Refresh History
  • Ertzel: So... Anyone with basic/none/limited photoshop or even paint skills want to make some money converting sprites for me?
    Today at 10:07:35 PM
  • Gamma™: weaver why are you oflfine on H&H? :S
    Today at 10:04:26 PM
  • Ertzel: Ya, only one try per knife, my one try failed :(
    Today at 10:00:17 PM
  • LegendWeaver: is it one use?
    Today at 09:43:15 PM
  • Ertzel: Wish I didnt spend my 1k+ credits to buy the stupid knife that failed at stealing Robins credits >.<
    Today at 09:42:42 PM
  • Wraith: ) Kreator!
    Today at 09:06:52 PM
  • Wraith: yes! you were! (in red text
    Today at 09:06:46 PM
  • ToshiroHayate: Kreator!
    Today at 08:25:02 PM
  • Kreator: o_0 Was I supposed to Wraith?
    Today at 08:16:02 PM
  • [Pie] ICT: Don't worry.. I commented.
    Today at 07:55:08 PM
  • Wraith: Ay, kreator, wtf is up with you not posting anything about my new cliffs??
    Today at 07:50:36 PM

* Recent Topics

[EO] Attaching Problem. by Ertzel
[Today at 10:11:57 PM]


Project Vertigo [2d Tile-based Side-Scrolling Engine] by Miguu
[Today at 10:03:22 PM]


Zacaras Empire (Hiring) by Ertzel
[Today at 08:43:54 PM]


custom cliff tiles by ToshiroHayate
[Today at 08:29:15 PM]


.: RPG Kingdom :. by LegendWeaver
[Today at 08:25:20 PM]


What do you think? by [Pie] ICT
[Today at 07:54:54 PM]


[Show Off] Aztec Stuff by [Pie] ICT
[Today at 07:50:07 PM]


So I herd you liek mudkipz by Kreator
[Today at 07:36:52 PM]


Haven and Hearth: Epic Screenshot Thread by Tompwnage™
[Today at 07:14:21 PM]


The Lonliest Star [RP] by DDunit
[Today at 07:09:46 PM]


* Who's Online


Site Author : Topic: daMoose's OnDeath Subs  (Read 1746 times)
0 Members and 1 Guest are viewing this topic.
July 31, 2006, 08:43:23 AM
Member
**
User No : 1285
Posts: 84
  • 0 credits
  • View Inventory
  • Send Money To daMoose_Neo
    • View Profile
    Ahkay, irritated by the lack of functionality in the game's Dungeon respawning, I wrote my own code for dying and reappearing. Very simple, actually, but I like it ^_^

    First step: This following block goes under the Commands sub, preferably before the Select Case portion, at least that's where I have it:

    Code: [Select]


    '*********************************************************************************************
    'OnDeath - daMoose's Commands v.01 7/31/2006
    '*********************************************************************************************
    ' These Subs allow you to define regions and outputs to OnDeath.ini When a player dies, OnDeath
    ' is consulted for the player's current map, then warped to the appropriate restart point.

        If LCase(Mid(TextSay, 1, 10)) = "/setregion" Then

    If GetPlayerAccess(index) < 3 Then
    Call PlayerMsg(index,"You do not have the authority to use this command.",2)
    Exit Sub
    End If


            If Len(TextSay) > 11 Then
    TextSay = Mid(TextSay, 11, Len(TextSay) - 10)
    Call PutVar("Scripts/OnDeath.ini", "Maps",GetPlayerMap(index), Trim(TextSay))
    Call PlayerMsg(index,"You have set Map " & GetPlayerMap(index) & " to region " & Trim(TextSay) & ".",2)
    Exit Sub
            End If
    Call PlayerMsg(index,"Please specify a region...",2)
            Exit Sub
        End If      
       
       If LCase(Mid(TextSay,1,11)) = "/setrestart" then

    If GetPlayerAccess(index) < 3 Then
    Call PlayerMsg(index,"You do not have the authority to use this command.",2)
    Exit Sub
    End If

    If Len(TextSay) > 12 Then
    TextSay = Trim(Mid(TextSay, 12, Len(TextSay) - 11))
    Call PutVar("Scripts/OnDeath.ini",Trim(TextSay),"StartX", GetPlayerX(index))
    Call PutVar("Scripts/OnDeath.ini",Trim(TextSay),"StartY", GetPlayery(index))
    Call PutVar("Scripts/OnDeath.ini",Trim(TextSay),"StartMap", GetPlayerMap(index))
    Call PlayerMsg(index,"You have marked this map as a restart point!",2)
    Exit Sub
    End If
       Call PlayerMsg(index,"Please specify a region...",2)
       Exit Sub
       End If
    '*********************************************************************************************
    'End daMoose's Subs
    '*********************************************************************************************


    This gives us the commands "/setrestart" and "/setregion".
    How to use these commands:

    /setrestart <Region Name> = This designates the map and your coordnates when you use it as the restart point for the specified region. Typically, you want to set a "region" or a restart point for each dungeon or area. This allows the players to warp back to the entrance.

    /setregion <Region Name> = This sets the map where you are when you use this command to a particular region name, such as "Capitol", "Cave", etc. When a player dies on the map, they are warped to that region's designated restart point, defined by the above command.

    Both of these commands output to the file OnDeath.ini, which will appear in your scripts folder when you use this.
    This does include rudementary "hack-proofing" by checking the player's access level. I currently have it set to 3, as I don't neccesarily want my mappers defining the whole world, but thats just me. You can set it down to 2 if you prefer or up to 4 for absolute Admin-only access.

    Now, for the OnDeath sub itself:
    Code: [Select]

    '*********************************************************************************************
    'daMoose's OnDeath Script v.01 7/31/2006
    '*********************************************************************************************
    Dim ToRegion
    Dim ToX
    Dim ToY
    Dim ToMap

    ToRegion = GetVar("Scripts/OnDeath.ini", "Maps", GetPlayerMap(index))

    ToX = Int(GetVar("Scripts/OnDeath.ini", Trim(ToRegion),"StartX"))
    ToY = Int(GetVar("Scripts/OnDeath.ini", Trim(ToRegion),"StartY"))
    ToMap = Int(GetVar("Scripts/OnDeath.ini", Trim(ToRegion),"StartMap"))

    Call PlayerWarp(index, ToMap ToX, ToY)

    '*********************************************************************************************
    'End OnDeath Script
    '*********************************************************************************************


    Simply plug that into your OnDeath sub and it's ready to rock & roll!
    I would appreciate leaving the header tags in place, I don't post my scripts often so I'd appreciate keeping the couple tag notes in place, thanks!

    Hopefully, some other folks find this as useful as it was for me.
    Logged

    Neo Productions Unlimited - Making the impossible possible!
    Check us out on the web!
    Neo Productions Unlimited
    Key20 RPGNow.com
     


    Powered by MySQL Powered by PHP Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
    SimplePortal 2.3.1 © 2008-2009, SimplePortal
    Valid XHTML 1.0! Valid CSS!
    Page created in 0.21 seconds with 30 queries.