OurJud wrote:You make things difficult both for yourself and anyone trying to help.
I know code / scripts mean nothing to you (I was the same when I started out) but we can't answer this question without giving you the scripts you'll need. There's no 'easy' answer.
Also, 'use book on [object]' doesn't make any sense, and I can't imagine anyone using this as a command unless you explicitly explain the feature in the game's intro or help files.
However, adding a new line to the player's book, whenever the player has 'looked' at an object could be done with flags.
If you're willing to try and get your head around scripts, I'm sure we can come up with something.
Finally, do yourself a favour and download the desktop version.
XanMag wrote:The easiest way, I think, is to add a flag whenever you add an entry to the journal. Then, in the read/use journal script just have an if statement to check if that flag is present.
So, use book on tree = "you write about the tree in your journal." Read journal = 'If' object journal has flag 'tree', then print message "dear journal... Blah blah blah." We'll address the alternatives to "use book on tree" later.
If you need clarification, I'll supply code/pics for what to do.
msg ("This is your journal. Any notes can be seen below.")
if (GetBoolean(player, "tree")) {
msg ("I saw a tree today.")
}
if (GetBoolean(player, "horse")) {
msg ("I saw a horse today.")
}
if (GetBoolean(player, "castle")) {
msg ("I saw a castle today.")
}
msg ("It's a tree.")
SetObjectFlagOn (player, "tree")if (GetBoolean(player, "castle")) {
msg ("I saw a castle today.")
}msg ("This is your journal. Any notes can be seen below.")
if (GetBoolean(player, "tree")) {
msg ("I saw a tree today.")
}msg ("It's a tree.")
SetObjectFlagOn (player, "tree")japangirl wrote:Nah, still says that it won't work whenever I write about the tree.
japangirl wrote:Oh, lovely. The website has decided to delete my game and the game that got published. Won't allow me to upload the saved one either. Not exactly happy right now.
OurJud wrote:"japangirl"
Nah, still says that it won't work whenever I write about the tree.
That's probably because you're typing something for which there's no command set.
Whatever it is you're typing that won't work, add it as a command in the way I showed you.japangirl wrote:Oh, lovely. The website has decided to delete my game and the game that got published. Won't allow me to upload the saved one either. Not exactly happy right now.
Which is why I told you to use the desktop version. If you use the desktop version you always have a copy stored on your own machine.
OurJud wrote:"japangirl"
[quote="Alex"]Sounds like you've set up two accounts.
I don't think that I did though, is there any way for you to check on your end?
japangirl wrote:So how does one get this journal working?
OurJud wrote:"japangirl"
So how does one get this journal working?
The way I showed you on the previous page. I can confirm it works, so if it doesn't for you, you are going wrong somewhere along the line. I still maintain your verb for 'read book' is conflicting with the command for same, so try deleting the verb see what happens.
Remember that my solution doesn't include any commands for things like 'write in journal' or 'use journal on tree', so if you want these you'll have to add them in the way I showed you.
book.content + "<br/>Dear Book, I found a tree.""<i>" + this.content + "</i>""<span style=\"color:blue;font-style:italic;\">" + this.content + "</span>"if (not book.parent = player) {
msg ("You have nothing to write about it in")
}
else if (GetBoolean(this, "writtenabout")) {
msg ("You have already write about it")
}
else {
msg ("You write about it")
this.writtenabout = true
book.content = book.content + "<br/>Dear Book, I found a tree."
}The Pixie wrote:I forgot about checking if you have the book. Also, I forgot to check if you have already written in the book. But it should be adding to the content, not replacing it.
Go to the Verbs tab of your tree, select "write on", so the script appears at the bottom. Click the seventh icon, "Code view". Replace the text with this:if (not book.parent = player) {
msg ("You have nothing to write about it in")
}
else if (GetBoolean(this, "writtenabout")) {
msg ("You have already write about it")
}
else {
msg ("You write about it")
this.writtenabout = true
book.content = book.content + "<br/>Dear Book, I found a tree."
}
You will need to paste that in to every object that can be written about, but the only bit you need to change is where it says Dear Book, I found a tree
In case you are interested...
The code uses if/if else/else blocks to test various failing cases, and only if no failing case is found it actually does something. The first block checks if the player has the book (i.e., the player is the parent of the book). The second block checks if the writtenabout flag has been set on this object. If it gets to the third block we are good to go, and the book gets updated, and we flag that we have done it for this object.
japangirl wrote:Is it possible to set a random percentage of something happening? I can't seem to find it.
japangirl wrote:Is it possible to set a random percentage of something happening? I can't seem to find it.