Eclipse - Free 2D Mmorpg Maker
September 02, 2010, 10:17:39 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: New functions! [1/5]  (Read 3853 times)
0 Members and 1 Guest are viewing this topic.
January 20, 2007, 06:36:02 AM
Global Moderator
Demi God
*
User No : 1712
Posts: 6821
  • 1292 credits
  • View Inventory
  • Send Money To Stephan
    • View Profile


    I've made some easy functions for Sadscripting... You can use them if you want.
    Quote
    Non-scripter[1/5]
    Beginner[1/5]
    Advanced Scripter[1/5]
    Expert[1/10]
    Pro[1/100]

    Code:
    Code: [Select]
    Sub TakeItem(index, item, value)
    If value = "all" Then
    SLOT = 1
    Do While SLOT < 24
    If GetPlayerInvItemNum(index, SLOT) = item Then
    Call SetPlayerInvItemNum(index, SLOT, 0)
    Call SetPlayerInvItemValue(index, SLOT, 0)
    Call SendInventoryUpdate(index, SLOT)
    SLOT = 24
    End If
    SLOT = SLOT+1
    Loop
    Else
    SLOT = 1
    Do While SLOT < 24
    If GetPlayerInvItemNum(index, SLOT) = item Then
    Call SetPlayerInvItemNum(index, SLOT, 0)
    Call SetPlayerInvItemValue(index, SLOT, GetPlayerInvItemValue(index, SLOT) - value)
    Call SendInventoryUpdate(index, SLOT)
    SLOT = 24
    End If
    SLOT = SLOT+1
    Loop
    End If
    End Sub

    Function:
    TakeItem(index, item, value)
    value can be:
    Quote
    all(to take away all items)
    0(if it is a non-stackable item)
    1 or higher(if it is a stackable item)


    Code:
    Code: [Select]
    Sub GiveItem(index, item, value)
    SLOT = 1
    Do While SLOT < 24
    If GetPlayerInvItemNum(index, SLOT) = 0 Then
    Call SetPlayerInvItemNum(index, SLOT, item)
    Call SetPlayerInvItemValue(index, SLOT, value)
    Call SendInventoryUpdate(index, SLOT)
    SLOT = 24
    End If
    SLOT = SLOT+1
    Loop
    End Sub

    Function:
    GiveItem(index, item, value)
    Quote
    0(if it is a non-stackable item)
    1 or higher(if it is a stackable item)


    Code:
    Code: [Select]
    Sub ChangeItem(index, olditem, newitem, newval)
    SLOT = 1
    Do While SLOT < 24
    If GetPlayerInvItemNum(index, SLOT) = olditem Then
    Call SetPlayerInvItemNum(index, SLOT, newitem)
    Call SetPlayerInvItemValue(index, SLOT, newval)
    Call SendInventoryUpdate(index, SLOT)
    SLOT = 24
    End If
    SLOT = SLOT+1
    Loop
    End Sub

    Function:
    ChangeItem(index, olditem, newitem, newval)
    olditem = The Old Item
    newitem = The New Item
    newval = The New Value
    This gives you a new function to change an old item to a new item :P.


    Code:
    Code: [Select]
    Sub lockall(index, mode)
    If mode = "true" Then
    lockall = true
    Elseif mode = "false" Then
    lockall = false
    End If

    Add this under Sub OnAttack:
    Code: [Select]
    If lockall(index, mode) = true Then
    Exit Sub
    End If

    Function:
    lockall(index, mode)
    Locks all the attacks of the player. (If it is set to true)
    Mode is true or false.


    Code:
    Code: [Select]
    Sub LoginCount(mode)
    If LoginCount = "" Then
    LoginCount = 0
    End If
    If mode = "+" Then
    LoginCount = LoginCount + 1
    Elseif mode = "-" Then
    LoginCount = LoginCount - 1
    End If
    End Sub

    Add this in Sub JoinGame above End Sub:
    Code: [Select]
    Call LoginCount("+")
    Add this in Sub LeftGame above End Sub:
    Code: [Select]
    Call LoginCount("-")
    Function:
    LoginCount(mode)
    mode is + or -
    Quote
    + adds 1
    - removes 1
    This is to count the players online.


    New commands in SadScript:
    Quote
    TakeItem(index, item, value)
    GiveItem(index, item, value)
    ChangeItem(index, olditem, newitem, newval)
    lockall(index, mode)
    LoginCount(mode)
    « Last Edit: January 22, 2007, 07:35:21 AM by Godlord » Logged


    • I do not provide help through the PM-system, e-mail, Skype or MSN, since this is kind of disturbing. I encourage you to make a new topic with proper spelling and grammar in the appropriate board instead, if possible.
    • I can't stand people who act like if they were children, so please don't.
    • I recommend you to read the rules before posting. It might solve conflicts before they actually occur.
    • I also recommend you to find the solution yourself before making a new topic about your issue. Chances are that other people had the same issue as well.
    January 22, 2007, 07:36:40 AM
    Global Moderator
    Demi God
    *
    User No : 1712
    Posts: 6821
  • 1292 credits
  • View Inventory
  • Send Money To Stephan
    • View Profile
    I've made a new function :D, ChangeItem(index, olditem, newitem, newval) it changes an old item to a new item, enjoy it :P.
    Logged


    • I do not provide help through the PM-system, e-mail, Skype or MSN, since this is kind of disturbing. I encourage you to make a new topic with proper spelling and grammar in the appropriate board instead, if possible.
    • I can't stand people who act like if they were children, so please don't.
    • I recommend you to read the rules before posting. It might solve conflicts before they actually occur.
    • I also recommend you to find the solution yourself before making a new topic about your issue. Chances are that other people had the same issue as well.
    December 22, 2008, 05:45:55 AM
    Eclipse Gfx/scripter
    Advanced Eclipser
    *****
    User No : 2911
    Posts: 1211
  • 8 credits
  • View Inventory
  • Send Money To kenny
  • Location : In the shadows stalking the forums at any given moment...
    ~Good Scripter~
    • View Profile
    • WWW
    just saw this thread and not sure if anyone noticed on the sub lockall(index, mode) there is no end sub, if someone just copys the script then it will bug their main. Probably best if a mod or someone fixes it.
    Logged

    <
    Im more of a forum lurker than a talker... I may help if I think its needed. Currently working on Scripts & Custom GFX for game.
    Dont know how to get your game online? try this www.hamachi.cc and install the download, make a network, and distribute client with hamachi ip and and a notepad with your hamachi network/pass... Happy gaming! Also may be able to help with PF, those who can get onto their router already may contact me... others may not because I cant help you.

    My computer geek score is greater than 100% of all people in the world! How do you compare? Click here to find out!
    December 22, 2008, 10:03:04 AM
    Global Moderator
    Demi God
    *
    User No : 1712
    Posts: 6821
  • 1292 credits
  • View Inventory
  • Send Money To Stephan
    • View Profile
    This topic is out-dated and lockall should make use of an array to prevent some other bugs.


    Regards,
      Godlord.
    Logged


    • I do not provide help through the PM-system, e-mail, Skype or MSN, since this is kind of disturbing. I encourage you to make a new topic with proper spelling and grammar in the appropriate board instead, if possible.
    • I can't stand people who act like if they were children, so please don't.
    • I recommend you to read the rules before posting. It might solve conflicts before they actually occur.
    • I also recommend you to find the solution yourself before making a new topic about your issue. Chances are that other people had the same issue as well.
     


    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.249 seconds with 29 queries.