Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (SBGuy), 712 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
str_width - video not available?? #422290
05/07/13 09:48
05/07/13 09:48
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
I use 'str_width' to get the width of the displayed string.. I use it in the main function, and I don't load any levels, but why do I get this error??
Quote:
Malfunction W1507: Video functions not available before first frame
I know how can I fix this, but I'm just curios, why does 'str_width' cause this problem?


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: str_width - video not available?? [Re: 3run] #422291
05/07/13 09:51
05/07/13 09:51
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
I am not sure but maybe str_width is calling a DirectX function and thus the error is thrown.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: str_width - video not available?? [Re: Superku] #422294
05/07/13 09:58
05/07/13 09:58
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Maybe, I don't know.. But anyway, this looks strange at the first place to me. And it should had something about this in the manual I guess.



Greets


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: str_width - video not available?? [Re: 3run] #422344
05/07/13 19:47
05/07/13 19:47
Joined: Mar 2013
Posts: 30
Portugal
J
joao13pt Offline
Newbie
joao13pt  Offline
Newbie
J

Joined: Mar 2013
Posts: 30
Portugal
The manual in GameStudio has many flaws and LOTS of things aren't described the way they should be, most times i have to google something that the manual should explain
In my experienci, whenever that error ocurred in my scripts i just added a wait(1); to wait 1 frame before the line that was causing this error. So, if it has something to do with the video it may have something to do with DirectX, like Superku said
try googling "lite-c str_width" and search around some websites

Re: str_width - video not available?? [Re: joao13pt] #422347
05/07/13 19:51
05/07/13 19:51
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
Lite-C (and other engines) use DirectX to check how wide a text is. But for this you need a DirectX device so just wait until total_frames is higher than 0 before calling wait(1);


Visit my site: www.masterq32.de
Re: str_width - video not available?? [Re: MasterQ32] #422348
05/07/13 19:59
05/07/13 19:59
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
ok, it's clear now, thank you all.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: str_width - video not available?? [Re: 3run] #422356
05/08/13 06:57
05/08/13 06:57
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline
Serious User
PadMalcom  Offline
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
I had the same issue and I prefer MasterQ32's solution:

while(total_frames < 1) wait(1);


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | 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