Monster Grapples: Difference between revisions

From Gothongs Wiki
Jump to navigationJump to search
Panda (talk | contribs)
Panda (talk | contribs)
Line 28: Line 28:
#define cf$GRAPPLE_NO_QTE // bool - No QTE. call grappleEnd manually
#define cf$GRAPPLE_NO_QTE // bool - No QTE. call grappleEnd manually
#define cf$GRAPPLE_FAIL_TIMEOUT // float - On failable grapples, wait this long before unsitting the player.
#define cf$GRAPPLE_FAIL_TIMEOUT // float - On failable grapples, wait this long before unsitting the player.
</pre>Next you should define event handlers:<pre>
</pre>
 
Next you should define event handlers:
<pre>
#define grappleOnStart() // A grapple has been started but players may not be seated. You may use this to turn off custom NPC logic.
#define grappleOnStart() // A grapple has been started but players may not be seated. You may use this to turn off custom NPC logic.
#define grappleOnSeated() // All players are seated. You can now trigger animations! Get the players with gotMonsterGrapple$getTargs()
#define grappleOnSeated() // All players are seated. You can now trigger animations! Get the players with gotMonsterGrapple$getTargs()
Line 35: Line 38:
#define grappleOnButton(key victim_hud, bool success) // Used a classic QTE and the player hit a button
#define grappleOnButton(key victim_hud, bool success) // Used a classic QTE and the player hit a button
#define grappleOnClientAnim(str npcAnim, list playerAnims) // Raised when client triggers an animation on the host. Raised on both host and client.
#define grappleOnClientAnim(str npcAnim, list playerAnims) // Raised when client triggers an animation on the host. Raised on both host and client.
</pre>A basic way of doing it is something like this<pre>
</pre>
 
A basic way of doing it is something like this
 
<pre>
#define grappleOnStart() grappleOnStart()
#define grappleOnStart() grappleOnStart()
grappleOnStart(){
grappleOnStart(){

Revision as of 17:40, 5 April 2024

GoThongs 2.3 introduced a dedicated grapple handler to help offload the hard-coded monster grapples that already exist. Here is a primer on how to use the system together with got LocalConf.NPC.template

Terminology

  • Grapple: A monster grabs one or more players, forcing them to sit on the object and is usually accompanied by a quick time event and some kind of status effect.
  • Quick time event: The keypad that pops up on your screen. Can be either "tap specific keys" or "tap left-right alternating". The alternating mode can also be set to allow fail.
  • Hookup: A quick time event where two monsters gang up on one player.
  • Hookup Host: The monster that grapples a player (PC) in a hookup.
  • Hookup Client: The monster that joins the host in a hookup.
  • Hostname: A unique identifier for the host that is used by the client to tell if they can join or not.

Any NPC that should be able to grapple MUST have the optional got MonsterGrapple script in its inventory.

Setting up a grapple

If you want the monster to grapple one or more players. Note that this step is not needed if you only want your NPC to be a client for hookups.

Start by defining any of these that you want to use in your got LocalConf.NPC.template script. If not defined, the default values are used.

#define cf$GRAPPLE_FLAGS				// int - Grapple settings flags. These are the flags used by got Evts quick time events to set things like left/right events.
#define cf$GRAPPLE_DURATION				// float - Grapple max duration = 300. Max duration before force releasing the players.
#define cf$GRAPPLE_PREDELAY				// float - Grapple predelay = 0. Time before starting the QTE after grapple starts.
#define cf$GRAPPLE_BUTTON_DELAY			// float - Grapple button delay = 0. Used in normal QTEs to set a delay before buttons.
#define cf$GRAPPLE_STAGES				// int - QTE stages, alternatively speed for quick grapples. = 30
#define cf$GRAPPLE_MONSTERFLAGS			// int - Monster to set when grapple starts and unset when it ends = Monster$RF_IMMOBILE|Monster$RF_PACIFIED|Monster$RF_NOROT|Monster$RF_NO_SPELLS
#define cf$GRAPPLE_STRIP 				// bool  - Strip clothes during the grapple
#define cf$GRAPPLE_NO_QTE				// bool - No QTE. call grappleEnd manually
#define cf$GRAPPLE_FAIL_TIMEOUT			// float - On failable grapples, wait this long before unsitting the player.

Next you should define event handlers:

#define grappleOnStart()									// A grapple has been started but players may not be seated. You may use this to turn off custom NPC logic.
#define	grappleOnSeated()									// All players are seated. You can now trigger animations! Get the players with gotMonsterGrapple$getTargs()
#define grappleOnEnd()					
#define grappleOnQteFinish(bool success)					// 
#define grappleOnButton(key victim_hud, bool success)		// Used a classic QTE and the player hit a button
#define grappleOnClientAnim(str npcAnim, list playerAnims)	// Raised when client triggers an animation on the host. Raised on both host and client.

A basic way of doing it is something like this

#define grappleOnStart() grappleOnStart()
grappleOnStart(){
    qd("I have started a grapple!");
}

Todo...