This i just too weird. I cannot for the life of me, figure out why ga_scripthidden is not working now in something that I tested and got working in about 5 minutes the othernight.
Basically I have npcs that I want to ga_scripthidden (hide) when spoken to at a specific time.
Initially in my campaign i had noticed it not working so the other night I opened up my test area, made a new conversation, threw down a generic dwarf and placed the convo on him. Gave the convo 3 nodes of dialog.
(by the way I got this working in 5 minutes the other night, yet tonight after an hour and a half I cant get the same test convo working)
Here is a rough example of the test convo that i did the other night and got working, but tonight, does not work-
NPC NODE - Hi, its late i'm going home. (no actions, no conditions)
PC NODE- Goodbye. (ACTION: ga_fade_from_black = 1)
NPC NODE- END DIALOG (ACTION: ga_scripthidden, $OBJECT_SELF, 1)
That's it. The npc should not be visible after this conversation... oh the frustration :happy:
any advice welcome.
ps- Oh, tonight I have also tried (instead of $OBJECT_SELF), $OBJECT.... I then tried $LAST_SPEAKER on a PC NODE.... I then tried taking out the fade_from_black. I then tried moving the ga_scripthidden action to the first npc node.... tried other things too but the point is- Nothing seems to work anymore.
Peace:wizard:
damn you ga_scripthidden *shakes fist*
Débuté par
dickel
, avril 25 2011 07:02
#1
Posté 25 avril 2011 - 07:02
#2
Posté 25 avril 2011 - 07:22
You should put the action on the final PC node, and drop the last NPC node altogether. Make sure the NPC properties are set right, i.e. always visible to FALSE.
You might want to try using tags instead of the $tokens, too.
You might want to try using tags instead of the $tokens, too.
#3
Posté 25 avril 2011 - 08:16
This probably isn't the problem, but are you sure you are modifying the conversation that is assigned to the NPC you are talking to. I know that is silly, but everyone does this at least one time.
#4
Posté 25 avril 2011 - 09:13
@M. Rieder - Hah, yeah I've done that before, not the case this time though. 
@Lugaid - I'll go give that a shot now Lugaid.
Oh and I wish I could just use the npc's tag, cause that would be no problem. But the npcs in my campaign (the ones that this conversation is attached to) all have the same tag (and this cant change), hence I need to try and call it on the conversation owner or npc speaking the node of dialog.
I've seen it work once, I guess I just need to figure out the right combination.
@Lugaid - I'll go give that a shot now Lugaid.
Oh and I wish I could just use the npc's tag, cause that would be no problem. But the npcs in my campaign (the ones that this conversation is attached to) all have the same tag (and this cant change), hence I need to try and call it on the conversation owner or npc speaking the node of dialog.
I've seen it work once, I guess I just need to figure out the right combination.
Modifié par dickel, 25 avril 2011 - 09:14 .
#5
Posté 25 avril 2011 - 09:47
I sort of mentioned it up the top, but the first time i got it working was with a generic dwarf (under humanoid) and I didnt change anything in the properties last time to get it to work. ie- always visible is by default set to off.
Anyway, just tested it some more. This time with 1 conversation with 8 different variations on where I could put ga_scripthidden and what $STRINGVALUE-thingo to specify.
Each node was set to once per game so I could quickly test them all... still no luck.
I even thought (getting desperate) that ga_scripthidden had stopped working altogether, so i threw in an npc with a specific tag and sure enough, no problem- he disappeared.
This might be an appropriate time to say the word baffled... for I am.
Anyway, just tested it some more. This time with 1 conversation with 8 different variations on where I could put ga_scripthidden and what $STRINGVALUE-thingo to specify.
Each node was set to once per game so I could quickly test them all... still no luck.
I even thought (getting desperate) that ga_scripthidden had stopped working altogether, so i threw in an npc with a specific tag and sure enough, no problem- he disappeared.
This might be an appropriate time to say the word baffled... for I am.
Modifié par dickel, 25 avril 2011 - 09:49 .
#6
Posté 25 avril 2011 - 10:15
ga_scripthidden doesn't allow use of the $ values, only a tag. Use the script in the next post instead. I haven't tested it, so let me know if it works. It should.
Also though, do not put actions on the end node of the conversation. They don't always fire. Do this instead:
NPC node - "I'm going home"
PC node - "Goodbye" with actions: fade to black and ga_bb_scripthidden
-- [END DIALOG]
Also though, do not put actions on the end node of the conversation. They don't always fire. Do this instead:
NPC node - "I'm going home"
PC node - "Goodbye" with actions: fade to black and ga_bb_scripthidden
-- [END DIALOG]
Modifié par Kaldor Silverwand, 26 avril 2011 - 03:47 .
#7
Posté 26 avril 2011 - 03:42
Trying to post the script again:
// ga_bb_scripthidden
// by Brendan Bellina, April 2011
// Show or Hide an NPC, using its ScriptHiddenProperty.
// Based on standard script ga_scripthidden but allows the use of:
// $OBJECT_SELF
// $OWNER
// $OWNED_CHAR
// $PC
// $PC_LEADER
// $PC_NEAREST
// $PC_SPEAKER
// $LASTSPEAKER
// as defined in ginc_param_const function GetTarget
// sTag is the tag of the object to hide or one of the above values.
// If a tag is provided the script will affect the nearest object of that tag.
// If there is none in the current area, it will affect whatever's returned by GetObjectByTag().
//
// If bHide is TRUE, the NPC will disappear, if not, the NPC will appear.
#include "ginc_param_const"
#include "ginc_misc"
void main(string sTag, int bHide)
{
object oPC = (GetPCSpeaker()==OBJECT_INVALID?OBJECT_SELF:GetPCSpeaker());
object oTarget = GetTarget(sTag, TARGET_OWNER);
if(GetIsObjectValid(oTarget))
SetScriptHidden(oTarget,bHide);
}
// ga_bb_scripthidden
// by Brendan Bellina, April 2011
// Show or Hide an NPC, using its ScriptHiddenProperty.
// Based on standard script ga_scripthidden but allows the use of:
// $OBJECT_SELF
// $OWNER
// $OWNED_CHAR
// $PC
// $PC_LEADER
// $PC_NEAREST
// $PC_SPEAKER
// $LASTSPEAKER
// as defined in ginc_param_const function GetTarget
// sTag is the tag of the object to hide or one of the above values.
// If a tag is provided the script will affect the nearest object of that tag.
// If there is none in the current area, it will affect whatever's returned by GetObjectByTag().
//
// If bHide is TRUE, the NPC will disappear, if not, the NPC will appear.
#include "ginc_param_const"
#include "ginc_misc"
void main(string sTag, int bHide)
{
object oPC = (GetPCSpeaker()==OBJECT_INVALID?OBJECT_SELF:GetPCSpeaker());
object oTarget = GetTarget(sTag, TARGET_OWNER);
if(GetIsObjectValid(oTarget))
SetScriptHidden(oTarget,bHide);
}
#8
Posté 26 avril 2011 - 06:04
Ha HA! Success.
Where there is a problem, look at Kaldor
Thanks Kaldor, much appreciated, works a charm.
Made me so happy to see the bastard npc finally disappear
Where there is a problem, look at Kaldor
Thanks Kaldor, much appreciated, works a charm.
Made me so happy to see the bastard npc finally disappear
#9
Posté 26 avril 2011 - 06:20
No problem.
Forget what I said above about the conversation node. It isn't as simple as that. If the actions are on a PC node you will probably be ok even if the PC node is the end dialog node. If the actions are on an NPC node then there may need to be a second end dialog node.
Regards
Forget what I said above about the conversation node. It isn't as simple as that. If the actions are on a PC node you will probably be ok even if the PC node is the end dialog node. If the actions are on an NPC node then there may need to be a second end dialog node.
Regards





Retour en haut






