Custom script functions

Here you can find a list of custom script functions which were written by other users.
You can find a list of original script functions here.
Discuss the content of this page you can here.

How to use this functions?

1. Go to Witcher 2\bin\scripts folder.
2. Find there a *.ws file and make a copy of it.
3. Copy desirable functions from this page and paste them to a file.
4. Open REDkit and go to any Quest-file.
5. Click right mouse button -> Scripting -> Script.
6. Choose a function from functionName list.


Let us begin.


Name: Milten_ShowBossHpBar
Is used for: showing NPCs healthbar in the center of screen (like if he is a boss)
Available for use in: Quest files
Properties:

  • bossTag - the tag of NPC, which healthbar you want to show in the center of screen

Text of function:

quest latent function Milten_ShowBossHpBar(bossTag:name)
{		
	var actor: CRiszon;
	actor  = (CRiszon)theGame.GetActorByTag(bossTag);
	actor.StartBossFight();
}


NOTE: an NPC has to be CRiszon type (Template properties tab in its Entity Template file).

Name: Milten_HideBossHpBar
Is used for: hiding NPCs healthbar
Available for use in: Quest files
Properties:

  • bossTag - the tag of NPC, which healthbar you want to hide

Text of function:

quest function Milten_HideBossHpBar(bossTag:name)
{
	var actor: CRiszon;
	actor  = (CRiszon)theGame.GetActorByTag(bossTag);
	actor.EndBossFight();
}


NOTE: an NPC has to be CRiszon type (Template properties tab in its Entity Template file).

Name: Milten_TransferFromPlayerToChest
Is used for: transfering all the player charater's items to a chosen container
Available for use in: Quest files
Properties:

  • containerTag - the tag of container, where all the items will be transfered

Text of function:

quest function Milten_TransferFromPlayerToChest (containerTag:name) : bool
{
	var chestTag: CContainer;
	chestTag = (CContainer)theGame.GetEntityByTag(containerTag);
	Q302TransferInvToChest(thePlayer, chestTag);
}


Name: Milten_TransferFromChestToPlayer
Is used for: transfering items from a chosen container to the player character
Available for use in: Quest files
Properties:

  • containerTag - the tag of container, which will "give" all its content to the player character

Text of function:

quest function Milten_TransferFromChestToPlayer (containerTag:name) : bool
{
	var chestTag: CContainer;
	chestTag = (CContainer)theGame.GetEntityByTag(containerTag);
	Q302TransferFromChestToGeralt(chestTag, thePlayer);
}


Name: Milten_BlinkMedallion
Is used for: making the witcher medallion (an icon in the top left corner) to blink
Available for use in: Quest files
Properties:No Properties

Text of function:

quest function Milten_BlinkMedallion()
{
		theHud.Invoke("vHUD.blinkMed");
		theSound.PlaySound("gui/hud/medalionwarning");
}