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

dragonlord52

Members
  • Posts

    63
  • Joined

  • Last visited

    Never

Posts posted by dragonlord52

  1. For some reason, even if I don't have items in my inventory, the script still by passes this if statement

    ```
    'CHECK FOR REQUIRED ITEMS
    If (CountPlayerInvItem(Index, 1) < 0) Then
    Call PlayerMsg(Index, "1", 14)
    If (Req_Items = 2) Then
    If (CountPlayerInvItem(Index, Req_2_Num) = Req_2_Val) Then
    has_items = 1
    End If
    Else
    has_items = 1
    End If
    Else
    Call PlayerMsg(Index, "0", 14)
    has_items = 0
    End If
    ```
    This is the CountPlayerInvItem thing from Goddie
    ```
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    ' Function: CountPlayerInvItem '
    ' Brief: counts an item in the inventory. '
    ' Parameters: '
    ' Index: the index number of the player. '
    ' Item: the item to count. '
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    Function CountPlayerInvItem(Index, Item)
    For Slot = 1 To MAX_INVSLOTS
    If GetPlayerInvItemNum(Index, Slot) = Item Then
    If GetPlayerInvItemValue(Index, Slot) = 0 Then
    Amount = Amount + 1
    Else
    Amount = Amount + GetPlayerInvItemValue(Index, Slot)
    End If
    End If
    Next

    CountPlayerInvItem = Amount
    End Function
    ```
    I'm not really sure how its happening and when I use PlayerMsg to help me debug it appears to just be a blank message. Any ideas?
  2. After looking through various quest scripts on the forums I have come up with this solution that DOES work.

    ```
    Sub Quest(Index)
    On Error Resume Next

    NPC_Name = GetVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "NPC_Name")
    If (NPC_Name <> "" ) Then
    Quest_Status = GetVar("Accounts\" & GetPlayerLogin(Index) & "\" & GetPlayerName(Index) & ".ini", "QUEST", GetPlayerMap(Index))
    If (Quest_Status < 0) Then
    Call PutVar("Accounts\" & GetPlayerLogin(Index) & "\" & GetPlayerName(Index) & ".ini", "QUEST", GetPlayerMap(Index), 1)
    End If

    Select Case Quest_Status
    Case 1
    Exit Sub

    Case 2
    Exit Sub

    Case 3
    Exit Sub

    Case 4
    Exit Sub
    End Select
    Else
    Call PlayerMsg(Index, "Fat Man Inc. Scripts:", 14)
    Call PlayerMsg(Index, "A Configuration File has been created in", 14)
    Call PlayerMsg(Index, "scripts\mapextras\" & GetPlayerMap(Index) & ".ini", 14)

    Call PutVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "Quest_Name", "Test Quest Name")
    Call PutVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "NPC_Name", "Test Name")
    Call PutVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "Start__Quest_Message", "You started a quest.")
    Call PutVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "During_Quest_Message", "You are on a quest.")
    Call PutVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "Complete_Quest_Message", "You have completed a quest.")
    Call PutVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "After_Done_Quest_Message", "You already did this quest.")
    Call PutVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "Amount_of_Items_Needed", 1)
    Call PutVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "Item_1_Number", 1)
    Call PutVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "Item_1_Value", 1)
    Call PutVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "Item_2_Number", 0)
    Call PutVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "Item_2_Value", 0)
    Call PutVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "Repeatable", 0)
    Call PutVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "Sound_On", 0)
    Call PutVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "Sound_File", "critical.wav")
    End If

    End Sub
    ```
  3. I tried what you just posted and it gives me an end of statement expected error.

    Anyway, here is the entire code I have, got this far before it started erroring.

    ```
    Sub Quest(Index)
    Dim Quest_Status = CStr(0)

    NPC_Name = GetVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "NPC_Name")
    If (NPC_Name <> "" ) Then
    Quest_Status = CStr(GetVar("Accounts\" & GetPlayerLogin(Index) & "\" & GetPlayerName(Index) & ".ini", "QUEST", GetPlayerMap(Index)))

    Select Case Quest_Status
    Case 1
    Exit Sub

    Case 2
    Exit Sub

    Case 3
    Exit Sub

    Case 4
    Exit Sub
    End Select
    Else
    Call PlayerMsg(Index, "Fat Man Inc. Scripts:", 14)
    Call PlayerMsg(Index, "A Configuration File has been created in", 14)
    Call PlayerMsg(Index, "scripts\mapextras\" & GetPlayerMap(Index) & ".ini", 14)

    Call PutVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "Quest_Name", "Test Quest Name")
    Call PutVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "NPC_Name", "Test Name")
    Call PutVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "Start__Quest_Message", "You started a quest.")
    Call PutVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "During_Quest_Message", "You are on a quest.")
    Call PutVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "Complete_Quest_Message", "You have completed a quest.")
    Call PutVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "After_Done_Quest_Message", "You already did this quest.")
    Call PutVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "Amount_of_Items_Needed", 1)
    Call PutVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "Item_1_Number", 1)
    Call PutVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "Item_1_Value", 1)
    Call PutVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "Item_2_Number", 0)
    Call PutVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "Item_2_Value", 0)
    Call PutVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "Repeatable", 0)
    Call PutVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "Sound_On", 0)
    Call PutVar("Maps\map" & GetPlayerMap(Index) & ".ini", "QUEST", "Sound_File", "critical.wav")
    End If

    End Sub
    ```
  4. I still get the same error.

    Oh and I deleted the If statement as well (not commented out) but when I put the deceleration for the variable Quest_Status I get that error, dunno why that is.

    The () on my If statements do work, I use it on all of my scripts. I guess its habit from taking my C++ class.
  5. I use it for this
    ```
    If (Quest_Status <> "") Then
    ```
    But it gives that error in general. I have another one just like it but going to a different area and it works fine which is why I am confused.

    ~-EDIT-~

    I tried what you posted and I get the exact same error.
  6. I don't know if this is an ES only error or if its also in EE 2.7 but does anyone know why it does this?

    This is the line that errors out
    ```
    Quest_Status = GetVar("Accounts\" & GetPlayerLogin(Index) & "\" & GetPlayerName(Index) & ".ini", "QUEST", GetPlayerMap(Index))
    ```
    There is as follows:

    TYPE: Type mismatch: '[string:""]'
    LINE: 9
    COLUMN: 0
    CODE:

    I had tried dimming it and I have looked over this code again and again. If I comment the line out the script works just fine but if I try to put it back in it errors on me.

    Any ideas?

    Thanks,
    Slash

    ~-EDIT-~
    If something exists in that spot it doesn't error but if nothing is there it errors. You'll need that information to replicate it.
  7. I can't wait until I start learning this type of stuff via my college :) Prolly wont be for another couple of years though! Just starting to learn c++ and loving it but nothing this complex, lol.
  8. I'm going to need "Type" in there for later so I can't just take it out.

    What do you mean call PlayerMsg with the proper case #?

    I am using EE 2.7

    When this script is done it will be able to make 1 of 3 different .ini files depending on the "Type" you input and that is why I'm making a sub for it.
  9. Can some tell me why this simple little code isn't working? If I take the Type out of the () part of the sub it works fine but when I insert it back in it doesn't work and i can't figure out why. I have reload the scripts, restarted the server, double checked the very small amount of work I have done (I like to make sure things are working step by step, not one gaint step at a time) and for some reason it wont display the message. If someone could explain this to me it would make my day.

    > '\\\\\\\\\\\\\\\\ QUEST SCRIPT /////////////////////////////////
    > Sub QuestScript(Index, Type)
    > Call PlayerMsg(Index, "rawr", 14)
    > End Sub
    > '//////////////// END QUEST SCRIPT \\\\\\\\\\\\\\\\\\\\\\\\\\\\\

    Here is the call command I'm using

    > ' Executes whenever a scripted NPC does an action.
    > Sub ScriptedNPC(Index, Script)
    > Select Case Script
    > Case 0
    > Call QuestScript(Index, 0)
    > Exit Sub
    >
    > Case 1
    > Call QuestScript(Index, 1)
    > Exit Sub
    >
    > Case 2
    > Call QuestScript(Index, 2)
    > 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

    Thanks for helping!
  10. Please make the title deal with your game in some form…I hate it when games are like Futuristic Killing Machine and its set back in the medieval times...its just like "I DIDN'T SIGN UP FOR THIS!!" /rage /rage /rage /slitwrists
×
×
  • Create New...