Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (AndrewAMD), 16,038 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
c-script loop #169308
11/25/07 04:34
11/25/07 04:34
Joined: Sep 2007
Posts: 80
R
ruchen Offline OP
Junior Member
ruchen  Offline OP
Junior Member
R

Joined: Sep 2007
Posts: 80
How does the c-script language work? If one function has a while(1) loop,and another function which aslo has a while(1) loop is included in the first loop,can the sentences behind the second function in the first function loop executived?

function1()
{
...
while(1)
{
...
function2();
...
wait(1);
}
}
function2()
{
...
while(1)
{
...
wait(1);
}
}

Re: c-script loop [Re: ruchen] #169309
11/25/07 04:49
11/25/07 04:49
Joined: Jan 2006
Posts: 968
EpsiloN Offline
User
EpsiloN  Offline
User

Joined: Jan 2006
Posts: 968
You mean to call a function with an endless while loop every frame in an endless while loop ? I've done it by mistake , when I was building an inventory. It'll eighter slow down the engine or crash...


Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201
Re: c-script loop [Re: EpsiloN] #169310
11/25/07 08:35
11/25/07 08:35
Joined: Mar 2007
Posts: 677
0x00000USA
M
MrCode Offline
User
MrCode  Offline
User
M

Joined: Mar 2007
Posts: 677
0x00000USA
Yes, I've also done this before by accident on a few occasions. The while loop repeatedly calls the function with the other while loop in it, thereby adding it to the number of functions running (there can be many instances of a single function running at the same time in Acknex). Because this goes on forever (until the engine is closed), eventually the number of simultaneous functions running will be so high that it's gonna really cut into your game's frame rate. Try to avoid making this kind of mistake.


Code:
void main()
{
    cout << "I am MrCode,";
    cout << "hear me roar!";
    system("PAUSE");
}

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