Ir al contenido

Foto

The pickpockets script


  • Por favor identifícate para responder
2 respuestas en este tema

#1
Friar

Friar
  • Members
  • 293 mensajes

I'm sure this guy is annoying to some of you, but the pickpocket near the docks is awesome. Too bad I can't look under the skirt of this mod because I'm really curious with how the script was written.

 

Anyone know?



#2
Tchos

Tchos
  • Members
  • 5.030 mensajes

Well, as I've found, the version of Mysteries of Westgate that comes with the GOG version is unencrypted.  The encryption was part of that heinous DRM that delayed MoW's release for a year and a half, but GOG insists that all of its products be DRM-free and removed it, so I can see that the pickpocket script is the following heartbeat:

// heartbeat script for ambient thieves
// .. they steal money from the locals and walk their waypoints

#include "hf_in_ambient"
#include "nw_i0_generic"

void main()
{
	// don't do anything if we have no AI
    if (GetAILevel() == AI_LEVEL_VERY_LOW)
	{
		return;
	}
	
	// steal or walk our waypoints
	// .. note that the waypoint function checks if it is "safe" to walk waypoints
	if (AmbientIsReady())
	{
		AmbientActionSteal();
	}
	else
	{
		if (GetWalkCondition(NW_WALK_FLAG_CONSTANT))
		{
			WalkWayPoints(TRUE, "heartbeat");
		}
	}
	
	// Send the user-defined event signal if specified
    if(GetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT))
    {
        SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_HEARTBEAT));
    }
}

It requires the inclusion of hf_in_ambient:

Spoiler


#3
Friar

Friar
  • Members
  • 293 mensajes

Ah, when I saw the word "unencrypted" I mistakeningly assumed it had something to do with being able to play the module itself. I see now that it refers to accessing the module in the toolset.

 

Thank you for sharing that script Tchos. It rules, and it's also surprisingly shorter than I envisioned.