Page 1 of 1

Interaction With NPCs - help me!

Posted: March 9th, 2010, 6:46 am
by malkin61
Hi all,

Just started using sandbox and I'm intending to use it at the college I teach at for my next unit - Computer Games Development. In order to teach effectively I need to know more than the students and be able to help them get the most out of sandbox and actually build the games they design.

I'm ok with making maps and I'm currently building a spaceship map. I've figured out how to open doors thanks to a post on here. But I am completely at a loss when it comes to creating / spawning NPCs that I can interact with. Someone has posted some code here for making a guard you can talk to but I don't even know where it goes! :oops:

So, are there any books or publications I can get at to help me with this - and I guess all the other hundreds of questions I'm going to get asked....?

If anyone wants to post some help as well it will gratefully recieved :)

Thanks

Malk

Re: Interaction With NPCs - help me!

Posted: March 9th, 2010, 10:03 am
by arcones
Hi Malk!

Usually you would create a cfg with the same name as your map. So, "yourmapname.cfg" (ie "City.cfg")
I haven't tried that myself (it's been posted somewhere else on the forum).

I use F6 (or F7 I can't remember which button it is... :oops: ) which pulls up the cfg in game so that I can work on it there. Any other code you create would be written in the cfg as well.
NOTE: Unless you have the development version of Sandbox the NPC chat won't work without some rearranging. (for the reason r_face doesn't work yet)

I hope that helps Malk!

Arc :geek:

BTW Three-hundredth post!!!!!! WOOT :D

Re: Interaction With NPCs - help me!

Posted: March 11th, 2010, 12:03 pm
by malkin61
Thanks for the response Arc.

I still don't understand. How do I define where my npc will spawn? And what is the script I use? And what if there's aready a cfg named after your map? Beginning to think I've biten off more than I can chew here. Everyone says how easy it is, but it doesn't feel that right now!

Re: Interaction With NPCs - help me!

Posted: March 11th, 2010, 7:16 pm
by arcones
Hey, don't worry Malk! I had this trouble for the longest time! :) I haven't gotten on SB for a week or more so I can't remember for sure which F6 or F7 it is... but then start typing the code in there, and when you're done, click save. (BTW a green screen pops up and at the top it says notepad)

The script used is Cubescript. And you definitely have to wrestle with it :D I haven't worked much with the NPC chat because I don't have the dev version... :(

As for the NPC, it is has been my opinion that you spawn the NPC somewhere on the map yourself... i.e. I'm gonna place NPC Bob on top of the wall. Then I'm going to write the code in, name the NPC in the coding "Bob" and hopefully it'll work :P
I really hope that helps!

Arc :geek:

P.S. I'll try to look for more info on this topic!

Re: Interaction With NPCs - help me!

Posted: March 12th, 2010, 4:33 am
by malkin61
Thanks a lot Arc - I'll try this.. Cubescript.. I have a look as well. Thanks again

Re: Interaction With NPCs - help me!

Posted: March 22nd, 2010, 12:20 pm
by arcones