I keep getting a coding error. Could anyone help me find the problem?

Yes. On the main website just go to the scenes directory. So

https://www.choiceofgames.com/dragon/scenes/
https://www.choiceofgames.com/vampire/scenes/

etc

It’s a little more complex on the games you need to purchase and I only know the method for doing that in Chrome.

There is a function that erases an option from the list after it has been choosen when returning to the page (so that the player doesn’t end up choosing the same hability twice). And, if you add a counter, as simple as “*temp count 0” and then make every option have a “*set count +1”, you can then have an “*if (count = 3) *goto nextpage”

@Aquila
That seems to be exactly what I need. I’ll try it out!

@DJ_CUTY

You can look at my supplies page for how I did it:

http://zombieexodus.com/zombieexodus/mygame/scenes/Supplies.txt

You can copy it if you want. I basically do what Aquila said, using weight as the check.

I think the multiple choice is limited to two. I use two when you pick your gun and ammo


*fake_choice gun ammo
  #gun1
    #ammo1
      *set gun "gun one"
      *set ammo "ammo one"

    #ammo2
      *set gun "gun one"
      *set ammo "ammo two"

  #gun2
    #ammo1
      *set gun "gun two"
      *set ammo "ammo one"

    #ammo2
      *set gun "gun two"
      *set ammo "ammo two"

can anyone spot anything wrong with this?
An error comes up that says
line 8: non existent variable “goto_scene”
I have a scene labeled “initial course of action” so it should send me there, but it doesn’t. I’ve also employed a *hide_reuse code but it doesn’t hide the choices that I’ve chosen.


\*temp count 0
\*hide_reuse 
\*choice
	#Poisonous toad- As a poisonous toad, Beckham can secrete said poison into a vial, allowing you to utilize this poison as an additional weapon in your arsenal. Requires 1 manna.
		\*set Transformations "Poisonous toad- As a poisonous toad, Beckham can secrete said poison into a vial, allowing you to utilize this poison as an additional weapon in your arsenal. Requires 1 manna."
		\*if (count = 3) \*goto_scene initial course of action
		\*set count +1
	#Pit Viper- As a pit viper Beckham possesses deadly venom and speed and is hard to detect. Requires 2 manna.
		\*set Transformations "Pit Viper- As a pit viper Beckham possesses deadly venom and speed and is hard to detect. Requires 2 manna."
		\*if (count = 3) \*goto_scene initial course of action
		\*set count +1
	#Crow- As a scavenger, he has a natural sharpness regarding the olfactory sense; your boggart could detect the smell of carnage, or any other scent, from miles away. Cloaked in pure black, he also serves well as a spy, as his dark color affords him natural camouflage. Requires 2 manna.
		\*set Transformations "As a scavenger, he has a natural sharpness regarding the olfactory sense; your boggart could detect the smell of carnage, or any other scent, from miles away. Cloaked in pure black, he also serves well as a spy, as his dark color affords him natural camouflage. Requires 2 manna."
		\*if (count = 3) \*goto_scene initial course of action
		\*set count +1
	#Red tailed boa- As a fully grown red tailed boa, Beckham is effective in that he can crush his enemies in battle, and is an excellent climber. Requires 3 manna.
		\*set Transformations "Red tailed boa- As a fully grown red tailed boa, Beckham is effective in that he can crush his enemies in battle, and is an excellent climber. Requires 3 manna."
	#Hound- With an acute sense of smell, high stamina and a powerful bite, Beckham the hound is an adept tracker in all areas, save for bodies of water. He is also capable in battle. Requires 3 manna.
		\*set Transformations "Hound- Hound- With an acute sense of smell, high stamina and a powerful bite, Beckham the hound is an adept tracker in all areas, save for bodies of water. He is also capable in battle. Requires 3 manna."
		\*if (count = 3) \*goto_scene initial course of action
		\*set count +1
	#Eagle- With a wingspan of 8 feet, keen senses, and razor sharp talons and beak, Beckham the eagle is an adept tracker and scout, and is a fair companion in short term battles. Requires 3 manna.
		\*set Transformations "Eagle- With a wingspan of 8 feet, keen senses, and razor sharp talons and beak, Beckham the eagle is an adept tracker and scout, and is a fair companion in short term battles. Requires 3 manna."
		\*if (count = 3) \*goto_scene initial course of action
		\*set count +1
	#Ostrich- Swift and powerful, Beckham the ostrich is a formidable ally, able to knock a man dead in one kick. Additionally, his size and strength allow him to transport you at speeds of up to 20 miles per hour. Requires 4 manna.
		\*set Transformations "Ostrich- Swift and powerful, Beckham the ostrich is a formidable ally, able to knock a man dead in one kick. Additionally, his size and strength allow him to transport you at speeds of up to 20 miles per hour. Requires 4 manna."
		\*if (count = 3) \*goto_scene initial course of action
		\*set count +1
	#Horse- Equipped with astounding stamina, Beckham the horse is able to run, with you atop, for half an hour at speeds up to 45 miles per hour. Along with this, he is also fairly effect in battle. Requires 4 manna.
		\*set Transformations "Horse- Equipped with astounding stamina, Beckham the horse is able to run, with you atop, for half an hour at speeds up to 45 miles per hour. Along with this, he is also fairly effect in battle. Requires 4 manna."
		\*if (count = 3) \*goto_scene initial course of action
		\*set count +1
	#Crocodile- Heavily armored and equipped with a mouthful of deadly teeth, Beckham the crocodile wields deadly strength and speed. He is also able to transport you with ease through bodies of water. Requires 4 manna.
		\*set Transformations "Crocodile- Heavily armored and equipped with a mouthful of deadly teeth, Beckham the crocodile wields deadly strength and speed. He is also able to transport you with ease through bodies of water. Requires 4 manna."
		\*if (count = 3) \*goto_scene initial course of action
		\*set count +1
	#Tiger- One of the mightiest of all felines, Beckham is a lightning fast, brutally strong, razor sharp, formidable ally in battle. Requires 5 manna.
		\*set Transformations "Tiger- One of the mightiest of all felines, Beckham is a lightning fast, brutally strong, razor sharp, formidable ally in battle. Requires 5 manna." 
		\*if (count = 3) \*goto_scene initial course of action
		\*set count +1


<pre/>

Im not a expert but i believe you can’t put a scene with words. only one lol. you could do initial_course_of_action but why you put so long name? no one could read it its not practical

That’s really good. It helps explain what you’re trying to do. It’s not going to work as intended, but it’s a great step.

Every time you use “*set transformations” the previous information stored in the transformation is wiped and a new one is assigned. It will just remember the last one you assigned.

So when you choose toad, it does *set transformations “toad” it remembers transformations=“toad”

Then when you choose viper, it does *set transformations “viper” and it remembers transformations=“viper” forgetting all about what was previously assigned there. It clears the old information and just remembers the new.

Does this make sense?

So instead, what I’d suggest doing, is create a different variable for each transformation. I’ll just use your first three options as an example, you can carry it through to the others.

In startup you do


*create transformation_toad false
*create transformation_viper false
*create transformation_crow false

And then for the choices section (I’m snipping out your gotos and some other stuff here for simplicity’s sake but you will need them back in).


*choice
	#Poisonous toad- As a poisonous toad, Beckham can secrete said poison into a vial, allowing you to utilize this poison as an additional weapon in your arsenal. Requires 1 manna.
		*set transformation_toad "true" 
		*set count +1
	#Pit Viper- As a pit viper Beckham possesses deadly venom and speed and is hard to detect. Requires 2 manna.
		*set transformation_viper "true"  
		*set count +1
	#Crow- As a scavenger, he has a natural sharpness regarding the olfactory sense; your boggart could detect the smell of carnage, or any other scent, from miles away. Cloaked in pure black, he also serves well as a spy, as his dark color affords him natural camouflage. Requires 2 manna.
		*set transformation_crow "true" 

Then, on the choicescript_stats file, if you want to list all of your transformations, you can put


Transformations:

*if transformation_toad
	Poisonous toad- As a poisonous toad, Beckham can secrete said poison into a vial, allowing you to utilize this poison as an additional weapon in your arsenal. Requires 1 manna.

*if transformation_viper
	Pit Viper- As a pit viper Beckham possesses deadly venom and speed and is hard to detect. Requires 2 manna.

*if transformation_crow
	Crow- As a scavenger, he has a natural sharpness regarding the olfactory sense; your boggart could detect the smell of carnage, or any other scent, from miles away. Cloaked in pure black, he also serves well as a spy, as his dark color affords him natural camouflage. Requires 2 manna.


And if you want to have the choice to transform you do something like.


What do you want to transform into?

*choice
	*selectable_if ((transformation_toad) and (manna>=1)) #Poisonous Toad
		*goto toad stuff
	*selectable_if ((transformation_viper) and (manna>=2)) #Pit Viper
		*goto viper stuff
	*selectable_if ((transformation_crow) and (manna>=2)) #Crow
		*goto crow stuff

I’d also suggest having a stat called current_form so it remembers what shape you’re currently in. Create that up in startup and then *set current_form “toad” or whatnot every time you change into whatever form, or revert to your original one.

Now, second step, you’ve missed out a couple of things.

I think the hide_reuse should work as is, it seems in the right place.

Problem 1: The goto_scene command isn’t working as intended. When in doubt I try to move things onto a new line to see if they work, so I’d do.



*temp count 0
*hide_reuse 
*choice
	#Poisonous toad- As a poisonous toad, Beckham can secrete said poison into a vial, allowing you to utilize this poison as an additional weapon in your arsenal. Requires 1 manna.
		*set Transformations "Poisonous toad- As a poisonous toad, Beckham can secrete said poison into a vial, allowing you to utilize this poison as an additional weapon in your arsenal. Requires 1 manna."
		*set count +1
		*if (count = 3) 
			*goto_scene initial course of action


Note in the above example I’ve also switched around where the set count and if are. First you need to increase the count, then you check to see what it is. If you’re checking before you increase the count you get an extra choice.

Problem 2: With a choice statement you must always tell it where to go. It knows where to go if the count is 3. It doesn’t know what to do if the count isn’t 3. So you need to do two things. You need to label the top of the transformations choice, and you need to add in a *goto command so it knows to return to the top if the count hasn’t reached 3.

So


*temp count 0
*label transformation choice
*hide_reuse 
*choice
	#Poisonous toad- As a poisonous toad, Beckham can secrete said poison into a vial, allowing you to utilize this poison as an additional weapon in your arsenal. Requires 1 manna.
		*set Transformations "Poisonous toad- As a poisonous toad, Beckham can secrete said poison into a vial, allowing you to utilize this poison as an additional weapon in your arsenal. Requires 1 manna."
		*set count +1
		*if (count = 3) 
			*goto_scene initial course of action
		*goto transformation choice


Oh that makes a lot more sense! And this is coming from a novice, but wouldn’t it be


*set transformation_viper true

because booleans don’t go into quotes?

Yep! You’re right, no quotes. :slight_smile: Trust me to code at 4am. See even I make plenty of mistakes.

Incidentally, have a look at the shapeshifting system in Seven Winds. I’m not saying copy it, just have a look. Also play the game and see how it tackles shapeshifting. I’m so sad that it’s not looking like it’ll ever be finished since I loved that game and how it does magic and the shifting of forms.

http://tenryu.fhost.com.au/wind/mygame/index.html is the game.

http://tenryu.fhost.com.au/wind/mygame/mygame.js has the list of scene files (since it was made before the new version of choicescript.)

http://tenryu.fhost.com.au/wind/mygame/scenes/01_form.txt has the first sample of how the shapeshifting is done.

http://tenryu.fhost.com.au/wind/mygame/scenes/choicescript_stats.txt for how it’s implemented on the stats screen.

I find looking through how other people do things helps me, even if I don’t plan to do things the same way. There are differences between your transformations and Seven Winds shapeshifting.

show could make code appear in the yellow test??

Thanks for all the tips, it really helped. I think I’m becoming better at coding by the day:P and one last question- couldn’t I add the descriptions of the transformations into the transformations stat by using
&""
so that it wouldn’t replace them?

@Marajade put

< pre>
Codestuff
< /pre>

Without the space between the < and pre>

@DJ_Cuty That’s great that it’s helping. I’m glad that you’re getting better.

Can you explain what do you mean by that? If you can show me an example of how you think it should be coded even better.

well if you just use

*set inventory “one destruction grenade”

then it changes the inventory from staff, iron, salt, etc

to just one destruction grenade.

but, if you use the code

*set inventory &", one desruction grenade"

it changes the inventory to staff, iron, salt, one destruction grenade, etc

because the & symbol before the quotations lets you add the quotes into the inventory.

Wait. Nevermind:P it works but it’s just redundant because it means that there are two descriptions of the same transformation, because I already set it to true xD

@FairyGodfeather

hmm…for some reason it’s not excepting this code. I was trying to make it so that the list of inventory items weren’t strung out in one big line.


\*create Inventory "Demon Book of Names"
\*line_break "chemical instilled staff"
\*line_break "silver chain"
\*line_break "8/8 iron shavings"
\*line_break "2/2 salt"
\*line_break "knife"
\*line_break "master key"
\*line_break "candles"
\*line_break "4/4 healing ointment"
\*line_break "food"
\*line break "water"
<pre/>

I didn’t know about &“item”. I’ve learned something today. I don’t write games with inventories or long lists like that since my skills aren’t up to it.

Your list won’t work like that because when you type

*create inventory “Demon Book of Names”

it stops right after that. It reads all the next things as being their own separate items. It doesn’t know you want to create everything as a group together. The three ways I know to create linebreaks, being *linebreak, < br> and inserting double returns don’t seem to work in the variable command. I’d admittedly do things a bit differently if I wanted things as a list on different lines. Instead of doing ${inventory} to display everything I’d do:


*fake_choice
    #Item1
        *set item1 true
    #Item2
        *set item2 true

Inventory:
*if item1 ${item1}
*line_break
*if item2 ${item2}

hmm…maybe I’ll just keep them as is. But I wonder if they’ll word wrap in the final version?

They should word wrap.

You can’t put line breaks in a string, it’s impossible without editing the interpreter.