Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 8 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty
Category: CoD+UO General
General game questions, comments, and chat.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: Can't get intro_screen script to work
BattleGrunt
General Member
Since: Oct 25, 2005
Posts: 12
Last: Jul 13, 2017
[view latest posts]
Level 1
Category: CoD+UO General
Posted: Sunday, Apr. 9, 2006 11:20 pm
Hey guys, I have a question regarding Call of Duty scripting.
I'm trying to creating an intro screen for my map.
Unfortunately, the online tutorials haven't been that
helpful. I've reviewed these two for the intro screen:
(http://www.modsonline.com/Tutorials-read-123.html)
and
(http://www.modsonline.com/Tutorials-read-308.html).
Anyways, I tried replicating the code in each tutorial with no luck. All I have is a single map along with the .str, .gsc, and new introscreen_gmii.gsc. All files with the exception of the introscreen_gmii.gsc have the same file name. I appreciate it if someone could take a look and see where I might be going wrong on it? Thanks.

Script file for map: dv_midterm_2
****************************************
main()
{
maps\_load::main();
level.player takeallweapons();

maps\_introscreen_gmii::main();

precacheshader("black");

thread intro_screen();
level waittill("finished intro screen");
}

intro_screen()
{
precacheString(&"dv_midterm_2_LOCATION");
precacheString(&"dv_midterm_2_COUNTRY");
precacheString(&"dv_midterm_2_DATE");
precacheString(&"dv_midterm_2_TIME");
maps\_introscreen_gmii::introscreen(&"dv_midterm_2_LOCATION",&"dv_midterm_2_COUNTRY",&"dv_midterm_2_DATE",&"dv_midterm_2_TIME");
}

****************************************
Share |
SparkyMcSparks
General Member
Since: Feb 28, 2004
Posts: 1713
Last: Dec 29, 2016
[view latest posts]
Level 8
Im a fan of MODSonair
Category: CoD+UO General
Posted: Sunday, Apr. 9, 2006 11:36 pm
You could go about it like this:
Code:
intro_screen()
{
precacheString("YOUR_LOCATION");
precacheString("YOUR_COUNTRY");
precacheString("YOUR_DATE");
precacheString("YOUR_TIME");
maps\_introscreen_gmi::introscreen("YOUR_LOCATION,"YOUR_COUNTRY","YOUR_DATE","YOUR_TIME");
}

Depends on your coding style - if you want to use a .STR. But the way I put it up there seems readable and easier, pretty sure reliable too.

EDIT: Whoa, I didn't catch that, good job York[thumbs_up]

So with Yorks advice it should work now, and the code posted above would work just aswell.

edited on Apr. 9, 2006 07:41 pm by [FR]Sparks
Share |
Yorkshire-Rifles
General Member
Since: Mar 16, 2005
Posts: 272
Last: Apr 19, 2008
[view latest posts]
Level 5
Category: CoD+UO General
Posted: Sunday, Apr. 9, 2006 11:39 pm
maps\_introscreen_gmii::introscreen("YOUR_LOCATION," etc, etc

That's a problem it should be _gmi but ONLY for UO - not for original Call of Duty. Try it as:

maps\_introscreen::introscreen("YOUR_ etc, etc
Share |
BattleGrunt
General Member
Since: Oct 25, 2005
Posts: 12
Last: Jul 13, 2017
[view latest posts]
Level 1
Category: CoD+UO General
Posted: Monday, Apr. 10, 2006 04:48 am
Ok, I've tried the suggusted fix but it won't work. I get this message: "precacheShader must be called before any wait statements in the gametype or level script." I've tried relocating the precache lines above the waittill line but no luck. Thoughts?

***********************************************
main()
{
maps\_load::main();
level.player takeallweapons();

maps\_introscreen::main();

precacheshader("black");

thread intro_screen();
level waittill("finished intro screen");
}

intro_screen()
{
precacheString("Location - Wolfschlucht 3 Bunker, France");
precacheString("August 12, 1944");
precacheString("0830 hrs");
maps\_introscreen::introscreen("Location - Wolfschlucht 3 Bunker, France","August 12, 1944","0830 hrs");
}

******************************************************
Share |
Slime0
General Member
Since: Aug 25, 2005
Posts: 63
Last: Apr 23, 2006
[view latest posts]
Level 3
Category: CoD+UO General
Posted: Monday, Apr. 10, 2006 07:50 am
I believe there are waits inside of maps\_introscreen::main(). Since you're not calling that as a separate "thread", precacheshader doesn't get called until it finishes. (main() waits for it to finish before continuing.)

Simply use

thread maps\_introscreen::main();

and main() won't wait for it anymore.
Share |
BattleGrunt
General Member
Since: Oct 25, 2005
Posts: 12
Last: Jul 13, 2017
[view latest posts]
Level 1
Category: CoD+UO General
Posted: Monday, Apr. 10, 2006 08:30 am
When I add "thread", I get this error:
"cannot cast string to istring" and it points to the precacheString ("Location - Wolf...)
It says it's called from "thread intro_screen();"
and from "main()"

Suggestions?
Share |
The_Caretaker
General Member
Since: Jun 8, 2004
Posts: 11625
Last: Jul 7, 2009
[view latest posts]
Level 10
Category: CoD+UO General
Posted: Monday, Apr. 10, 2006 10:28 am
Suggestions: Read this tutorial. It's all in there. Just do it exactly as done in the tutorial.

edited on Apr. 10, 2006 06:29 am by The_Caretaker
Share |
BattleGrunt
General Member
Since: Oct 25, 2005
Posts: 12
Last: Jul 13, 2017
[view latest posts]
Level 1
Category: CoD+UO General
Posted: Monday, Apr. 10, 2006 12:23 pm
Am I missing something? The_Caretaker you did read my initial post, right? I followed this tutorial plus the other one on the website. If I did miss something, please point it out. Thanks.
Share |
The_Caretaker
General Member
Since: Jun 8, 2004
Posts: 11625
Last: Jul 7, 2009
[view latest posts]
Level 10
Category: CoD+UO General
Posted: Monday, Apr. 10, 2006 12:40 pm
Yes, I read your first post... But I also see you didn't follow it in your last .gsc file

intro_screen()
{
precacheString("Location - Wolfschlucht 3 Bunker, France");
precacheString("August 12, 1944");
precacheString("0830 hrs");
maps\_introscreen::introscreen("Location - Wolfschlucht 3 Bunker, France","August 12, 1944","0830 hrs");
}

That won't work..

you can only precache strings from a .str file. As described in the tutorial.
Share |
BattleGrunt
General Member
Since: Oct 25, 2005
Posts: 12
Last: Jul 13, 2017
[view latest posts]
Level 1
Category: CoD+UO General
Posted: Monday, Apr. 10, 2006 01:04 pm
The problem is I've tried what you're suggest before. I did it exactly as the tutorials state and had a .str file and everything and it didn't work. Please read all the above posts.
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty : CoD+UO General

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»