Monday, 10 March 2008

Some progress

I forced myself to finish the Cyclops scripting and conversations. The old ones was a bit complicated and made it pretty hard to the player to understand what to do.

*Small Spoiler*
Theres this convo-line where the player can offer the Cyclops items from the inventory. I hadn't been thinking about it before, but making a dynamic conversation where the options shows every item you have in the inventory is really complicated. I suppose there's many ways to solve it but here's what I did:

First I'm looping through the inventory setting a custom token for each item, numbered from 5000 and up.
I create an object variable, named the token number and assign the item object to it.
Now I have a token to use in the conversation and a variable to match it with that contains the item that I want to offer the NPC.
I also have a counter variable that contains the number of last item found.
This script runs every time the conversation starts. Then I need two more scripts:
The Conditional script that checks if the token is lower than the stored number. If so it shows the conversation line for that item (with help from the custom token parameter)
The Action script that transfers the item to the NPC (the custom token is used to find the object variable).

I know this may be cryptic. See it as my lesson in writing understandable :) If you're interested mail me and I can send you the scripts to look at by yourself.

As we say in Sweden: Easy as a very very small pancake!

Now I just need a cyclops head for the half-orc model. It's way beyond my artistic ability to make it myself so if there's some talented model maker out there I'm sure that more people than me would be really happy. You don't want me to give my cyclops an ugly sack over the head, do you?

5 comments:

Ernie Noa said...

I hope someone offers to make a cyclops head. I'm sure it would get use by the community at large too. I'd offer, but have no experience and little skill with such things.

The script sounds interesting. If you need a pair of eyes to look it over please let me know.

Ernie

Elf des coquillages said...

Yup, this script must be quite an undertaking !

On this matter, and in case it would be of interest, here's a link to a somewhat similar system (as in, dynamic conversation) on the vault - if you want to compare solutions or even borrow some ideas.

Amraphael said...

@Ernie
Thanks for offering help! I solved it yesterday. The only thing I needed was to sleep on it and then everything was clear and it works like a charm.

Amraphael said...

@Elf des coquillages
Thanks for the link. I took a look at this collection of scripts and the solution was very similar to my own. My is simpler and more easy to implement but not as flexible. I suppose you never can have it both ways :)

EC said...

I really love that Swedish saying!