The Dink Network

Reply to Re: Before...

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
October 21st 2018, 09:27 AM
duck.gif
toof
Peasant He/Him
I disagree. 
but how do we set, reset and test various bits
What I've said so far was strictly for static values. So no variable changing.

But let's say you have a fetch quest for Bob, and he has &bob_var global variable:
void talk(void)
{
	if(&bob_var == 0)
	{
		say("Bring me some Talporn!!", ¤t_sprite);
		&bob_var = 1; //bug alert here, but ignore it for now
	}
	if(&bob_var == 1)
	{
		say("Have you found Talporn yet?", ¤t_sprite);
		
	}
	// Dink finds some Talporn eventually which sets &bob_var = 2;
	if(&bob_var == 2)
	{
		say("I brought to you your deepest desire", 1);
		say("Muito obrigado", ¤t_sprite);
		&bob_var = 3; // again, bug
	}
	if(&bob_var = 3)
	{
		say("I'll never forget the favour, Dink", ¤t_sprite);
	}
}


Now, this &bob_var, goes from 0 to 3 (so 0000 to 0011). I'm thinking about another function now, that will be able to change the global binary var. Otherwise, yes, this whole concept is useless.