[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - Map cycle with FRIK_FILE?

Map cycle with FRIK_FILE?

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Map cycle with FRIK_FILE?

Postby Orion » Thu Jan 30, 2014 5:00 pm

Hey, I'm kind of a noob with FRIK_FILE, and I don't know if there's already a similar topic, but I would like to do this: make a list of all maps I want to cycle into a single .txt file, and when changing level the game reads the first line, then the second, and so on without creating several files for a single map each. Is it possible? Thanks! :)
User avatar
Orion
 
Posts: 476
Joined: Fri Jan 12, 2007 6:32 pm
Location: Brazil

Re: Map cycle with FRIK_FILE?

Postby frag.machine » Thu Jan 30, 2014 6:03 pm

I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2120
Joined: Sat Nov 25, 2006 1:49 pm

Re: Map cycle with FRIK_FILE?

Postby Orion » Fri Jan 31, 2014 2:34 am

User avatar
Orion
 
Posts: 476
Joined: Fri Jan 12, 2007 6:32 pm
Location: Brazil

Re: Map cycle with FRIK_FILE?

Postby Cobalt » Fri Jan 31, 2014 5:46 am

User avatar
Cobalt
 
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA

Re: Map cycle with FRIK_FILE?

Postby Orion » Fri Jan 31, 2014 5:25 pm

Worked, but it keeps cycling between two maps. I think it should memorize the first line, erase it and fputs() into the end of the file.
User avatar
Orion
 
Posts: 476
Joined: Fri Jan 12, 2007 6:32 pm
Location: Brazil

Re: Map cycle with FRIK_FILE?

Postby Cobalt » Fri Jan 31, 2014 8:06 pm

.string mapname I believe is the current map you have loaded up, so I would say, grab each string from the file until it matches one, then the next string read is the one you want to load nextlevel to. Probably best to strzone everytime you read a string from the file. If you have (8) maps in a rotation, mark the first line in the file with that number. Ftos() > strzone that number and count each string as its read. If it reached 8 you know you are on the last map in the rotation, so you could either mark the end string with another character so that if it reads that character, start over with your count set back to the first position.

This post also has a good example of using Frikfile:

viewtopic.php?f=2&t=4852&p=44306&hilit=crazy+frik#p44306
User avatar
Cobalt
 
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA

Re: Map cycle with FRIK_FILE?

Postby Cobalt » Mon Jun 29, 2015 3:20 am

Curious if you got this working? I am gonna try the code myself shortly.
User avatar
Cobalt
 
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest