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

Quests just dont work…[Resolved]


Recommended Posts

k, my first question is when you make the"FLAGS.ini" where do you place it? secondly, I'm getting an error; after a lot of looking I found a script that almost worked([http://www.touchofdeathforums.com/smf/index.php/topic,29991.0.html](http://www.touchofdeathforums.com/smf/index.php/topic,29991.0.html)) but the problem is it only says the first message in the script. now this probably has something to do with the first question, but I'm a bit of a newbie to this…
[EDIT]
It turns out the answer was to use a very popular script that I thought would be hard to edit, but actually it makes an easily editable file for each different quest. XD
-USE THIS SCRIPT IF YOUR A NEWBIE!!-[http://www.touchofdeathforums.com/smf/index.php?topic=5309.0](http://www.touchofdeathforums.com/smf/index.php?topic=5309.0) ;)
Link to comment
Share on other sites

heres the code, but i'm pretty shure I have "flags.ini" in the wrong place

```
Executes whenever a scripted NPC does an action.
Sub ScriptedNPC(Index, Script)
Select Case Script
Case 0
Call PlayerMsg(index, "can u get me a ham?", 12)
If CanTake(Index, 2, 1) = false Then
    Call PlayerMsg(index, "You didn't get the ham, comon, GET IT!", 12)
Else
    Call TakeItem(index, 2, 1)
    Call GiveItem(index, 3, 100)
    Call PlayerMsg(index, "Thanks heres your Reward!", 12)
End If
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
```
Link to comment
Share on other sites

ok, first…. The item needs to be stackable(Ham), and if you're trying to give a stackable item, you need to do..```
Call GiveCurrency(index, 3, 100)
```instead of```
Call GiveItem(index, 3, 100)
```…This script doesn't even call on flags.ini, so it doesn't matter...
Link to comment
Share on other sites

OK, well I did what you said I changed what I had to to make the script"work", but I still have the same problem. And the sad thing is, I have 5 of the item the npc needs only one of. In other words, I have the item and he does only the first message, not giving the player any reward. :huh:
Oh and here is the"corrected" code-

```
' Executes whenever a scripted NPC does an action.
Sub ScriptedNPC(Index, Script)
Select Case Script
Case 0
Call PlayerMsg(index, "I'm the shop tutor, can u buy me a ham from the

store?", 12)
If CanTake(Index, 2, 1) = false Then
    Call PlayerMsg(index, "You didn't get the item! Go buy it from the

merchant!", 12)
Else
    Call TakeItem(index, 2, 1)
    Call GiveItem(index, 3, 1)
    Call PlayerMsg(index, "Thanks heres your Reward!", 12)
End If
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
```
Link to comment
Share on other sites

```
' Executes whenever a scripted NPC does an action.
Sub ScriptedNPC(Index, Script)
Select Case Script
Case 0
Call PlayerMsg(index, "I'm the shop tutor, can u buy me a ham from the store?", 12)
If CanTake(Index, 2, 1) = false Then
    Call PlayerMsg(index, "You didn't get the item! Go buy it from the merchant!", 12)
Else
    Call TakeItem(index, 2, 1)
    Call GiveCurrency(index, 3, 1)
    Call PlayerMsg(index, "Thanks heres your Reward!", 12)
End If
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
```GiveCurrency and GiveItem are two completely different things, one gives armor/weapons etc. because it uses (Index, Number, Durability) and the other gives stackable items, because it uses (Index, Number, Amount).
Also, the functions;
```
CanTake(Index, Number, Amount)
TakeItem(Index, Number, Amount)
GiveItem(Index, Number, Durability)
GiveCurrency(Index, Number, Amount)
```are not hardcoded into Eclipse, you need to have those functions from their source, added to your Main.txt manually..
Link to comment
Share on other sites

@Bobosk:

> ```
> CanTake(Index, Number, Amount)
> TakeItem(Index, Number, Amount)
> GiveItem(Index, Number, Durability)
> GiveCurrency(Index, Number, Amount)
> ```are not hardcoded into Eclipse, you need to have those functions from their source, added to your Main.txt manually..

How, is there a tutorial that shows you how to do this? I would just search it, but as many know the search engine for the forum doesn't work.
thanks for all your help
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...