Aller au contenu

Photo

Need to set a local int on all pc's in party (multiplayer compatiable)


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

#1
dickel

dickel
  • Members
  • 72 messages
Hi all.
Just doing some testing of the campaign i'm doing, and all goes well so far single player wise. However I tested it the other night with a mate of mine and found a few bugs. One in paticular is that I have currently at the end of the first 3 quests, a local integer placed on the $PC_SPEAKER (in a line of dialog with an NPC that only talks to the 'MAIN PC'). While this might work in single player... sadly not so in Multiplayer.
I personally got 1 of the 3 int's required, my friend was supposed to do the talking and get all 3. He got 2 of them.
Luckily though, I had placed on the town billboard a line of dialog that allowed whoever 'spoke' the line, to instantly get all 3 integers by clicking on it. A contingency plan i guess.

Anyway, I'm hoping that someone out there has a simple script that I can use that will place "xxxxx" integer on all party members. Ideally, a script that increments the integer by 1 each time.
That way when the Pc's reach the point I have in my campaign where they need all 3 integers as a conditional, the proper things happen instead of nothing.
Hope all that made sense... I have a strange way of explaining things :)
Peace :wizard:

#2
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

dickel wrote...

Hi all.
Just doing some testing of the campaign i'm doing, and all goes well so far single player wise. However I tested it the other night with a mate of mine and found a few bugs. One in paticular is that I have currently at the end of the first 3 quests, a local integer placed on the $PC_SPEAKER (in a line of dialog with an NPC that only talks to the 'MAIN PC'). While this might work in single player... sadly not so in Multiplayer.
I personally got 1 of the 3 int's required, my friend was supposed to do the talking and get all 3. He got 2 of them.
Luckily though, I had placed on the town billboard a line of dialog that allowed whoever 'spoke' the line, to instantly get all 3 integers by clicking on it. A contingency plan i guess.

Anyway, I'm hoping that someone out there has a simple script that I can use that will place "xxxxx" integer on all party members. Ideally, a script that increments the integer by 1 each time.
That way when the Pc's reach the point I have in my campaign where they need all 3 integers as a conditional, the proper things happen instead of nothing.
Hope all that made sense... I have a strange way of explaining things :)
Peace :wizard:


Hi dickel,
So, I am not alone on the dreaded path of MP coding. Image IPB If I only knew before I started. Anyway, I digress ....

You may have to change the way you think about approaching all future coding, simply because you have chosen to go the MP route. These are a couple of methods I use in my own campaign ....

1) Use globalints instead of localints. However, this could mean three different PCs could acquire the knowledge at three different times, but any PC could do the task. This may be what you want, but may not make logical sense. E.g. PC 1 sets the globalint to stage 1. PC 1 dies (or no longer plays) and PC 2 who is new to the party sets the next stage. How did PC 2 know about stage 1?

2) In your code where you set the local int, be sure to always locate the player who already has the first variable on them (no matter who is doing the talking) and update the integer there. This method assumes that this PC/player will always be present when playing.

3) Update the variable for every player present (and their PCs) using GetFirstFactionMember loop. I use this method quite a bit.

4) Use journal entries to control the state for the party, which contains all players anyway.

There are probably more ways that I have used that escape me at the moment, but that should give you some food for thought. The easiest, if I was to recommend, is to probably just use the journal entry route - and writing something for the player(s) to refer to is also good fun. Note, however, be sure to apply the journal entry for every player when this is done - and if your players might change for one reason or another, you may need to do some checking code to ensure a new plaer receives the latest journal updates.

I assume you know how to check the local variable state according to journal entry. If not, refer to the Lexicon.

Lance.

Modifié par Lance Botelle, 03 avril 2011 - 02:34 .


#3
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages
hmm, i don't use global ints really. If MP track state in DB, mysql and NWNX for quests. Harder to get started but less effort to get so its debugged and working, and far more powerful. Journal entries are a good choice as well, how the devs do it for SP.

Good reference on how to Refer to objects in scripts

Increment local int which is in the math library found in this zip