Opposite stats (problem)


#1

Hii guys, I’m probably blind but I can’t find anywhere how to make opposite stats. Like those percent stats where (mostly) in the beginning it is 50/50 each and by making choices it goes either way: like childlike/mature good/evil independent/dependent.

afbeelding

This effect is what I want achieve :slight_smile:
Anyone who can help me and give me an example?

Thanks alot!

a newly trying coder :wink:


#2

It’s

*stat_chart
   opposed_stat var1
      Text2

Or
*stat_chart
   opposed_stat var1
      Text1
      Text2

I think (on mobile atm, cant check quickly)
First will display as
Var1name vs text2
The other as
Text1 vs text2


#3

When you create an opposed pair, you only need to create a variable for one of each of the pairs and you use text labels on each side. The way they’ve done your example is:

Create the variables for each of the stats in startup.txt

*create stat_impulsive 58
*create stat_sarcastic 58
*create stat_friendly 59
*create stat_easygoing 43

And in choicescript_stats.txt they’ve used:

*stat_chart
	opposed_pair stat_impulsive
		Impulsive
		Cautious
	opposed_pair stat_sarcastic
		Sarcastic
		Genuine
	opposed_pair stat_friendly
		Friendly
		Stoic
	opposed_pair stat_easygoing
		Easygoing
		Stubborn

#4

Just have the
*create
Start out with 50 (or whatever you wish it to start at)


#5

I tried to do it like you guys said but something is still wrong :s

afbeelding
and

afbeelding

afbeelding

can you guys see what I did wrong?


#6

hi, just popping in have u tried making sure theres no space between opposed_pair and stat chart and arranging them so that the opposed_pair is under the t for stat_chart? i know indentation is super important…

like

edit: sorry super weird how it wont allow me to do spacing properly…


#7

Add three ` above and below the code to format it in a post


#8

oohhh thank you for that XD had a hard time lol


#9

You don’t need a blank line between *stat_chart and the following *opposed_pair and when you’re indenting, use either spaces or tabs, never try to use both.


#10

perfectly aligned, no (faulty) spaces and starting under the T of stat, with or without space between *stat_chart there keeps being a fault in the system :sweat:


#11

Got to be something in your files. I didn’t just type that out on the fly, I created it in a test file I use in CSIDE and checked that it worked before copying and pasting it in to the forum.

Can you show us exactly what you have in your choicescript_stats file. Put ``` above the text before you paste it in so it formats correctly.


#12

I will do it but I dont think it would turn up with much, did not put a lot before it since I’m still trying to form the beginning stats :s but if you think it will help. (this is what you mean right?)

btw I appriciate it a lot that you help so much and I’m sure you put your time into this :slight_smile:

afbeelding


#13

You pasted an image. We can’t see what’s going on with that. Can you just copy the text from the file onto the clipboard and paste it in as a forum post. Put ``` above it so it formats as text.

If you’re on windows, CTRL+A selects everything in the editing window, CTRL+C copies the selection onto the clipboard then create a reply in this thread, add the ``` followed by a return and then use CTRL+V to paste the code in.


#14
This is your stats screen!

Name:? Castle

Age: 1 year old

Gender: ?

*stat_chart
opposed_pair stat_impulsive
		Impulsive
		Cautious

opposed_pair stat_charming
		Charming
		Direct

#15

Thanks, that’s better. It’s easier to see what’s going on there :wink:

opposed_pair needs to be indented.

It should look like:

*stat_chart
[INDENT] opposed_pair stat_impulsive
[INDENT][INDENT] Impulsive
[INDENT][INDENT] Cautious

Choicescript is like Python in the way it uses indents to identify code blocks. Correct indentation is essential.


#16

eep! it just started working! :smiley: tnx so much!


#17

You’re welcome. Glad to help. Once you’re over those first few formatting choicescript headaches the rest should just fall into place :wink: