Aller au contenu

Photo

ga_ script to give XP as a multiple of an INT...


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

#1
Bronn MacLaern

Bronn MacLaern
  • Members
  • 11 messages
OK, here is the scenario...
PC is solving a series of thefts in the tavern. By carefully interviewing all the patrons, a local int goes up every time he/she gets a clue. There are spots/evaluates and so on that increase this Integer so that at various points new stuff is unlocked. When its all put o bed and the thief is caught, in addition to the quest XP I want to give a bonus of (my special LocalInt * 25).
Now I am still VERY new to scripting, and I usualy use Lilac Souls wonderful tool and then work back through it to see how it knits together...
Unfortunately this one has me stumped.

Ideally having had the idea, I would like to use the multiplied integer XP award as a recurring theme, and I was wondering if anyone could help me come up with a ga_ script that drops into a convo, and offers the three:
Local Int, Target, and Multiplier, so that the script knows where to look, what to look for, and how many times to multiply the Int to then give the XP, (so I suppose it would also need options around single or group XP allocation)

I'm currently like the guy who can sort of understand what someone means when spoken to in a foreign language, but when needed to form my own sentences and stuff would end up asking my way to the Cheese Fountain in the middle of the Elephant...

Anyway, I know that if anyone can answer this, its the brains on this place!!

Cheers in advance guys...

Bronn

#2
Morbane

Morbane
  • Members
  • 1 883 messages
Try This - I can add to it if need be. :wizard:


http://pastebin.com/vDgrxnvx

|Mor|

Modifié par Morbane, 28 juillet 2010 - 11:09 .


#3
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
Morbane seems to have you covered in the script that was linked there.



Just wanted to also mention that creating your own ga_* type scripts is covered in a section of my scripting tutorial, linked in sig below.

#4
Bronn MacLaern

Bronn MacLaern
  • Members
  • 11 messages
Thanks Morbane, and KM good to hear from you again!

I tried it and it didnt seem to fire.

I'm going to have another go without any complicated bits and pieces.

I was wondering if the script needs to "get" the integer from the object holding it?

Most ga_ scripts I've used seem to almost always ask for the variable, its value, and the object where the variable sits...

Would that be needed for this one too?

#5
Morbane

Morbane
  • Members
  • 1 883 messages
This line :

nLocalInt = GetLocalInt(oPC, "your_int_name_here");



refers to the LocalInt you iterate through when clues are gained and such. I assume it is the same variable each time that gets increased as your PC finds things out? That would normally be a SetLocalInt on the PC, and each time a new clue is discovered that LocalInt would be increased.



How are you recording the clue points? As another LocalInt? It should be the same variable name that changes throughout the investigation. I am guessing you are using the standard LocalInt ga_* script?



I can add another parameter to the script to ask for the string given to the clue record. But it can start to get confusing without knowing how your scripts are being used to remember the number of clues gained.

#6
Morbane

Morbane
  • Members
  • 1 883 messages
Try this - I added the string for your clue variable...



http://pastebin.com/frmvjfcD

#7
MasterChanger

MasterChanger
  • Members
  • 686 messages
Morbane, I think you and I are playing Tag with minor scripting help these days! ;)

Here's the part I want to call attention to:

void main(int nMultiplier, int nLocalInt, string sClues_Var, int nIsParty = TRUE)
{
        nLocalInt = GetLocalInt(oPC, sClues_Var);


If nLocalInt is retrieved within the script, then it doesn't need to be passed in the argument.

The other thing to make sure of is where the Clues variable is stored. If this is designed for the possibility of party play, you want to make sure that you're using SetLocalInt on the correct (main?) character rather than the currently controlled one, so that it can be retrieved correctly. (This assumes OC conversation style, which bumps the main character into conversations.)

#8
Bronn MacLaern

Bronn MacLaern
  • Members
  • 11 messages
I had the clues/variable/local Int stored on a placeable within the tavern area.
Actually its the bar itself.
Since the ga_and gc_ scripts in convos always ask where its stored, being a novice I always end up erring on the side of caution and putting stuff like that on objects that I can readily identify when I (inevitably) need to go and fix stuff...
Normally when I use a variable in convos I notice they ask for the variables tag, the value of the variable, (whether its to check against in a gc_, or to change in a ga_) and the tag of the item/object etc is is stored on...

I now have a couple of hours to myself, so will sit down and see what this new version does.

Many thanks guys, as always your generosity and patience in this sort of stuff staggers me!

Modifié par Bronn MacLaern, 28 juillet 2010 - 09:33 .


#9
Morbane

Morbane
  • Members
  • 1 883 messages
In anticipation of an incomplete functionality I have modified the script. It can be found here:

http://pastebin.com/wNnbjuGd

I haven't tested it but I *think* it will work correctly for your purposes.

Modifié par Morbane, 29 juillet 2010 - 01:55 .