The problem i am having is that when click the link "NEXT ROUND" on passge no.2 it sends me to an error screen saying "Address not Valid".
I have checked and double checked and the links are right,they should work.Whats wrong with them???
Heres the Code:
PASSAGE no.1
[img[$playertank.image]]
Name: <<print $playertank.name>>
Country of origin: <<print $playertank.country>>
Health: <<print $playertank.health>>
Main Gun: (<<print $playertank.damage>> Damage)
<<if $AItank.health lte 0>>[[WIN|WIN]]
<<else>><<set $AItank.health = $AItank.health - $playertank.damage>>[[NEXT ROUND|Combat 2]]
<<elseif>>
<<endif>>
[img[$AItank.image]]
Name: <<print $AItank.name>>
Country of Origin: <<print $AItank.country>>
Health: <<print $AItank.health>>
Main Gun: (<<print $AItank.damage>> Damage)
<<if $playertank.health lte 0>>[[WIN|win]]
<<else>><<set $playertank.health = $playertank.health - $AItank.damage>>
<<elseif>>
<<endif>>
PASSAGE no.2
[img[$playertank.image]]
Name: <<print $playertank.name>>
Country of origin: <<print $playertank.country>>
Health: <<print $playertank.health>>
Main Gun: (<<print $playertank.damage>> Damage)
<<if $AItank.health lte 0>>[[WIN|WIN]]
<<else>><<set $AItank.health = $AItank.health - $playertank.damage>>[[NEXT ROUND|Combat 3]]
<<elseif>>
<<endif>>
[img[$AItank.image]]
Name: <<print $AItank.name>>
Country of Origin: <<print $AItank.country>>
Health: <<print $AItank.health>>
Main Gun: (<<print $AItank.damage>> Damage)
PASSAGE no.3
[img[$playertank.image]]
Name: <<print $playertank.name>>
Country of origin: <<print $playertank.country>>
Health: <<print $playertank.health>>
Main Gun: (<<print $playertank.damage>> Damage)
<<if $AItank.health lte 0>>[[WIN|WIN]]
<<else>><<set $AItank.health = $AItank.health - $playertank.damage>>[[Next ROUND|Combat]]
<<elseif>>
<<endif>>
[img[$AItank.image]]
Name: <<print $AItank.name>>
Country of Origin: <<print $AItank.country>>
Health: <<print $AItank.health>>
Main Gun: (<<print $AItank.damage>> Damage)
<<if $playertank.health lte 0>>[[WIN|win]]
<<else>><<set $playertank.health = $playertank.health - $AItank.damage>>
<<elseif>>
<<endif>>
<<if $playertank.health lte 0>>[[WIN|win]]
<<else>><<set $playertank.health = $playertank.health - $AItank.damage>>
<<elseif>>
<<endif>>
Along with two passages that select your tank and the enemys tank
YOUR TANK:
<<silently>>
<<set $playertank to {}>>
<<set $panzer_I to {
name: "Panzer_I",
country: "Germany",
health: 54,
damage: 7,
image: "PanzerI",
}>>
<<set $playertank to $panzer_I>>
<<endsilently>>
[img[$playertank.image]]
Name: <<print $playertank.name>>
Country of origin: <<print $playertank.country>>
Health: <<print $playertank.health>>
Main Gun: 2x 7.92mm MG13 (<<print $playertank.damage>> Damage)
[[Combat|Combat]]
ENEMYS TANK:
<<silently>>
<<set $AItank to {}>>
<<set $TKS to {
name: "TKS",
country: "Poland",
health: 25,
damage: 7,
image: "TKS 2",
}>>
<<set $AItank to $TKS>>
<<endsilently>>
[img[$AItank.image]]
Name: <<print $AItank.name>>
Country of Origin: <<print $AItank.country>>
Health: <<print $AItank.health>>
Main Gun: 1x 7.92mm Hotchkiss (<<print $AItank.damage>> Damage)
[[p|Panzer 1]]
Comments
If the Combat 3 passage exists then I believe the [[NEXT ROUND|Combat 3]] link should work.
There are some other problems with your example code:
1. Passage name are case sensitive, so unless you have two passages named WIN and win, you will need to correct the case on some of your links.
2. When using a <<if>><<elseif>><<else>><<endif>> sequence the <<elseif>> macro should come before the <<else>> macro.
Also as the <<elseif>> macros in your examples have no expression they should be removed, as shown in the following copy of your code.
(note: the following is using TWEE notation, lines starting with two colons indicate a new passage, the text on the same line as the two colons is the new passage's title)
Tried everything you said and it still wont work.Anything else i can try?????
I have attached the code for you to look at,please tell me if it works for you(it does not work for me).
I have also removed the images.(the file size was too big with them,to upload it here).
There are a couple of potential issues with it though:
1. After you build your $TKS (and $panzer_I) object variable you then assign that object to the $AItank (and $playertank) variable.
Are you aware that $TKS and $AItank are pointing to the same object and if you change the value of $AItank.name that it would also change the value of $TKS.name? I am guessing that what you are actually trying to do is define a generic Tank object and then assign a copy of that object to a variable, the follow example shows you how to do that: 2. If the Reader travels backwards (using browser back button) through the example they will see "if expression" errors.
Moving all the initial object and variable setup into the StoryInit special passage fixes this issue, which is where these type of things belong anyway.
I have attached a restructured version of your example for you to look at and test.
I am assuming that you are using the latest 1.4.2 version of Twine, which browser (brand,version,32/64bit) and operation system (brand,version,32/64bit) are you using to test your story?
Thankyou for your help,but i am still having the same problem using your code.
Because I don't have a copy of Windows 8.1, could you try two things for me.
1. See if there are any Javascript errors within the Developer Tools Console, this link will explain how to open the Developer Tools and then how to view the Console. Once the Console is open you may need to refresh the page using the F5 key before stepping through your story to the passage that causes the issue, once there see if there are any error messages within the Console and report them here.
2. Try playing both my and your example files using a different browser like FireFox or Chrome, to see if the issue still exists.
The first test will see if it may be IE that is cause the issue, the second test may see if it is Windows 8.1 that is the issue as my example works on WinXP / Win7 using Firefox and Chrome.
Thanks again for all the help.
file://
), rather than remotely (viahttp://
orhttps://
). In that situation, the vanilla story formats (of which Sugarcane is one) switch to using the location hash to store the story state. The way they encode the story state into the hash apparently grows too large for IE with what you're doing.