NPCs

General debates and discussion about the Guild of Writers and Age creation

Re: NPCs

Postby D'Lanor » Tue Jun 22, 2010 6:55 am

diafero wrote:Yes, I could change the Python to only call PtLoadAvatarModel() if nobody else is in the age - and IIRC I then even see the quabs spawned by the person linking in first. However, when I get close to them, they don't run away - my client has no knowledge about them, at least not in Python, it can not observe them (to update the clock) or anything. MOUL got new Python events for that (some new On* function).
And when the spawner leaves, it will take the quabs with it, even though other players are left in the age.

I guess now we are getting into really deep waters, but you could use AvatarPage() to detect incoming avatars and then make that first player (the game owner) send out a notify message containing the quab keys.
And doesn't disabling "PtUnLoadAvatarModel(quabKey)" prevent the game owner from taking the quabs away?
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: NPCs

Postby diafero » Tue Jun 22, 2010 12:41 pm

I did not dig deeper back then, mainly because testing is a pain because I need two peope, two PCs or at least two Uru installations running on the same PC. But I got under the impression that the quab unloading is not triggered by Python.
Oh, and how can I send keys over the net?

As for normal NPCs, that sounds fine... except for when someone links in while the NPC animation plays, but I think that case can be neglected.
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2972
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Re: NPCs

Postby D'Lanor » Tue Jun 22, 2010 1:04 pm

diafero wrote:Oh, and how can I send keys over the net?


My book template has an example of it. It does something like this:

Code: Select all
            note = ptNotify(self.key)
            note.clearReceivers()
            note.addReceiver(self.key)
            note.setActivate(1)
            note.addVarNumber('a text string we do not use', someKey)
            note.netPropagate(1)
            note.netForce(1)
            note.send()


And the other clients catch it here:

Code: Select all
    def OnNotify(self, state, id, events):
        for event in events:
            if (event[0] == kVariableEvent):
                someKey = int(event[3])
                # next do something with the key
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: NPCs

Postby diafero » Wed Jun 23, 2010 4:31 am

That's interesting, thanks for the snippet.
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2972
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Previous

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests

cron