Gamestudio Links
Zorro Links
Newest Posts
FXCM demo test failed
by qin. 01/13/26 11:16
Camera always moves upwards?
by NeoDumont. 01/12/26 09:39
Alpaca Plugin v1.5.2 Release
by kzhao. 01/11/26 13:42
Alpaca Plugin v1.4.0
by kzhao. 01/11/26 13:38
separating groups of 3 digits by a comma
by joe_kane. 01/11/26 00:01
MRC.c and WFO
by joe_kane. 01/10/26 23:58
BarOffset (default = 940 for daily bars?
by joe_kane. 01/10/26 23:46
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (qin, 1 invisible), 4,305 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
promfast, joe_kane, Namitha_NN, Syndrela, agasior
19190 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Strings question #306204
01/20/10 14:21
01/20/10 14:21
Joined: Dec 2009
Posts: 74
Romania,Bucharest
Ted22 Offline OP
Junior Member
Ted22  Offline OP
Junior Member

Joined: Dec 2009
Posts: 74
Romania,Bucharest
Hello!i got a newbie question...
i got the following code:
///////////////////////////////
#include <acknex.h>
#include <default.c>

///////////////////////////////

var a;

PANEL* pDisplay =
{
digits (10, 10, 5, *, 1, a);
flags = VISIBLE;
}

function main()
{
video_mode=7;
screen_color.blue = 150;
while(-1)
{
a = random(13);
wait(-1);
}
}


And i want to tell the engine to show me a string "word" if a = 1 and if a > 1 string is removed or hided

Last edited by Ted22; 01/20/10 14:22.
Re: Strings question [Re: Ted22] #306207
01/20/10 14:47
01/20/10 14:47
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>

///////////////////////////////
var a;

PANEL* pDisplay =
{
	pos_x = 10;
	pos_y = 10;
	digits (10, 10, "var a contains the number: %.0f", *, 1, a);
	flags = SHOW;
}

function main()
{
	video_mode=7;
	screen_color.blue = 150;
	random_seed(0);
	
	while(1)
	{
		a = integer(random(13));
		if(a == 1) {
			set(pDisplay, SHOW);
		} else {
			reset(pDisplay, SHOW);
		}
		wait(-1);
	}
}



have fun with it laugh


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: Strings question [Re: Helghast] #306210
01/20/10 14:51
01/20/10 14:51
Joined: Dec 2009
Posts: 74
Romania,Bucharest
Ted22 Offline OP
Junior Member
Ted22  Offline OP
Junior Member

Joined: Dec 2009
Posts: 74
Romania,Bucharest
it said 'random seed' uncliered indentifier

Last edited by Ted22; 01/20/10 14:51.
Re: Strings question [Re: Ted22] #306212
01/20/10 14:52
01/20/10 14:52
Joined: Dec 2009
Posts: 74
Romania,Bucharest
Ted22 Offline OP
Junior Member
Ted22  Offline OP
Junior Member

Joined: Dec 2009
Posts: 74
Romania,Bucharest
i'm using A7 btw

Re: Strings question [Re: Ted22] #306216
01/20/10 15:11
01/20/10 15:11
Joined: Dec 2009
Posts: 74
Romania,Bucharest
Ted22 Offline OP
Junior Member
Ted22  Offline OP
Junior Member

Joined: Dec 2009
Posts: 74
Romania,Bucharest
i modified it to
///////////////////////////////
#include <acknex.h>
#include <default.c>

///////////////////////////////
var a;

PANEL* pDisplay =
{
pos_x = 10;
pos_y = 10;
digits (10, 10, 5, *, 1, a);
flags = VISIBLE;
}

function main()
{
video_mode=7;
screen_color.blue = 150;
while(1)
{
a = integer(random(13));
if(a = 1)
{
set(pDisplay, VISIBLE);
}
else
{
reset(pDisplay , VISIBLE);
}
wait(-1);
}
}




and now my a == 1 and do not change,why?

Re: Strings question [Re: Ted22] #306218
01/20/10 15:16
01/20/10 15:16
Joined: Dec 2009
Posts: 74
Romania,Bucharest
Ted22 Offline OP
Junior Member
Ted22  Offline OP
Junior Member

Joined: Dec 2009
Posts: 74
Romania,Bucharest
oh,now works!Thanks!
///////////////////////////////
#include <acknex.h>
#include <default.c>

///////////////////////////////
var a;

PANEL* pDisplay =
{
pos_x = 10;
pos_y = 10;
digits (10, 10, 5, *, 1, a);
flags = VISIBLE;
}

function main()
{
video_mode=7;
screen_color.blue = 150;
while(1)
{
a = integer(random(2));
if(a == 1)
{
set(pDisplay, VISIBLE);
}
else
{
reset(pDisplay , VISIBLE);
}
wait(-1);
}
}

Re: Strings question [Re: Ted22] #306219
01/20/10 15:22
01/20/10 15:22
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
it works, but only when the random is 1... also, what version of A7 are you using, random_seed should work... I have tested this on the latest A7 version.

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1