Aller au contenu

Photo

Help: My NPC Group isn't a Group. Why not?


  • Veuillez vous connecter pour répondre
7 réponses à ce sujet

#1
ColorsFade

ColorsFade
  • Members
  • 1 271 messages
I have three skeletons painted down in a room. I gave them all unique Tags (because I thought maybe that was the issue). I select them all at once and assign a Group Name to them.

Now I have a trigger in the room that the PC crosses. If fires a script that is supposed to switch the factions of the skeletons to Hostile (they start out non-hostile for a reason). But, they don't, because apparently they are not in a group. 

ListMembersOfGroup() method from the Group library reports they are not in a group. Also, I grabbed one of the Skeletons by his tag and call GetGroupName() on him. It returns empty. 

Is this a known bug? Can you not add painted down NPC's to a Grou this way? 

Previously, I've only added NPC's to groups through scripts, and that has always worked. I thought this would be easier, but it's not working. 

#2
Morbane

Morbane
  • Members
  • 1 883 messages
the group option is only for placeables - to make prefabs

Modifié par Morbane, 19 mars 2013 - 05:27 .


#3
ColorsFade

ColorsFade
  • Members
  • 1 271 messages

Morbane wrote...

the group option is only for placeables - to make prefabs


Gah! Bogus...

Oh well. Thanks for letting me know. I have a second approach that will be almost as easy. 

Thanks!

#4
Morbane

Morbane
  • Members
  • 1 883 messages
another thing about grouped prefabs - they cannot be spawned via create object - nothing will happen.

#5
ColorsFade

ColorsFade
  • Members
  • 1 271 messages
No sweat.

I try and spawn as little as possible. I like my areas crafted... I place almost everything, unless I want
something to appear as part of a deliberate event, like a spell being cast or corpses rising from the grave.

One thing I like about the Toolset is there's more than one way, usually, to skin a cat with it. You can spawn stuff or place stuff, you can do most things through conversation checks and actions, or you can script stuff. As a programmer, I prefer scripting, but I keep running into issues simply because of lack of knowledge (example: it seemed intuitive to me, since the toolset GUI allowed it, for me to group NPC's and give them a group name, and then use that Group Name to manipulate their Faction).

It's all good though. I got what I wanted to work.

Rooms full of hostile NPC's, in confined quarters like crypts, annoyed me in the OC because they perceive you before the door is open. They rush the door and it becomes a clusterf*ck at the door,
with only a couple of your PC's, if you're lucky, being able to fight.

I wrote a script to alleviate that problem by making the NPC's a neutral faction at first, and then as the PC crosses a trigger inside the room, they turn hostile. It gives the party a chance to get into the room before all hell breaks loose.

I wanted to make the script generic so I don't have to write a custom script for every room that I want to work this way. I was hoping if I simply set the Groupname as a string variable on the trigger, my script could use that plus the Group functions in the toolset to switch factions. But since it doesn't work that way, I got around it.

Instead, I make sure the NPC's in the room have their tags follow a naming convention, and then I provide two variables on the Trigger. One to tell the script what tag prefix to look for, and the other integer variable to tell the script how many NPC's to look for in the room.

It works the way I want to and setting up additional rooms is a snap now. As long as you follow a naming convention for the NPC's and make sure their tag prefix is unique, it's a breeze.

And now I don't have to fight at the damn door anymore...

#6
Morbane

Morbane
  • Members
  • 1 883 messages

ColorsFade Wrote...

...there's more than one way, usually, to skin a cat...


Have a problem with cats?

Seriously though, I agree - solving problems with the TS can be addicting.

#7
ColorsFade

ColorsFade
  • Members
  • 1 271 messages

Morbane wrote...

ColorsFade Wrote...

...there's more than one way, usually, to skin a cat...


Have a problem with cats?


LOL... nope. Got mine sitting on my lap about 10x a day. 

Yeah, this toolset is nice. Making my dreams come true. 

#8
kevL

kevL
  • Members
  • 4 078 messages
btw, groups ( as in 'ginc_groups' ) should work, and does sometimes work for hostile creatures


see also.