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

Members Online

»
0 Active | 59 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

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 2
Category: CoD2 MP Mapping
CoD 2 mapping and level design.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: moving stuff script help.
magdoom
General Member
Since: May 4, 2006
Posts: 172
Last: Nov 8, 2006
[view latest posts]
Level 4
Category: CoD2 MP Mapping
Posted: Friday, Aug. 4, 2006 04:13 am
I get the "bad syntax error when I use this script..

I place it in the maps\mp\ folder.
the gsc is:

Code:

main()
{
maps\mp\newmap::main();
maps\mp\movingplatform;
maps\mp\_load::main();

setExpFog(0.0001, 0.55, 0.6, 0.55, 0);
// setCullFog(0, 16500, 0.55, 0.6, 0.55, 0);
ambientPlay("ambient_france");

game["allies"] = "american";
game["axis"] = "german";
game["attackers"] = "allies";
game["defenders"] = "axis";
game["american_soldiertype"] = "normandy";
game["german_soldiertype"] = "normandy";

setCvar("r_glowbloomintensity0", ".25");
setCvar("r_glowbloomintensity1", ".25");
setcvar("r_glowskybleedintensity0",".3");

}


. I do believe i called upon it correctly.

Now the script to move the platform is::

Code:

main()
{
thread platform();
}

platform()
{
platform = getent ("platform","targetname");
trig = getent ("platform_trigger","targetname");
while(1);
{
trig waittill ("trigger");
platform movez (-612, 10, 4, 4);
platform waittill ("movedone");
trig waittill ("trigger");
platform movez (612, 10, 4, 4);
platform waittill ("movedone");
}
}


-edit- sry.. did a double-paste

please note. I'm still new at this scripting thing. so go ez on me :P

Thanks,
-Mag-DooM


edited on Aug. 4, 2006 12:17 am by magdoom

edited on Aug. 4, 2006 12:17 am by magdoom
Share |
veef
General Member
Since: Apr 25, 2006
Posts: 1258
Last: Aug 29, 2006
[view latest posts]
Level 8
Category: CoD2 MP Mapping
Posted: Friday, Aug. 4, 2006 04:26 am
If your platform script is in the "movingplatform.gsc" then you would need maps\mp\movingplatform::main(); in your main .gsc instead you have maps\mp\movingplatform;
Share |
magdoom
General Member
Since: May 4, 2006
Posts: 172
Last: Nov 8, 2006
[view latest posts]
Level 4
Category: CoD2 MP Mapping
Posted: Friday, Aug. 4, 2006 05:58 am
i tried that and it still didnt work [crazy]
Share |
sentchy
General Member
Since: May 6, 2006
Posts: 212
Last: Oct 31, 2006
[view latest posts]
Level 4
Category: CoD2 MP Mapping
Posted: Friday, Aug. 4, 2006 12:19 pm
Question: Do you have two GSC files and what are their names? As veef suggested if you have two GSC files and want to call a function in the second GSC from the main GSC file, there is a certain syntax to follow. This is basically the name of the GSC and its location without the GSC, followed by double colon and then the name of the function in the second GSC.

In your example if the second GSC file is located in the maps\mp folder with the name "platform.gsc', then the correct way to call a function main in this second GSC would be: "maps\mp\platform::main();". If the name of the second GSC is doplatforms.gsc and it is located only in the maps directory, then the call would be "maps\doplatforms:main();".

Alternatively just place everything in your primary GSC file. The changes I made is basically copy both code samples you gave together, changed the function name of main in the second to handleplatforms and place the call to handleplatforms at the end of the main routine of the map just to make sure all standard code is started up first which I consider safer when dealing with moving objects:


Code:
main()
{
maps\mp\newmap::main();
// maps\mp\movingplatform; We call this at the end of main
maps\mp\_load::main();

setExpFog(0.0001, 0.55, 0.6, 0.55, 0);
// setCullFog(0, 16500, 0.55, 0.6, 0.55, 0);
ambientPlay("ambient_france");

game["allies"] = "american";
game["axis"] = "german";
game["attackers"] = "allies";
game["defenders"] = "axis";
game["american_soldiertype"] = "normandy";
game["german_soldiertype"] = "normandy";

setCvar("r_glowbloomintensity0", ".25");
setCvar("r_glowbloomintensity1", ".25");
setcvar("r_glowskybleedintensity0",".3");

// Kick off the threads for handling moving platforms. Use a threaded call so you can add more lines after this safely.
thread handleplatforms();
}

handleplatforms()
{
thread platform();
}

platform()
{
platform = getent ("platform","targetname");
trig = getent ("platform_trigger","targetname");
while(1);
{
trig waittill ("trigger");
platform movez (-612, 10, 4, 4);
platform waittill ("movedone");
trig waittill ("trigger");
platform movez (612, 10, 4, 4);
platform waittill ("movedone");
}
}



edited on Aug. 4, 2006 08:20 am by sentchy
Share |
The_Caretaker
General Member
Since: Jun 8, 2004
Posts: 11625
Last: Jul 7, 2009
[view latest posts]
Level 10
Category: CoD2 MP Mapping
Posted: Friday, Aug. 4, 2006 07:28 pm
if you hold the shift key while pulling down your console you should get a bit more info on WHERE the error occurs.

maps\mp\newmap::main(); <-- what is that line doing? Do you have a .gsc file called "newmap.gsc"?
Share |
magdoom
General Member
Since: May 4, 2006
Posts: 172
Last: Nov 8, 2006
[view latest posts]
Level 4
Category: CoD2 MP Mapping
Posted: Friday, Aug. 4, 2006 10:14 pm
Ok, the line

maps\mp\newmap::main()

isnt doing anything. It was a mistake on a line, but i have tried running the map with it, but without the one to call the movingplatform.gsc file, and it worked perfectly, so this isnt causing the problem. I will, however, remove this line.

When i hold shift and bring down the console, it tells me this::


*****************
Bad Syntax
******************

From my experience with this error, its telling me that i have input an invalid function, or character into the script, but I have not found anything like it while looking over my scripts.

Other than that, the console tells me the warnings it always tells me when loading or disconnecting from my hosted server.

Maybe ill try rewriting the script?

Thanks for all the help. I hope we can get this solved. ;)
Share |
magdoom
General Member
Since: May 4, 2006
Posts: 172
Last: Nov 8, 2006
[view latest posts]
Level 4
Category: CoD2 MP Mapping
Posted: Saturday, Aug. 5, 2006 12:23 am
I've solved the "Bad Syntax" error. I had a repeating block not stated correctly or something like that. (my bro helped a lil)


Now im having problems with making my platform wait to be triggered.

In my map, i have a script brushmodel with
key/value

targetname/platform

and I have 2 triggers with:

targetname/platform_trigger
target/platform

This is my new script::

Code:
main()
{
thread platform();
}

platform()
{
platform = getent ("platform","targetname");
trig = getentarray ("platform_trigger","targetname");
while(1)   //last time i had a ; right after while(1).
{
trig waittill ("trigger");
platform waittill ("trig");
platform movez (-612, 10, 4, 4);
platform waittill ("movedone");
trig waittill ("trigger");
platform waittill ("trig");
platform movez (612, 10, 4, 4);
platform waittill ("movedone");
};   //I needed the ; right here.
}





For some reason, this script wont wait for the trigger...
With the setup its at right now, it doesnt move.

with this setup

Code:
main()
{
thread platform();
}

platform()
{
platform = getent ("platform","targetname");
trig = getentarray ("platform_trigger","targetname");
while(1)
{
trig waittill ("trigger");
platform movez (-612, 10, 4, 4);
platform waittill ("movedone");
trig waittill ("trigger");
platform movez (612, 10, 4, 4);
platform waittill ("movedone");
};
}





It just goes on continuously up and down...

Any ideas?

-How can I make the script wait for the trigger to be activated ingame?


edited on Aug. 4, 2006 08:25 pm by magdoom
Share |
sentchy
General Member
Since: May 6, 2006
Posts: 212
Last: Oct 31, 2006
[view latest posts]
Level 4
Category: CoD2 MP Mapping
Posted: Saturday, Aug. 5, 2006 02:08 am
What trigger did you create?

I think you want a trigger_use

edited on Aug. 4, 2006 10:10 pm by sentchy
Share |
magdoom
General Member
Since: May 4, 2006
Posts: 172
Last: Nov 8, 2006
[view latest posts]
Level 4
Category: CoD2 MP Mapping
Posted: Saturday, Aug. 5, 2006 06:07 am
i used trigger_use..
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 MP Mapping

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

»