Aller au contenu

Photo

">=" does not appear to work in gc_journal_entry


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

#1
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
I just had a conditional which was >=20 in the gc_journal_entry script and the node fired inappropriately.  When I broke it into two seperate applications of gc_journal_entry, one which was >20, the other =20 and linked them with an "or", then the conditional appeared to work properly. 

Has anyone else noticed this?  According to the documentation, gc_journal_entry is supposed to work like gc_local_int which, I am pretty sure, accepts >=. 

#2
Dann-J

Dann-J
  • Members
  • 3 161 messages
Journal entries by default tend to increase in a progression of 1, 11, 21, 31, etc. It would seem there is a reason for that - so that you can say '>10' or '>20' and be sure to get what you want from gc_journal_entry.

Have you been overriding the default values, and increasing them by increments of 1 instead?

#3
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
The gc_ scripts don't use real code in their parameters, they just look at the first character in the string to determine the type of conditional. There should be a list in the script notes, maybe look at gc_local_int first. For example, you can use '!9' to mean != 9, but not '!=9'.

#4
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages
Would this be useful to do this.

I've got a modified and adjusted version of the convo scripts, i already added support for using D&D style die roll strings ( ie if you put 1d6, 1d20 or 1d4+1 or even 4354+3d25-45 would see where the dice are and add and subtract whereever a + or - is. ) Basically recreating the parsing routines used in real programming when you compile code to assembly.

Its something which if added, would be backword compatible with existing conversations ( assuming no one is doing it yet, or if they do it they intend for it to work )

#5
Guest_Iveforgotmypassword_*

Guest_Iveforgotmypassword_*
  • Guests
Why not just put >19 it's the same do it like this and you'll never need an = again !

#6
kevL

kevL
  • Members
  • 4 074 messages
ok .. i went ahead and looked up CompareInts() in ginc_var_ops.nss

only the leftmost character is checked, for values of ">" "<" "=" "!" ....


.

#7
M. Rieder

M. Rieder
  • Members
  • 2 530 messages

DannJ wrote...

Journal entries by default tend to increase in a progression of 1, 11, 21, 31, etc. It would seem there is a reason for that - so that you can say '>10' or '>20' and be sure to get what you want from gc_journal_entry.

Have you been overriding the default values, and increasing them by increments of 1 instead?


Yes.  I always start at 10 in case I want to get something in at the beginning. 

#8
M. Rieder

M. Rieder
  • Members
  • 2 530 messages

Iveforgotmypassword wrote...

Why not just put >19 it's the same do it like this and you'll never need an = again !



That is what I ended up doing.

#9
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 598 messages
gc_journal_entry works exactly like gc_local_int. As KevL points out only <, >, =, and ! are used. With integers there is no need for >= or <=, and != and == are needlessly redundant.

The comments in gc_local_int are basically correct:
     string sCheck     = The operation to check on the value of the variable. 
     Default is ==, but you can also specify <, >, or !
     e.g. sCheck of "<50" returns TRUE if sVariable's value is <50
     a sCheck of "9" or "=9" returns TRUE if sVariable's value is equal to 9
     and a sCheck of "!0" returns TRUE if sVariable's value is not equal to 0.

It should say Default is "=", but you can also specify "<", ">", and "!".

Regards

Modifié par Kaldor Silverwand, 05 janvier 2012 - 04:23 .


#10
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages
Just a FYI, i went ahead since it won't really affect anything for those doing things the old way, and implemented both the >=, ==, !=, <> along with =, >, !, and < for the conversations scripts in my CSL library and it will be in the next release after i see if it causes any problems. To a degree you'll have to research if this is going to affect all conversation scripts, it looks like gc_class_level, gc_class_level_party, gc_global_int, gc_henchman_max, gc_item_count, gc_journal_entry, gc_local_int, gc_num_comps, gc_num_pcs are the main ones, but this likely is adding features to more functions, as well as the similar float functions.

For any value using this function, which is technically the second parameter, it can use a standard die roll syntax. ( a string like 1d4, 1d6 ). This allows you to do things like ">=1d20" which allows random results, which i think will add a lot more versatility to how this works.

While it probably won't matter, as there are alternatives as just putting one number lower and this is redundant, it is a lot easier to use the correct operator and let the computer figure things out for you. Really there is a reason features like this are added, they make code easier to read for the person setting things up, and when end users assume things should work a certain way, it's far easier to re-program the computer than it is to re-program the person. Since it only does something when you use the 2 letter operators and existing conversations will not use those, it really remains up to the person setting up the conversations and will work as is with any old modules out there - might even fix some error caused by the writer assuming he could use ">=".

Note that you should use Kaldors examples, as the 2 letter operators I'm describing or the die roll options won't work with the vanilla scripts that come with the game, and you'd need to install the next release of the CSL library after i've installed this as a new feature.

#11
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
That sounds really interesting and I will check it out. By the way, the CSL website appears to be down. Do you run that website or is that someone else?

#12
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages
Its up and been up

http://70.179.46.242.../csl/index.html

The server for nwn2 went down for a bit on gamespy, had to restart it to get it to show up again. That is served on computer next to the NWN2 server i am running on a very simple apache server.

Modifié par painofdungeoneternal, 06 janvier 2012 - 10:36 .


#13
kamal_

kamal_
  • Members
  • 5 259 messages

DannJ wrote...

Journal entries by default tend to increase in a progression of 1, 11, 21, 31, etc. It would seem there is a reason for that.

The reason is for when you forget/discover the need for intermediate steps in your quest, you don't have to redo stuff all over the place. :)