Lancelot | How can I let a NPC give ego an item but only after he talked to the NPC. |
cloudee1 |
quick answer! if said talk man if send gego has item //item from character Print leave me the hell alone i've given you everything i got else send gego get inv-item Print ahh help help here take my wallet |
Lancelot |
I did it. It compiled succesfull but when I talk to the character I get an Sci message saying.That what I did they didn't think off and that I should take a different approuch. |
cloudee1 |
Ok boss I'm not sure what is happenning so here is a real script version of what I said, I Tested it and it works fine the problem might be something to do with your npc reaction to being talked to? (if(Said('talk/man')) (if(send gEgo:has (INV_FISH)) Print("leave me the hell alone i've given you my fish!")) (else (send gEgo:get(INV_FISH)) Print("here have a fish!") ) ) |
Lancelot |
Ok I used your script.I just changes the fish to fruit and it still gives me the message.What do you mean with the npc reaction to being talked to?I used him to just talk to Ego and it work.He was set up just like in the tutorial exept that I used a different view. In the main script where I set up the inventory items what must the owner be set to. |
cloudee1 |
I have never changed the value of any of my inventory items' owner. Therefore I am going to say 0 |
Lancelot |
My owner is set to 0 but I still get I get an Sci message saying.That what I did they didn't think off and that I should take a different approuch. |
Lancelot |
My owner is set to 0 but I still get I get an Sci message saying.That what I did they didn't think off and that I should take a different approuch. Is there anything I have to put in the main script that don't stand in the tutorial. |
Lancelot | Help anybody who know what the problem is. |
Eigen |
It's probably because you havent defined the inv. object in Scripts > Header > game. There should already be: (define INV_NOTHING 0) Then add: (define INV_FRUIT 1) //Or the number, which it is in the list in the main script. ...{Fruit} ...etc This should do the trick... -Eigen |
Lancelot | I already did it but I'll check it out again |
Lancelot |
I checked it out and I did define it as fruit. That isn't the problem. |
cloudee1 |
Post your code ;) |
Lancelot |
I found that problem it was in another script. It works now but after I talked to him I can't see the fruit in my inventory.Although it prints the apropriate message everytime I talk to him. :) |
Lancelot | Don't worry the problem was that my brackets weren't all in the right place so he didn't show the fruit in my inventory. |