collapse

Author [EN] [PL] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: Adding new NPC's with VPK  (Read 1899 times)

Offline maherdb

  • Fledgling
  • *
  • Posts: 8
  • Reputation: +1/-0
Adding new NPC's with VPK
« on: July 10, 2013, 10:06:12 pm »
Hey, there I have recently started to get an interest into adding more quest to the game since I have the opportunity to record new dialogues for the game in a music studio.
I also convinced some people to join me so we could create more than one npc and record new dialog for at leas 4 or 5 npc's.

Now having no previous experience with Bloodlines and the way you can mod the game, I downloaded VTMB ModDevGuide, and since I have some experience with python I think the result would be pretty good.

What I was wondering; The method of creating a new entity with python as in the Guide worked fine, but when I started looking around I have seen that all of the characters wrote in the python aren't wrote like this in the python files and the spawned like in the code below.

Quote
pc = __main__.FindPlayer()
loc = pc.GetOrigin()
ent = __main__.CreateEntityNoSpawn("npc_VVampire", loc, (0,0,0) )
__main__.CallEntitySpawn(ent)

So I started looking into the maps(bsp) and found most of the characters there.
Then I thought, hey let's add a new entity here, so I copied on of the entities that I've found, like trip, and renamed the targetName, added the def myNewTrip(), on the santamonica.py, and on the map the onMapLoad, thingy. And of course the Find function so it would display the entity.

Unfortunately I have been surprised to find out that it didn't actually worked at all.
So my question is, how comes that I can edit almost anything that exists on the maps, as I want, but when I added a new entity it didn't even appeared. Did I miss something? Or it's not possible to add new content?

Maybe too many hours in front of the computer clouded my mind..

Offline Wesp5

  • Administratrix
  • Antediluvian
  • *****
  • Posts: 6730
  • Reputation: +888/-28
  • Unofficial Patcher
Re: Adding new NPC's with VPK
« Reply #1 on: July 11, 2013, 07:51:01 am »
Did I miss something? Or it's not possible to add new content?

Of course it is possible to add new NPCs with the VPKTool (the UP and other mods do it all the time)! So you must have missed something. What do you need the Python file for after you created the NPC in the map itself? How do you trigger it? What are the console error messages at the start of your new map (only the last ones matter)?

Offline maherdb

  • Fledgling
  • *
  • Posts: 8
  • Reputation: +1/-0
Re: Adding new NPC's with VPK
« Reply #2 on: July 11, 2013, 02:10:09 pm »
Ok, so on the Map:
- I copied from sm_hub1, the SMblueblood npc, and pasted it in the sm_pawnshop_1.
- Then I renamed the targetname, removed "OnDialogEnd" ",,,0,-1,bluebloodToAlley(),", added "OnMapLoad" ",,,0,-1,myLittleTryout(),", and changed the origin, to a valid position from the sm_pawnshop_1, so the character would be in front of me.

In santamonica.py I added:

Quote
#Testing
def myLittleTryout():
   meh = Find("Maher")


This is from the console. I didn't install any of the UP, I would like to do so, but I don't know if I am allowed to use them for my mod since I didn't asked for permission.

Quote
Loading game from SAVE\sm_pawnshop_1.HL1...
Traceback (most recent call last):
  File "<string>", line 1, in ?
NameError: name 'sm_pawnshop_1_patch' is not defined
Exhausted signon buffer. Skipping remaining baselines (ents 171 - 260).
Can't find factory for entity: vdisciplineprojectile
NULL Ent in UTIL_PrecacheOther: vdisciplineprojectile
Invalid camera shot index

Offline Wesp5

  • Administratrix
  • Antediluvian
  • *****
  • Posts: 6730
  • Reputation: +888/-28
  • Unofficial Patcher
Re: Adding new NPC's with VPK
« Reply #3 on: July 11, 2013, 08:24:08 pm »
Ok, so on the Map:
- I copied from sm_hub1, the SMblueblood npc, and pasted it in the sm_pawnshop_1.
- Then I renamed the targetname, removed "OnDialogEnd" ",,,0,-1,bluebloodToAlley(),", added "OnMapLoad" ",,,0,-1,myLittleTryout(),", and changed the origin, to a valid position from the sm_pawnshop_1, so the character would be in front of me.

So far so good. But how did you find out a valid position? And did you save the map and got an AI message when you entered it?

Quote
This is from the console.

Looks okay too and there are no unusual error message in the console...

Quote
I didn't install any of the UP, I would like to do so, but I don't know if I am allowed to use them for my mod since I didn't asked for permission.

You can use the patch for your mod if you want, if you give proper credits and include the patch readme. I would suggest you do so, because I bet nobody would play a mod not based on it anyway and you would run into long fixed bugs sooner or later...
« Last Edit: July 12, 2013, 09:39:30 am by Wesp5 »

Offline maherdb

  • Fledgling
  • *
  • Posts: 8
  • Reputation: +1/-0
Re: Adding new NPC's with VPK
« Reply #4 on: July 11, 2013, 11:44:02 pm »
I used pc = __main__.FindPlayer(), and then pc.GetOrigin() in the game console  to find the position that I wanted.

Yes I did save the map, and the AI message was: Node Graph out of date. Rebuilding...

I've also noticed a difference from the last time in the console and now.

Quote
Loading game from SAVE\sm_pawnshop_1.HL1...
could not load key values from particles/D_partial_resist_dom_fx1.txt
could not load spawned particle D_partial_resist_dom_fx1
Unable to load data for: vdata\quotes.txt
loading santa monica level script
levelscript loaded
Traceback (most recent call last):
  File "<string>", line 1, in ?
NameError: name 'sm_pawnshop_1_patch' is not defined
Exhausted signon buffer. Skipping remaining baselines (ents 171 - 260).
--- Missing Vgui material hud/inven_glock
Encountered a non-standard vertex format (183 3 1)
Encountered a non-standard vertex format (183 3 1)
Encountered a non-standard vertex format (105 0 2)
Can't find factory for entity: vdisciplineprojectile
NULL Ent in UTIL_PrecacheOther: vdisciplineprojectile
Missing wav file 'Weapons/Melee/Fists/Stealth_Kill_Failure.wav'
Missing wav file 'weapons/switch_single.wav'
Missing wav file 'weapons/switch_burst.wav'
Missing wav file 'weapons/fists/swing.wav'
Missing wav file 'weapons/fists/botch.wav'
Invalid camera shot index

The part with encountered a non-standard vertex format a problem?
BTW, I tried to remove the fridge, thought maybe I am not doing something right. Found out that the fridge was still there, even tough the code for it has been removed. Maybe when I press the write new data button in the map editor, it just doesn't save my changes...

Aside from the VPK Tool, how else could I change things from a bsp map?

Offline Wesp5

  • Administratrix
  • Antediluvian
  • *****
  • Posts: 6730
  • Reputation: +888/-28
  • Unofficial Patcher
Re: Adding new NPC's with VPK
« Reply #5 on: July 12, 2013, 10:05:23 am »
I used pc = __main__.FindPlayer(), and then pc.GetOrigin() in the game console  to find the position that I wanted.

Looks fine...

Quote
Yes I did save the map, and the AI message was: Node Graph out of date. Rebuilding...

...and this too.

Quote
I've also noticed a difference from the last time in the console and now.

Still normal messages, a lot of them have long been fixed by the UP!

Quote
The part with encountered a non-standard vertex format a problem?

Not that I know off.

Quote
Maybe when I press the write new data button in the map editor, it just doesn't save my changes...

Could indeed be possible. Are your maps write protected? You could just check their date and time...

Quote
Aside from the VPK Tool, how else could I change things from a bsp map?

Only by decompiling it, editing it in Hammer and then recompiling it, which is a lot of work.

Offline maherdb

  • Fledgling
  • *
  • Posts: 8
  • Reputation: +1/-0
Re: Adding new NPC's with VPK
« Reply #6 on: July 12, 2013, 11:16:57 am »
I don't believe that they are write protected since it says that it has been modified July 12 2013.

OK, maybe I have been to fixed on adding an npc into the player's haven.
Now I tried to add one in the santa monica hub map. and worked just fine. Now I don't get it why I can't modify absolutely nothing on the sm_pawnshop_1.bsp, it doesn't bother me so much, but how comes that it exists an entity of heather on the map,
Spoiler for Hiden:
which appears later on in the game
, and every time I "write new data", everything looks fine, it's not like the added code disappears...

Maybe I'll figure it out, have you ever tried to change something on the pawnshop map? Did it work? Just curious, maybe it always had a problem, yet it doesn't really make too much sense...

Anyway thank you for taking your time, for helping me figure it out!

Offline Wesp5

  • Administratrix
  • Antediluvian
  • *****
  • Posts: 6730
  • Reputation: +888/-28
  • Unofficial Patcher
Re: Adding new NPC's with VPK
« Reply #7 on: July 12, 2013, 09:42:48 pm »
Maybe I'll figure it out, have you ever tried to change something on the pawnshop map?

Of course. Maybe you copied a NPC like Heather which had the starthidden flag set to 1...

 

SimplePortal 2.3.7 © 2008-2020, SimplePortal