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


  • Posts

  • Joined

  • Last visited


Zeno's Achievements


Newbie (1/14)



  1. Zeno


    Scripted spell cases. Find Sub ScriptedSpells. When you make a scripted spell, the script# is the case# in the code. Basically, you can make a spell do anything (within reason) if you code it in there. This is how most people do "skills". Alternatively, use the hotkeys sub's cases to do by hitting a specified key as opposed to casting a specified spell.
  2. How does your sub look? The following works: ``` Sub OnMapLoad(Index, OldMap, NewMap) Call SaveCharInfo(Index) End Sub ``` When I use that in conjunction with your sub, it updates the ini each time I load a map. Is there something else in your OnMapLoad sub that might be making it not work?
  3. @Adrian: Using & "" is a common practice to avoid errors. If you have a Sub Name(Index, Variable) and use Call PutVar("filename.ini", "header", "label", Variable) it will not work. In that case, you need Call PutVar("filename.ini", "header", "label", Variable & ""). This only happens when the variable is one from the subname. @Dastyruck: Before you were using Sub SaveCharInfo(Index). To activate the sub, you need a Call SaveCharInfo(Index) at some point in your main.txt. Where are you actually using that call in your main txt? I'm looking for something like a scripted tile, spell, command, npc that initializes the actual savecharinfo function.
  4. Tested, and that all works. What about the part of your script that triggers it, using Call SaveCharInfo(Index)?
  5. Dastyruck, the problem does not lie in the single line of code. It works. What context is the call in? The error must lie in the code that triggers the Call. For example, this works within the commands sub: ``` Case "/check" Call PutVar("mailsystem\" & GetPlayerName(index) & ".ini", "Info", "Class", GetPlayerClassName(index)) Exit Sub ```
  6. Sure. The following code will set the player's permanent death toggle to 1 when the player dies. It will then kick the player, telling him that she or he died. When the player joins the game, it will kick the player and give a message that the player is dead. When a player makes a new character, that slot's death toggle is set off. When a player dies in an arena map, the player's death toggle is not set to 1. This takes 3 subs: ``` ' Executes on death, dropping all of the players items. Sub DropItems(Index) Call PutVar("accounts\" & GetPlayerLogin(index) & "_Info.ini", "Char" & GetPlayerCharNum(Index), "Dead", 1) If GetPlayerWeaponSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerWeaponSlot(Index), 0) End If If GetPlayerArmorSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerArmorSlot(Index), 0) End If If GetPlayerHelmetSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerHelmetSlot(Index), 0) End If If GetPlayerShieldSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerShieldSlot(Index), 0) End If If GetPlayerLegsSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerLegsSlot(Index), 0) End If If GetPlayerRingSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerRingSlot(Index), 0) End If If GetPlayerNecklaceSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerNecklaceSlot(Index), 0) End If Call AlertMsg(Index, "You have died!") End Sub ``` ``` ' Executes when a player logs into the game. Sub JoinGame(Index) If GetVar("accounts\" & GetPlayerLogin(index) & "_Info.ini", "Char" & GetPlayerCharNum(Index), "Dead") = 1 Then Call AlertMsg(Index, "You are dead!") End If If GetPlayerAccess(Index) = 0 Then Call GlobalMsg(GetPlayerName(Index) & " has joined " & GameName & "!", GREY) Else Call GlobalMsg("Administrator " & GetPlayerName(Index) & " has joined " & GameName & "!", YELLOW) End If Call PlayerMsg(Index, "Welcome to " & GameName & "!", WHITE) If LenB(MOTD) 0 Then Call PlayerMsg(Index, "MOTD: " & MOTD, BRIGHTCYAN) End If Call SendWhosOnline(Index) End Sub ``` ``` ' Executes when a new character is created. Sub OnNewChar(Index, CharNum) Call PutVar("accounts\" & GetPlayerLogin(index) & "_Info.ini", "Char" & GetPlayerCharNum(Index), "Dead", 0) End Sub ```
  7. Also for #6 if it's stored client-side the player can switch the number to give themselves whatever sprite they want. For both tiles: (This one was posted a few posts back. How you're doing this tile effects the other tile) Changes the sprite (you still need to set the sprite number) ``` Case 0 Call PutVar("\Scripts\charextras\"&GetPlayerName(Index)&".ini","Sprite","normal",GetPlayerSprite(Index)) Call SetPlayerSprite(Index, sprite#) Call PlayerWarp(Index, GetPlayerMap(Index), GetPlayerX(Index), GetPlayerY(Index)) Exit Sub ``` Sets the player's Sprite back to the original: ``` Case 1 Call SetPlayerSprite(Index, GetVar("\Scripts\charextras\"&GetPlayerName(Index)&".ini","Sprite","normal")) Exit Sub ```
  8. Well… Your trigger is Call SetTimer("tmrTest " & index & ",0", 5000) You can change the 5000 to any duration you would like, _in miliseconds_. It is set to 5 seconds right now. The tutorial says to use a scripted tile for when you enter a map. The tile would trigger a timer which would start the NPC casting the spell. Then, in the OnNPCDeath sub you add a Call RemoveTimer to stop the NPC from casting. The flaw with this is that only the first NPC on the map will cast. Alternatively, put it in Sub PlayerHit with a check for the NPC number to begin the casting when an NPC hits you. _Do not_ put it in scripted NPCs because then you can not attack them, and they will not directly attack you. The part of the code you posted goes into Sub tmrTest under Case 0. Everyone seems to use this sub for timers, which is frustrating since it assumes the script's user also happened to be using the exact same sub for their timers. You will have to add in the sub, and the title of a sub is case-sensitive is a timer is to be used. @Warconn: The original Main.txt does not include a Sub tmrTest. This sub was made by Baron to keep timers organized, and **is absolutely not a required sub to use timers**. He probably won't be able to find that sub in his main.txt because it might not be in his main.txt. I'm going to assume you're using Baron's main.txt. Don't forget that it's different.
  9. Create the mailsystem folder first, then it will work. @Adrian: Having just checked I assure you that without the folder, it will not create any file.
  10. You're right, Adrian, because Number is already a variable. It would be the second one in Call GenerateHouse(Index, #) Try this: ``` Sub GenerateHouse(index, number) Dim mapa Dim mapb Dim type Dim extra ' To connect a string (like "houses\") and a variable (like Number), use & mapa = GetVar("houses\" & Number & ".ini","A","Number") mapb = GetVar("houses\" & Number & ".ini","B","Number") type = GetVar("houses\" & Number & ".ini","A","Type") extra = GetVar("houses\" & Number & ".ini","B","Extra") If type = 1 Then Call SetTile(mapa,5,5,15,3,1,1) Else If type = 2 Then Call SetTile(mapa,5,5,16,3,1,1) Else Call SetTile(mapa,5,5,17,3,1,1) ' You forgot to close this if. End If End If If extra = 1 Then Call SetTile(mapb,5,5,15,3,1,1) Else If extra = 2 Then Call SetTile(mapb,5,5,16,3,1,1) Else Call SetTile(mapb,5,5,17,3,1,1) ' Here again. End ifs End If End If End Sub ``` That should work.
  11. Zeno

    Shops HELP

    I think the problem is that you haven't made any money yet. Use /edititem to make a currency item, such as gold, silver, money, etc.
  12. The menus will show up if you implement the suggestions. I just tried it, and this works: ``` Sub ScriptedNPC(Index, Script) Select Case Script Case 0 Call CustomMenuShow(index, "The Red Alliance", "\GUI\CUSTOM\Red.jpg", 1) Call CustomMenuLabel(index, 1, "Will you join the Red Alliance?", 20, 50, 10, 0, 0, 400, 20) Call CustomMenuTextBox(index, 1, 300, 20, 100, "Type ""Yes"" or ""No"" to answer") Exit Sub Case 1 Call CustomMenuShow(index, "The Blue Alliance", "\GUI\CUSTOM\Blue.jpg", 1) Call CustomMenuLabel(index, 2, "Will you join the Blue Alliance?", 20, 50, 10, 0, 0, 400, 20) Call CustomMenuTextBox(index, 2, 300, 20, 100, "Type ""Yes"" or ""No"" to answer") Exit Sub Case 2 Call CustomMenuShow(index, "The Yellow Alliance", "\GUI\CUSTOM\yellow.jpg", 1) Call CustomMenuLabel(index, 3, "Will you join the Yellow Alliance?", 20, 50, 10, 0, 0, 400, 20) Call CustomMenuTextBox(index, 3, 300, 20, 100, "Type ""Yes"" or ""No"" to answer") Exit Sub Case 3 Call CustomMenuShow(index, "The Green Alliance", "\GUI\CUSTOM\green.jpg", 1) Call CustomMenuLabel(index, 4, "Will you join the Green Alliance?", 20, 50, 10, 0, 0, 400, 20) Call CustomMenuTextBox(index, 4, 300, 20, 100, "Type ""Yes"" or ""No"" to answer") Exit Sub Case Else Call PlayerMsg(Index, "No NPC script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End Select End Sub ``` The menu will come up, unless you don't have the image. In the case that you don't, it will tell you.
  13. Zeno

    SadScript Bug

    More nitpicking than anything, but still a bug: Sub SetPlayerNameColor's effect is not as it should be. When used, it temporarily changes the colour of a player's name to the chosen input colour. Upon relogging, the player's name reverts to the original colour. That part of it works and makes sense. Unfortunately, _only the player whose name changes colour will see the change._ Though a command of seemingly low worth, it is the most practical way to make names invisible for hiding or stealth skills, by using values above 15. Since only the affected player will see the change, it is currently useless for those purposes.
  • Create New...