Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dialog on item?
Author Message
tleilax
Journeyman
*

Posts: 56
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Jun 2012
Reputation: 0



Post: #1
Dialog on item?
Hello,
we are trying to move from 55i to 56d and we are having trouble with our very very customized player vendor system.

I identified what is causing the problem:
Code:
on=*buy*
FINDID.i_vendor_tag_box.DIALOG d_vendor

The i_vendor_tag_box is the vendor's container in which the items for sell are stored. So basically we used to open a dialog on vendor item and showed it to player.

Later in that dialog we could use something like this:
Code:
<FINDCONT.0.NAME> //name of the first item for sale
<SRC.NAME> //name of player who opened the dialog

Since this no longer works on 56d for some reason, what would be the best way to fix this problem? Store the "i_vendor_tag_box" UID as OBJ? Anything easier so I don't have to rewrite most of the 7000 lines of code?

Thank you.
02-07-2018 08:06 AM
Find all posts by this user Like Post Quote this message in a reply
x77x
Master
**

Posts: 477
Likes Given: 0
Likes Received: 14 in 14 posts
Joined: Mar 2012
Reputation: -4



Post: #2
RE: Dialog on item?
speech file?

Code:
ON=*ogre cock*
        SAY=That's correct!
        BUY

ON=*buy*
        SAY=Sorry! Can't help you... You gotta know the password...    
    RETURN 1

Code:
ON=*buy*
DIALOG d_somedialog
RETURN 1

Dragons of Time 2000-2018
http://dragonsoftime.com
(This post was last modified: 02-07-2018 10:58 PM by x77x.)
02-07-2018 12:07 PM
Find all posts by this user Like Post Quote this message in a reply
tleilax
Journeyman
*

Posts: 56
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Jun 2012
Reputation: 0



Post: #3
RE: Dialog on item?
I think I already provided my speech file, at least the important part:
Code:
on=*buy*
FINDID.i_vendor_tag_box.DIALOG d_vendor

This is part of the speech of the vendor. When the vendor hears *buy*, the dialog "d_vendor" starts on container named "i_vendor_tag_box", which is inside the vendor (topboj = c_vendor).
Then inside the dialog script, you can do:
Code:
<uid> //uid of the i_vendor_tag_box - item which started the dialog
<src.uid> //uid of the character that said "buy"
<topobj.uid> //uid of the vendor
(This post was last modified: 02-08-2018 02:39 AM by tleilax.)
02-08-2018 02:38 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,634
Likes Given: 224
Likes Received: 149 in 140 posts
Joined: Mar 2012
Reputation: 33



Post: #4
RE: Dialog on item?
If i understand well, the dialog appears on SRC, but the values <uid>/<topobj>/<src> are wrong right?
02-08-2018 03:41 AM
Find all posts by this user Like Post Quote this message in a reply
tleilax
Journeyman
*

Posts: 56
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Jun 2012
Reputation: 0



Post: #5
RE: Dialog on item?
Yes dialog is correctly displayed to <src> (player), but <uid> and <topobj> are wrong.
02-08-2018 03:48 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,634
Likes Given: 224
Likes Received: 149 in 140 posts
Joined: Mar 2012
Reputation: 33



Post: #6
RE: Dialog on item?
What are the values of <uid> and <topobj>? Are the same uid of <src>? You need to print / log them in the dialog so we can check what object <uid> and <topobj> are referring
02-08-2018 04:37 AM
Find all posts by this user Like Post Quote this message in a reply
tleilax
Journeyman
*

Posts: 56
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Jun 2012
Reputation: 0



Post: #7
RE: Dialog on item?
I did some more testing and seems like I was wrong, the problem is somewhere else. The previous works the same, I was just outputting the UIDs wrong *facepalm*.

Anyway, we use dynamic paging in dialog to check if to show some dialog elements (like buttons or text) or not, like this:
Code:
[dialog d_vendor]
page <eval <findcont.0.isitem>>
text 320 50 0 2

Basically, if there is item in "slot 0", we want to display the text, otherwise not. This doesn't seem to work on 56d, but worked on 55i. Any ideas?
(This post was last modified: 02-13-2018 05:50 AM by tleilax.)
02-13-2018 05:49 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,634
Likes Given: 224
Likes Received: 149 in 140 posts
Joined: Mar 2012
Reputation: 33



Post: #8
RE: Dialog on item?
You can use IF inside dialogs in 56 versions, i don't remember in 55?

But the line of code above will just render page 0 or 1, but page 0 is always rendered because it's the "background" right?
02-13-2018 06:43 AM
Find all posts by this user Like Post Quote this message in a reply
tleilax
Journeyman
*

Posts: 56
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Jun 2012
Reputation: 0



Post: #9
RE: Dialog on item?
The code was just for the idea, actually it renders "page -1" when elements shouldn't be available and "page 0" when they should (it's more like <eval <findcont.0.isitem>-1>).

How would you rewrite it with IF conditions? Won't I screw up my text line numbers? I don't want to convert it to dtext Sad

But I guess if I want to make it work with IF conditions, I need to completely remove the [dialog d_vendor text] and make all texts into dtexts, right...
(This post was last modified: 02-13-2018 06:50 AM by tleilax.)
02-13-2018 06:46 AM
Find all posts by this user Like Post Quote this message in a reply
tleilax
Journeyman
*

Posts: 56
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Jun 2012
Reputation: 0



Post: #10
RE: Dialog on item?
Alright, I changed everything to dtext and added if conditions for paging, now everything seems fine. A lot of work to do, but it works, thanks.
02-13-2018 07:53 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes tleilax's post
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

This forum uses Lukasz Tkacz MyBB addons.