Scripting issue with inventoryitem - hotspot interaction

Started by Guba, Mon 14/04/2008 11:47:29

Previous topic - Next topic

monkey0506

I've used the same code before successfully...so it should work...

Time to break out some Display-debugging. The Display function can quite useful in times like this. Make sure you haven't got "Always display text as speech" turned on (TURN IT OFF!) and you can use Display to check whether your code is being executed.

For example, you could put one Display in the "Any click" script like Display("character click registered!"); then put a Display inside each conditional to see which ones are being run. You could have Display("cursor mode give inv set!"); to check if the cursor is properly set. Then you could have Display("active inventory is icog"); to check the player's active inventory. This way you can track which events are being run and which aren't. This is extremely beneficial in tracking down the exact source of the problem. ;)

m0ds

Fixed! Things are all working now :)

Many thanks mr Monkey!

The dialogue also works, yay!

BUT

how do I change the font in the dialogue options box?

After that...I think we're done :)


monkey0506

I think that should be controlled by the Game.NormalFont property if I'm not mistaken. := Glad you magically discovered the problem. ;)

m0ds

Yep, overlooked that simple command :P

Okay, unfortunately - it's not all working to plan, but by turning things on and off I know exactly what the problem is.

Okay, if I have the "Handle inventory clicks in script" CHECKED, then both Use and Give do the same things, but when I tell Any Click on Mr Smit to check the correct inventory item is being given to him, NOTHING happens. By taking out the code that checks whether its the right inventory item or not WORKS, but means you can also use "Use" as well as "Give". Hmmm.

With "Handle inventory clicks in script" CHECKED, simple functions like "Look at" inventory item DO NOT function. Adding the code to check the cursor is definitely in Lookat mode doesn't help either, again nothing happens.

So the problem I face is this; If I handle inventory clicks in the script, the complex use and give functions work ok, not fully though - but all the others DONT.

if I turn this off, all the normal verbs work but the GIVE and USE don't.

Is there anyway to make give and use work whilst leaving Handle inventory items in script UNCHECKED? Or is there another way around this? All this checking to see if the cursor mode is correct seems to give a completely null response, which is very odd.

Any further help appreciated :)

SMF spam blocked by CleanTalk