Aller au contenu

Photo

Universal Module Scripts, pros and cons?


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

#1
Xeneize

Xeneize
  • Members
  • 133 messages

Hello there.

 

I am devising a new quest where the player is sent away to retrieve a certain ammount of items. When the ammount is met, the quest journal entry cycles to another entry.

 

Now to do this, I've always used a conditional script that went on the 'on creature death' script.

 

However I'm considering to play with the 'On Acquire' type of scripts. From what I understand, you name a script a certain way so the module as a whole will run the script if the item is acquired but I'm wondering what are the good sides from going this way?

 

Considering it's something the server checks for all the module, wouldn't it be taxing over the other way around of having it check when a creature dies if the player has enough items?

 

 

Thanks in advance for reading.



#2
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 598 messages
A tag based acquire script is only executed when an item with that particular tag is acquired. I don't see why that would be taxing on resources. I'm not sure I would use one for counting items though since an item that is dropped and then picked up will fire the script again. I would probably just use a global variable and increment it as the creatures die.

Regards

#3
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 598 messages
I don't recommend using the module scripts anyway, that is a non-modular old technique. Use tag based scripts for items rather than a single module script.

Regards

#4
Dann-J

Dann-J
  • Members
  • 3 161 messages

A tag based acquire script is only executed when an item with that particular tag is acquired. I don't see why that would be taxing on resources. I'm not sure I would use one for counting items though since an item that is dropped and then picked up will fire the script again. I would probably just use a global variable and increment it as the creatures die.

Regards

 

You could have the OnAcquire script 'curse' the items to prevent he player from dropping or transferring them. You'd probably not want them to be stackable items though.

 

I remember one quest in The Witcher that fired a journal entry when the player picks up a certain number of a certain ingredient (echinops roots). Unfortunately they were also valid alchemical ingredients. On my way back to town I brewed some potions, and the game chose the roots as one of the default ingredients without me noticing. I didn't have enough of them to claim my reward despite the journal entry saying I did, and had to go and kill some more echinops plants.



#5
Morbane

Morbane
  • Members
  • 1 883 messages

like any script - an onacquire can be made to fire only once with a simple short circuit in the script body

 

you can also do an unacquire script that nullifies the conditional and making the drop-pick up exploit impossible