[Source] Easy to use NPC script (interaction, walking)
Re: Moving NPC's v0.3 (incl source)
A very nice update: NPC's are now clickable!
You can register two functions that you can use for interaction with the npc, once for clicking on the NPC and one when you give stuff to the npc.
This way you can start a dialog, or script what happens if the npc receives an item from the npc.
Sadly I don't have time to upload a new version yet. I just got it working and wanted to share it with you.
Tomorrow I'll clean up the code and upload the source of the new version.
You can register two functions that you can use for interaction with the npc, once for clicking on the NPC and one when you give stuff to the npc.
This way you can start a dialog, or script what happens if the npc receives an item from the npc.
Sadly I don't have time to upload a new version yet. I just got it working and wanted to share it with you.
Tomorrow I'll clean up the code and upload the source of the new version.
Did you visit the Wine Merchant's Basement? And heard about the Awakening of Taarnab?
Re: Moving NPC's v0.3 (incl source)
That sounds awesome. I think clicking will feel most natural for starting a conversation
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
- Message me to join in!
Re: Moving NPC's (incl source)
The source has been uploaded, with an example that shows the use of all functions:
- Create NPCs by either placing them on a spot in the editor or through code
- Define a pre-defined route for the NPC to walk. Repeatable if you want to
- Define a function that gets called when the player clicks on an NPC
- Another function can be set to be called when clicks on an NPC while having an item on the cursor. It gives the item to the npc that way
Please take a look at the demo, the source and let me know if you think it's usefull. (link is on the first page of this topic)
If you find bugs or want things different, please post it here.
- Create NPCs by either placing them on a spot in the editor or through code
- Define a pre-defined route for the NPC to walk. Repeatable if you want to
- Define a function that gets called when the player clicks on an NPC
- Another function can be set to be called when clicks on an NPC while having an item on the cursor. It gives the item to the npc that way
Please take a look at the demo, the source and let me know if you think it's usefull. (link is on the first page of this topic)
If you find bugs or want things different, please post it here.
Did you visit the Wine Merchant's Basement? And heard about the Awakening of Taarnab?
Re: [Source] Easy to use NPC script (interaction, walking)
I was wondering something, I have this custom monster which is basicly a retextured ogre, would it be possible to make this work with it as long as I change the names and directories, or is it something even deeper that keeps the other monsters from being used with this.
Will I have to change the texture of the ogre itself if I want a custom textured ogre NPC, or can I make a custom one, identical with the ogre, just retextured?
Will I have to change the texture of the ogre itself if I want a custom textured ogre NPC, or can I make a custom one, identical with the ogre, just retextured?
Re: [Source] Easy to use NPC script (interaction, walking)
valley609 wrote:I was wondering something, I have this custom monster which is basicly a retextured ogre, would it be possible to make this work with it as long as I change the names and directories, or is it something even deeper that keeps the other monsters from being used with this.
Will I have to change the texture of the ogre itself if I want a custom textured ogre NPC, or can I make a custom one, identical with the ogre, just retextured?
If you have a retextured ogre, you should be able to get away by doing the following stuff:
0) Make sure you have your monster defined (I assum it's called myOgre in this example)
1) Open the md_npc\scripts\monsters.lua in a text editor
2) Find the definition of "md_npc_ogre"
3) Change the line: "baseObject = "ogre",
Into: "baseObject = "myOgre",
4) Save the file
After the modifications above the ogre should be replaced by your retextured ogre.
If you need any more help, feel free to post or msg me.
Did you visit the Wine Merchant's Basement? And heard about the Awakening of Taarnab?
Re: [Source] Easy to use NPC script (interaction, walking)
It works great, thank you so much.mahric wrote:
If you have a retextured ogre, you should be able to get away by doing the following stuff:
0) Make sure you have your monster defined (I assum it's called myOgre in this example)
1) Open the md_npc\scripts\monsters.lua in a text editor
2) Find the definition of "md_npc_ogre"
3) Change the line: "baseObject = "ogre",
Into: "baseObject = "myOgre",
4) Save the file
Btw, your script is amazing.
Re: [Source] Easy to use NPC script (interaction, walking)
Could this be used as a shop for buying and selling?
LordGarth
LordGarth
Dungeon Master and DOOM will live forever.
Re: [Source] Easy to use NPC script (interaction, walking)
This script has nothing to do with buying and/or selling itself.LordGarth wrote:Could this be used as a shop for buying and selling?
LordGarth
Theoretically it can be expanded to incorporate buying and/or selling, but it would have to be build from the ground up.
The only thing you can re-use is the start of the interaction (e.q. player clicks on the npc to start trading or gives an item to sell).
If you're looking for a quick solution I think there are other buy/sell scripts floating around somewhere.
Did you visit the Wine Merchant's Basement? And heard about the Awakening of Taarnab?
Re: [Source] Easy to use NPC script (interaction, walking)
I will have to check but I dont think they are compatible with skyscript framework.
LordGarth
LordGarth
Dungeon Master and DOOM will live forever.
Re: [Source] Easy to use NPC script (interaction, walking)
woww
I'm not sure what you are all doing here peoples!
are you programming grimrock 2 or something?
nice job!
I'm not sure what you are all doing here peoples!
are you programming grimrock 2 or something?
nice job!