Aller au contenu

Photo

Setting Local Ints In Convs - Just Not Working Right!!!? [Alt Solution Found]


  • Veuillez vous connecter pour répondre
15 réponses à ce sujet

#1
Morbane

Morbane
  • Members
  • 1 883 messages
Well I was putting together a conversation and trying to offer different options according to Local Ints being set in specific nodes then having a conditional in others relationg to the set ints.

This involved some instances of NOT being the determining factor for any given node.

So, for some reason, even putting any conditional int on a node was causing it not to fire - even if the int had not been set yet.

So I did an experiment with a scripted conditional that would be true if the int set in the conv were true - and the same thing happened: even though the int was not yet set - the script thought it was.

I know, confusing - but it must be a conv editor issue with ints, because using the journal in conv as a conditional works fine. 

Busting Blazes!! I'm half crazy trying to get this sorted!

Anyone able to get what I'm explaining?

If so - please share your wisdom.

Lastly, there are no duplicates or DLG files in my override.


AAAAAAAAAHHHHHHHH!

hehe

:blink:

Modifié par Morbane, 17 novembre 2013 - 05:28 .


#2
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
Can you be more specific about the numbers and math involved?

Just to guess, remember that unassigned ints are read as 0, and that multiple conditions on a node either all have to be true (AND) or only one has to be true (OR) for the node to be displayed. Also make sure there's no typos in the tags or variable names.

What was your variable name exactly? It's possible that you used a variable name that had been already used by some other script.

#3
andysks

andysks
  • Members
  • 1 651 messages
Hey I had the same problem yesterday, with a different script though. I wanted to use some timer scripts that Tchos made, but didn't know yet how. I put them though as placeholders so I don't forget, without filling any params yet. When I tested the convo, the conditional nods didn't fire. It seems like a conditional nod even with no params, will think there is a condition to be met, thus not firing. As a matter of fact, it will never fire since the empty conditions will never be met.

I don't know if this is what you are talking about, but it seemed like that to me :D.

#4
ColorsFade

ColorsFade
  • Members
  • 1 270 messages
There are several factors that may cause a node to not fire correctly.

1) If the conversation is a multi-character conversation, or if you're using an iPoint speaker for the conversation, then you must specify the NPC speaker tag on every line. If you don't, the conversation breaks.

2) If you are going to set and check conditional ints/strings/floats on the PC, then use $PC as the creature tag. And make sure you use this EVERY TIME or you will run into issues. The scripts say that if you don't specify any tag it will default to the caller's tag, which on a blue line means it should default to the PC, but I have had issues with it working, so I just make sure to put $PC in there and it works.

3) Make sure your conditionals are not creating a dialog that cannot happen. Example: You have two NPC lines after a PC line, and each NPC line has a conditional. If BOTH of those conditionals result in a FALSE condition, then neither line can fire and the conversation breaks. Logically, at least one line has to be available.

#5
diophant

diophant
  • Members
  • 116 messages
One more option for unexpected failure: your condition script is wrong. If you compare with var = TRUE instead of var == TRUE, your condition will always return TRUE. Bugs like this are easily made and hard to spot.
Can you post the scripts?

#6
andysks

andysks
  • Members
  • 1 651 messages
I think he had problems with the standard gc_local_int. When I use this and I need a specific number, I never put = or ==. Just the number will do. I put symbols when I need !, <, > . Just the number never failed me on it though.

#7
Morbane

Morbane
  • Members
  • 1 883 messages
hey - thanks for the options to look for everyone ;)

But i think CF might be onto something with having to put the npc tag on his conv nodes -

I'm leaning in that direction because the conv starts through the use of a placeable - the nwn2 style dialog shows his face but that may very well not be enough.

i overslept today hehe so i'll have to put it to the test later in the day -

cheers :)

#8
Morbane

Morbane
  • Members
  • 1 883 messages

Lugaid of the Red Stripes wrote...

Can you be more specific about the numbers and math involved?

Just to guess, remember that unassigned ints are read as 0, and that multiple conditions on a node either all have to be true (AND) or only one has to be true (OR) for the node to be displayed. Also make sure there's no typos in the tags or variable names.

What was your variable name exactly? It's possible that you used a variable name that had been already used by some other script.


just to fill in the details - this is the conditional im using:


int StartingConditional(string plotName, int toCheckFor)
{
object oPC = GetPCSpeaker();

if (GetLocalInt(oPC, plotName) != toCheckFor) return FALSE;

return TRUE;
}

Modifié par Morbane, 12 novembre 2013 - 09:42 .


#9
Morbane

Morbane
  • Members
  • 1 883 messages

diophant wrote...

One more option for unexpected failure: your condition script is wrong. If you compare with var = TRUE instead of var == TRUE, your condition will always return TRUE. Bugs like this are easily made and hard to spot.
Can you post the scripts?


The other script is the stock "ga_setlocalint" with the two vars; string and int.

Modifié par Morbane, 12 novembre 2013 - 10:33 .


#10
Claudius33

Claudius33
  • Members
  • 258 messages
 Personally I would write :

int StartingConditional(string plotName, int toCheckFor)
{

  object oPC = GetPCSpeaker();

  return (GetLocalInt(oPC, plotName) == toCheckFor); 
}

The test may fail because of  a typo in the string passed as plotname in the convo line, for instance 'miplot' instead of 'myplot' .

Hope it helps.

Modifié par Claudius33, 12 novembre 2013 - 10:54 .


#11
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
Does plotName refer to the journal, or your own plot variables? The journal quests states are stored as local variables on the PC, but they have some sort of weird prefix, but just to use the gc_journal script to get at them.

Even though they're mathematically similar, Claude's alternative seems to read better for me.

#12
Dann-J

Dann-J
  • Members
  • 3 161 messages

Morbane wrote...

just to fill in the details - this is the conditional im using:


int StartingConditional(string plotName, int toCheckFor)
{
object oPC = GetPCSpeaker();

if (GetLocalInt(oPC, plotName) != toCheckFor) return FALSE;

return TRUE;
}


I'm not sure how the 'return' function works (whether it ends the script at that point or not), but I'd be putting an 'else' in there to be on the safe side.

Most GC scripts I've seen encode the TRUE or FALSE into an integer variable, rather than returning them directly (which negates the need for an 'else'). My version would look like this:


int StartingConditional(string plotName, int toCheckFor)
{
object oPC = GetPCSpeaker();
int nCondition = FALSE;

if (GetLocalInt(oPC, plotName) == toCheckFor) nCondition = TRUE;

return nCondition;
}

Keep in mind that the variable would always have to be set on the PC Speaker.

#13
Morbane

Morbane
  • Members
  • 1 883 messages
Claudius - I actually tried it with the TRUE being the first condition

LoTRS - im using my own string names for the local int

Dann - that looks good - i will try it along side identifying the npc in each relevant node

i will updat when im able to try these things - im on lunch atm, so typing on a phone :)

#14
Morbane

Morbane
  • Members
  • 1 883 messages
ok - ive written more involved conversations than this one before - all im trying to do is offer alternate response nodes for the npc once the PC has made an initial choice - thus nullifying the original thread of choices and making the alternates available.

however, since this seems borked - i am going to get back to it later when im not banging my skull off the keyboard quite as hard.

I have a working conversation that accomplishes the basic goal - and the alternate nodes can wait as a side project when fewer of the more significant details are left to work out - it was just an idea for some humorous filler - for flair and a bit of fun for the player.

DannJ - I tried that script but the nodes still did not behave - but i have to mention i did not give the npc node the speaker tag at that time - so further experimentation is in order - for the not too distant future :)

#15
Tchos

Tchos
  • Members
  • 5 063 messages
Morbane -- can you send me the DLG file? I might be able to figure something out if I can see it.

#16
Morbane

Morbane
  • Members
  • 1 883 messages
Tchos - thanks - but I would have to put it back rather than go with my alternate option:

I had several nodes that would fire once, then with ints, alternate nodes were supposed to fire.

Now, I have an entire alternate main node that fires after the first, presumably one shot conv, that provides the alternate line of dialogue.

So in essence I got it to work, just not with the futile attempts to beat the several catch 22s in the original dialogue tree.

I was going to put this as [Solved] but since the original conundrum was not solved, I just didnt think that would be right for some reason.