Help With Twine

Raelynn

Newbie
Sep 9, 2018
53
25
You didn't post your file paths like I asked, but if I had to guess, it's probably because you have "C:/User/Home/Desktop/" instead of "C:/Users/Home/Desktop/", since that directory is normally called "Users", not "User".

(My sample code used that path, because that's the path you had in your second post here. I'm guessing that's why the code in that post didn't work either.)
What do you mean by file path?
 

Raelynn

Newbie
Sep 9, 2018
53
25
The full path to the file. For example, "C:\Games\Twine_Sample_Code\images\loading-anim.gif"

Anyways, did changing to "Users" work?
No changing to "Users" didn't work. Any I think this is my path to the file. ----> C:\Users\Home Computer\Desktop\test\pics
 

HiEv

Member
Sep 1, 2017
384
786
This is my JavaScript Code --->
if (window.hasOwnProperty("storyFormat")) {
setup.Path = "C:/User/Home/Desktop/"; // Running inside Twine application
} else {
setup.Path = ""; // Running in a browser
}
setup.SoundPath = setup.Path + "sounds/";
setup.ImagePath = setup.Path + "pics/";

and this is my Image Display Code ----> <img @src="setup.ImagePath+'1.gif'">
No changing to "Users" didn't work. Any I think this is my path to the file. ----> C:\Users\Home Computer\Desktop\test\pics
I asked for the paths to both the HTML file and the images, so since you only gave the path to the images I'm going to have to assume that the HTML is normally in the "test" folder.

If that's actually the path to your images, and your HTML file goes in "C:/Users/Home Computer/Desktop/test/", then you didn't change the path correctly. This line:
Code:
setup.Path = "C:/User/Home/Desktop/";
needs to be changed to this:
Code:
setup.Path = "C:/Users/Home Computer/Desktop/test/";
But since you seem unsure of the path, you should go to one of the images, right-click on it, go to "Properties", and take a look at the path on the "Location" line to make sure that it's the same path as in your code (also, change all of the backslashes "\" to forward slashes "/").
 

Raelynn

Newbie
Sep 9, 2018
53
25
I asked for the paths to both the HTML file and the images, so since you only gave the path to the images I'm going to have to assume that the HTML is normally in the "test" folder.

If that's actually the path to your images, and your HTML file goes in "C:/Users/Home Computer/Desktop/test/", then you didn't change the path correctly. This line:
Code:
setup.Path = "C:/User/Home/Desktop/";
needs to be changed to this:
Code:
setup.Path = "C:/Users/Home Computer/Desktop/test/";
But since you seem unsure of the path, you should go to one of the images, right-click on it, go to "Properties", and take a look at the path on the "Location" line to make sure that it's the same path as in your code (also, change all of the backslashes "\" to forward slashes "/").
I feel so dumb right now. :( I'm not very good with computers and to be honest most of what you're telling me sounds like Latin to me. I don't know if this will help but I can email you screenshots of both my JavaScript code and the tab thing in twine where I'm trying to put the picture. I'm sorry for being a pain but like I said I'm slow with computers.
 

HiEv

Member
Sep 1, 2017
384
786
I don't know if this will help but I can email you screenshots of both my JavaScript code and the tab thing in twine where I'm trying to put the picture.
Screenshots won't help if I don't know the correct file path. Simply follow the directions I gave you:

Go to one of the image files, right-click on it, select "Properties", and then take a look at the path on the "Location" line to make sure that it's the same path as in your code. Even though it doesn't look like it, you can copy the text from the Location line by selecting it with your mouse and then hitting CTRL+C to copy the selected text. You can paste that into your code (and change all of the backslashes "\" to forward slashes "/") if you want to be sure you have the file path correct.

Also, don't worry about not knowing things. Nobody is born knowing this stuff. I didn't learn this overnight either. The important thing is that you keep trying until you figure it out and understand it.

Hope that helps! :)
 
Nov 25, 2017
44
21
hi i need some help too

i try to create a stat list of the character
its looks like this
You don't have permission to view the spoiler content. Log in or register now.
and
You don't have permission to view the spoiler content. Log in or register now.
and
You don't have permission to view the spoiler content. Log in or register now.




and ina result i have an ugly
You don't have permission to view the spoiler content. Log in or register now.

any ways to create a normal stat list ?
 

scrumbles

Active Member
Jan 12, 2019
906
934
I don't know Twine, but your code has two errors:
  • it checks for >5 before checking for >10, >20, >30 and so on. As long as $loot or $kills are higher than 5 (it doesn't matter if they are equal to 6 or 6000), the flow stops at the second line. The game will never display ranks higher than newcomer
  • there is no rank for $loot & $kills equal to 1, 2, 3, 4 and 5
Try something like this for $kills (the syntax could be wrong):
Code:
(if: $kills>75) [I have killed $kills monsters and receive master rank]
(else-if: $kills>50) [I have killed $kills monsters and receive skilled rank]
(else-if: $kills>30) [I have killed $kills monsters and receive fighter rank]
(else-if: $kills>20) [I have killed $kills monsters and receive brawler rank]
(else-if: $kills>10) [I have killed $kills monsters and receive soldier rank]
(else-if: $kills>5) [I have killed $kills monsters and receive newcomer rank]
(else-if: $kills>0) [I have killed $kills monsters and receive noob rank] <- CREATE A NEW RANK
(else:) [I have not killed any monster]
and something similar for $loot.

If the game always displays "I have not killed any monster", I guess the variable is not increased.
 
Nov 25, 2017
44
21
I don't know Twine, but your code has two errors:
  • it checks for >5 before checking for >10, >20, >30 and so on. As long as $loot or $kills are higher than 5 (it doesn't matter if they are equal to 6 or 6000), the flow stops at the second line. The game will never display ranks higher than newcomer
  • there is no rank for $loot & $kills equal to 1, 2, 3, 4 and 5
Try something like this for $kills (the syntax could be wrong):
Code:
(if: $kills>75) [I have killed $kills monsters and receive master rank]
(else-if: $kills>50) [I have killed $kills monsters and receive skilled rank]
(else-if: $kills>30) [I have killed $kills monsters and receive fighter rank]
(else-if: $kills>20) [I have killed $kills monsters and receive brawler rank]
(else-if: $kills>10) [I have killed $kills monsters and receive soldier rank]
(else-if: $kills>5) [I have killed $kills monsters and receive newcomer rank]
(else-if: $kills>0) [I have killed $kills monsters and receive noob rank] <- CREATE A NEW RANK
(else:) [I have not killed any monster]
and something similar for $loot.

If the game always displays "I have not killed any monster", I guess the variable is not increased.
thanks i have a new problem

i tierd of thosands of control +c control +v's
on every sex scene in my game and wrote some code

HTML:
(set:$analgifs to(either:"<img src="images/ghanal.gif" width="500" height="300" alt="ghanal">","<img src="images/ghanal2.gif" width="500" height="300" alt="ghanal2">"))

$analgifs
i think this code will helps me to edit new pics but ......
its not worked
its says i ve missed the ) but i dont miss it


Code:
(set:)

and

Code:
(either:)
 

scrumbles

Active Member
Jan 12, 2019
906
934
Again, I know nothing about Twine, but I don't think you can use the double quotes (") like that.
I guess the game gets confused because it thinks that the (") after either: is paired with the (") after src= and so on:
HTML:
(set:$analgifs to(either:"<img src="images/ghanal.gif" width="500" height="300" alt="ghanal">","<img src="images/ghanal2.gif" width="500" height="300" alt="ghanal2">"))
Try one of these solutions:
1. either you replace the double quotes inside each <img src= ... > block with single quotes:
JavaScript:
(set:$analgifs to(either:"<img src='images/ghanal.gif' width='500' height='300' alt='ghanal'>","<img src='images/ghanal2.gif' width='500' height='300' alt='ghanal2'>"))
2. or you escape those same double quotes with a single backslash:
JavaScript:
(set:$analgifs to(either:"<img src=\"images/ghanal.gif\" width=\"500\" height=\"300\" alt=\"ghanal\">","<img src=\"images/ghanal2.gif\" width=\"500\" height=\"300\" alt=\"ghanal2\">"))
 
Nov 25, 2017
44
21
Again, I know nothing about Twine, but I don't think you can use the double quotes (") like that.
I guess the game gets confused because it thinks that the (") after either: is paired with the (") after src= and so on:

Try one of these solutions:
1. either you replace the double quotes inside each <img src= ... > block with single quotes:
JavaScript:
(set:$analgifs to(either:"<img src='images/ghanal.gif' width='500' height='300' alt='ghanal'>","<img src='images/ghanal2.gif' width='500' height='300' alt='ghanal2'>"))
2. or you escape those same double quotes with a single backslash:
JavaScript:
(set:$analgifs to(either:"<img src=\"images/ghanal.gif\" width=\"500\" height=\"300\" alt=\"ghanal\">","<img src=\"images/ghanal2.gif\" width=\"500\" height=\"300\" alt=\"ghanal2\">"))
oh it works , thanks, my idea not worked with $ because it works only on linked passages but i use
niw it works fine for me
Code:
(Display:'ghanalfigs')