Forums
Games
Cyberpunk 2077 Thronebreaker: The Witcher Tales GWENT®: The Witcher Card Game The Witcher 3: Wild Hunt The Witcher 2: Assassins of Kings The Witcher The Witcher Adventure Game
Jobs Store Support Log in Register
Forums - CD PROJEKT RED
Menu
Forums - CD PROJEKT RED
  • Hot Topics
  • NEWS
  • GENERAL
    THE WITCHER ADVENTURE GAME
  • STORY
    THE WITCHER THE WITCHER 2 THE WITCHER 3 THE WITCHER TALES
  • GAMEPLAY
    THE WITCHER THE WITCHER 2 THE WITCHER 3 MODS (THE WITCHER) MODS (THE WITCHER 2) MODS (THE WITCHER 3)
  • TECHNICAL
    THE WITCHER THE WITCHER 2 (PC) THE WITCHER 2 (XBOX) THE WITCHER 3 (PC) THE WITCHER 3 (PLAYSTATION) THE WITCHER 3 (XBOX) THE WITCHER 3 (SWITCH)
  • COMMUNITY
    FAN ART (THE WITCHER UNIVERSE) FAN ART (CYBERPUNK UNIVERSE) OTHER GAMES
  • RED Tracker
    The Witcher Series Cyberpunk GWENT
THE WITCHER
THE WITCHER 2
THE WITCHER 3
MODS (THE WITCHER)
MODS (THE WITCHER 2)
MODS (THE WITCHER 3)
Menu

Register

TnZ Scripting Tricks FAQ

+
Prev
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
Next
First Prev 5 of 7

Go to page

Next Last
N

nandusso

Senior user
#81
Sep 5, 2008
As an "invisible wall" you can use also the object ob_pictrhob01. It has the collision line longer than the visible object on the lower part, so you can turn it upside-down and hide it under the floor or the ground ;D. It's very thin, I've used three of them to prevent Geralt and the npcs from walking through my "ghostly" ob_chairhobxx (the one modified so it doesn't load the pwk file, as by Ailinon hint).byesince patch 1.4 this no longer works.
 
A

ailinon

Senior user
#82
Sep 17, 2008
It came up in the Polish forums, thought I'd share.Three useful functions. One for removing nCount items from someone's inventory, one for calculating the count of items in there, and one for bestowing a truckload of items onto an unsuspecting victim. Here goes:
Code:
// Remove up to nCount items matching tag sTag from oOwner's inventory.// Return the number of items actually removed.int RemoveCountItems (object oOwner, string sTag, int nCount) {	object oItem = GetFirstItemInInventory(oOwner);		int nStack;	int nRemoved=0;	while (nCount>0 && oItem!=OBJECT_INVALID) {		if (CompareTags(GetTag(oItem),sTag)) {			nStack = GetItemStackSize(oItem);			if (nCount>=nStack) {				nCount-=nStack;				DestroyObject(oItem);				nRemoved+=nStack;			} else {				SetItemStackSize(oItem,nStack-nCount);				nRemoved+=nCount;				break;			}		}		oItem = GetNextItemInInventory(oOwner);	}	return nRemoved;}// Return the number of stackable items matching tag sTag in oOwner's inventory.int GetItemCount (object oOwner, string sTag) {	object oItem = GetFirstItemInInventory(oOwner);		int nCount;	while (oItem!=OBJECT_INVALID) {		if (CompareTags(GetTag(oItem),sTag)) {			nCount+=GetItemStackSize(oItem);		}		oItem = GetNextItemInInventory(oOwner);	}	return nCount;}// Create multiple items in oTarget basing on sItemTemplate, REGARDLESS of allowed stack size. Multiple stacks will be created as needed.int CreateManyItemsOnObject (string sItemTemplate,object oTarget=OBJECT_SELF,int nStackSize=1) {	int i;	for (i=0;i
 
S

sinner_rm

Senior user
#83
Sep 18, 2008
I made a weapon with the editor and would like to know how to make it do more damage, I'am guessing it would be through a script.
 
N

nandusso

Senior user
#84
Sep 20, 2008
Hallo, :)Someone knows if there's a function to get the language which the game is installed?bye
 
A

ailinon

Senior user
#85
Sep 21, 2008
There doesn't seem to be one - but maybe we can work something out. Why do you need that function?
 
N

nandusso

Senior user
#86
Sep 21, 2008
Sorry, yesterday I was a bit confused, don't you loose time!I wanted when Geralt entered a trigger it showed some words, but I saw that SpeakOneLinerConversation instead of SpeakString, works as well.bye.......only if you already know this, what is related the int we have to put in SpeakStringByStrRef? I saw the file dlg_ids.2da but it seems has nothing to do.
 
A

ailinon

Senior user
#87
Sep 21, 2008
All StrRefs used in various functions refer to lines in the dialog_*.tlk file. Editable using TlkEdit (google it up).
 
R

ralf1731

Senior user
#88
Oct 4, 2008
@Ailinon object oPC = GetFirstPC();if (!GetLocalInt(oPC,"SCRIPT_ALREADY_RAN")) { // run script... SetLocalInt(oPC,"SCRIPT_ALREADY_RAN",1);}
Click to expand...
I think it is a very usefull script, especially for triggers or OnHeartbeat.I do this in the following way:1. Set all Variables in the Module_propertiesF.E.: SetLocalInt(GetFirstPC(),"SCRIPT_ALREADY_RAN",1);2. If i want run a trigger only 1 time and not again after repeated Enter, i do following:if (!GetLocalInt(GetFirstPC(),"SCRIPT_ALREADY_RAN") == 1) { // run script... SetLocalInt(GetFirstPC(),"SCRIPT_ALREADY_RAN", 2);}
 
A

ailinon

Senior user
#89
Oct 4, 2008
That's the same, only setting variables to "1" is unnecessary - non-existing variables work as if they were 0, or false. That's why your !GetLocalInt(...)==1 is a bit of a logical overkill.
 
U

username_2075278

Senior user
#90
Oct 4, 2008
Ailinon said:
That's the same, only setting variables to "1" is unnecessary - non-existing variables work as if they were 0, or false. That's why your !GetLocalInt(...)==1 is a bit of a logical overkill.
Click to expand...
Seriously, one of the main problems with the D'Jinni version of Aurora are there are too many mechanisms for maintaining state. You can maintain state through global dialogue flags, through journal entries, and through local variables set on characters. I strongly advise caution because you can get into an incoherent mess. Furthermore, global dialogue flags are easy to set and read in scripts, and also easy and cheap to use in dialogues (but don't work at all for quests). Journal entries are easy to use in quests and scripts but awkward (not impossible) in dialogues.My strong advice is that you should not use object local variables for maintaining game state. I also recommend you have one dialogue flag for each journal article, and that the dialogue flag tag and journal article tag should be identical; and that your setter scripts you use set both, so as to as far as possible keep them in sync.This means that setting state from a dialogue is still awkward (you have to run an action script) but reading state in dialogues and quest definitions is easy.
 
R

ralf1731

Senior user
#91
Oct 5, 2008
Thanks for the help. I thought so that i can set flags anyway, but works not in every case, i think.Flags can only set true or false, i guess. But sometime i need 3 or more queries.And i can set flags only in dialogs?! I set this flags only in dialog and in script you canask for...Pls could somebody give me all the script-flag-commands? I dont know that in NWN.edit: Do i understand right? if "(!GetLocalInt(oPC,"SCRIPT_ALREADY_RAN"))" compares if the variable == 0 ??
@AilinonThe ! mark turns that 0 into a 1 (logical "not"). "If" gets a 1 and treats it as "true".
Click to expand...
Thats usefull for me, especially the meaning of "!". tx
 
A

ailinon

Senior user
#92
Oct 5, 2008
Yes.Precisely, GetLocalInt returns the value of the variable, or 0 if the variable doesn't exist.The ! mark turns that 0 into a 1 (logical "not"). "If" gets a 1 and treats it as "true".Basically, this reads, in horrible grammar, "if not variable_has_nonzero_value, then..." .-- Sinus
 
N

nandusso

Senior user
#93
Oct 8, 2008
Hallo, I'm trying to make my witcher to meditate with crossed legs (even if in the animation the back is not upright ;))void meditacross(){ ActionMoveToObject(GetWaypointByTag("meditate")); ActionPlayAnimation(3,1.0,3.0);//first int 3=ANIMATION_LOOPING_MEDITATE, 7=ANIMATION_LOOPING_SIT_CROSS ActionDoCommand(ForceCharacterDevelopment());// but for to open meditate panel? ActionDoCommand(SetCommandable(TRUE)); SetCommandable(FALSE);}void main(){ ClearAllActions(FALSE,GetFirstPC()); AssignCommand(GetFirstPC(),meditacross());}If I put 7 instead of 3 the animation doesn't work, even if I can see it editing the witcher model, and for to open the meditate panel? Does someone know if there is a command like ForceCharacterDevelopment()?I would like he was able to meditate both ways, so I didn't think to edit the cr_witch.mdb files changing the meditate animation( supposing that it was the solution).bye
 
G

Gamewidow

Forum veteran
#94
Oct 8, 2008
http://djinni.wikia.com/wiki/ForceCharacterDevelopmentthat command exists, but there's not much documentation as you can see :wave:
 
N

nandusso

Senior user
#95
Oct 8, 2008
Thanks for the answer :), but I would need something like "ForceMeditatePanel"(for example).I think only the developers can know it.bye
 
R

ralf1731

Senior user
#96
Oct 8, 2008
If you could decompile the "ob_fireonuse.ncs" or extract the "ob_fireonuse.nss", we would know more about,i guess. I tried it with "nwnnsscomp.exe" and other script-tools for the aurora, but my skills are not good enough ???
 
N

nandusso

Senior user
#97
Oct 8, 2008
I remember to have heard that the compile-decompiling tools originally for neverwinter nights don't work with the witcher, otherwise it would be a "scoop" that can't go unobserved in this forum.And for the animation that doesn't work, have you idea why?bye
 
R

ralf1731

Senior user
#98
Oct 9, 2008
You are right, the animation of the pc dont work, except the meditate-loop.I cant remember that the witcher did in the game ever an other animation except meditata...I tried all, but nothing works (not any of the animation):AssignCommand(GetFirstPC(), ClearAllActions());AssignCommand(GetFirstPC(), ActionPlayAnimation (7, 1.0, 30.0));orAssignCommand(GetFirstPC(), ActionPlayAnimation (ANIMATION_LOOPING_SIT_CROSS, 1.0, 30.0));or AssignCommand(GetFirstPC(), PlayAnimation (7, 1.0, 30.0));orAssignCommand(GetFirstPC(), PlayAnimation (ANIMATION_LOOPING_SIT_CROSS, 1.0, 30.0));all compiles fine, but didnt work.Edit 1:Maybe you can test with a NPC too:eek:bject oNPC = GetObjectByTag("npc");AssignCommand(oNPC, ClearAllActions());AssignCommand(oNPC, ActionPlayAnimation (7, 1.0, 30.0));But i guess it doesnt work. that all is going to do with story-sets and with actions...Edit 2: No - i was wrong, a few other animations should work. For example:AssignCommand(GetFirstPC(), ClearAllActions());AssignCommand(GetFirstPC(), PlayAnimation(ANIMATION_LOOPING_DEAD_FRONT, 1.0, 20.0));DelayCommand(0.2,SetCommandable(FALSE, GetFirstPC()));DelayCommand(5.0,SetCommandable(TRUE, GetFirstPC()));
 
N

nandusso

Senior user
#99
Oct 9, 2008
I've tried all the ANIMATION_LOOPING and work the numbers 3,12,13,16,17,27,28,29. And this also for NPCs at least till number 7.Anyway I've tried to import into module and modifing the file cr_witch1.mdb that refers to cm_witch1.mdb (the one with the white shirt) and now my witcher meditates only with crossed legs (ActionRest).I think: when, in-game, Geralt put on an armor then the game switches to file cm_witch2,3,4..., if it was possible to do this by script I could put into module a file cr_witch1a.mdb for the "crossed-meditation" and change to it in some places. Except that I haven't any idea how to write the script...I know that we should concentrate on creating the story... but I like fully enjoing the modding experience............................any help from heaven? ;Dbye
 
R

ralf1731

Senior user
#100
Oct 9, 2008
Hmm, that sounds great, if you can add some animation, it doesnt matter which way... im not a pro.ya - you are right, i should begin with my story too, but that stupid soundproblem drives me crazy.Maybe i buy NWN2 and try it there... :-\
 
Prev
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
Next
First Prev 5 of 7

Go to page

Next Last
Share:
Facebook Twitter Reddit Pinterest Tumblr WhatsApp Email Link
  • English
    English Polski (Polish) Deutsch (German) Русский (Russian) Français (French) Português brasileiro (Brazilian Portuguese) Italiano (Italian) 日本語 (Japanese) Español (Spanish)

STAY CONNECTED

Facebook Twitter YouTube
CDProjekt RED Mature 17+
  • Contact administration
  • User agreement
  • Privacy policy
  • Cookie policy
  • Press Center
© 2018 CD PROJEKT S.A. ALL RIGHTS RESERVED

The Witcher® is a trademark of CD PROJEKT S. A. The Witcher game © CD PROJEKT S. A. All rights reserved. The Witcher game is based on the prose of Andrzej Sapkowski. All other copyrights and trademarks are the property of their respective owners.

Forum software by XenForo® © 2010-2020 XenForo Ltd.