Just wondering if there's an easier way to do this...

Greetings Humans and Forum-Wanderers.

I have been constructing a game using desktop squiffy (Latest Version).

It's a survival game.
At some point, the player can make a spear for hunting; and this is the code:

@clear
{if rodBamboo>=9:{if leafCloth>=8:{@xtrmBasicShltr=1}{@lvl2craft=1}{@rodBamboo-=9}{@leafCloth-=8}}{else:You don't have the resources for that!}{else:You don't have the resources for that!}``` 

Is there an easier way to do that?

-Part 2-

Okay, next:
I want the player to gain 1 hunger each turn, however; I have no idea how many turns the player may make. Is there a way to do this? 

P.S I checked the documentation and couldn't find anything.

Thanks

I'm thinking (for readability) to break in into more logical sections (forgive me if this dosn't work - I'm writing it here without testing)

{if rodBamboo>=9:{if leafCloth>=8:
{@xtrmBasicShltr=1}
{@lvl2craft=1}
{@rodBamboo-=9}
{@leafCloth-=8}
}
{else:You don't have the resources for that!}{else:You don't have the resources for that!}

As far as the other goes, if you just want to deduct a hunger each turn, you can use the [[]]: section. This will run with every turn you make but you have to be careful - it might run more than you want it to. But it would be something like...

[[]]:
@inc hunger

Hope this helps.


This topic is now closed. Topics are closed after 180 days of inactivity.

Support

Forums