Sign in to follow this  

Call of Duty 4 Map script help!

This topic is 2958 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've looked over this little bit of code millions of times...and cannot figure out what the problem is... >< sad face....if anyone can help me, i would be very very very grateful...In my attempts to try to fix this error..i think i ended up making it worse lol ^^ Heres the function:
trigger_explosion()
{
trigger = GetEnt("trigger_radius", "targetname");

while(1)//infinite loop >< =(
{
trigger WaitTill("trigger", player);
if(player IsTouching(trigger) && player UseButtonPressed())
{
org1 = (80,80,0);
//hard coded coordinates, i tried to do trigger.origin()...still errors soo idk
// i would think .origin only works on players or ...models but triggers do //have a origin in the .map file sooo....yeah...
PlayFX("dragon_spawn",org1, 1, 3);

}
}
}
}//this bracket was to close the Main() that you did not see...inside main() is thread trigger_explosion()...all the stuff inside main works..
The error just says that it is a Syntax error. Console doesn't give very good details though. If i were to guess... i would think that the problem is the wrong type of parameter passed into the GetEnt Func...or the coordinates in the PlayFX() function...i've tested several ways of writing this part and still received the error so...i think it could be something else. Here is a link to Reference the functions used in call of duty 4 scripting...there is a tab to select Multiplayer functions only... http://openwarfaremod.com/cod4script/

Share this post


Link to post
Share on other sites
I've never seen COD4 scripts before, but hopefully this helps.

Quote:
Original post by Daggerblade
The error just says that it is a Syntax error. Console doesn't give very good details though.

Do you not get any helpful information like the line the error occurs on?

Quote:
...or the coordinates in the PlayFX() function...

Well, taking a look at PlayFX's documentation at that link you gave, it shows that its 2 last arguments are meant to be vectors, namely the forward and up orientation vectors for the FX. You're passing in 1 and 3 for these arguments, which look like plain scalars. Perhaps you should be passing in vectors, or, since the arguments are optional, not be passing in anything at all?
It also says that the ID argument comes from a call to LoadFX. You're passing in a string literal - is this valid?

Also, I know it mentions "game-specific scripting languages" in this forum's topic description, but perhaps you might get a better response for a niche language/modding API like this in a COD4-modding-specific forum?

Share this post


Link to post
Share on other sites
yeah, the console in cod4 doesn't say which line it is on >< unless there's something i don't know ><.

ahh that makes since for the playFX function...those last two args are optional, so ill try it without them.

ohh wow sweet i never noticed that thing about loadFX, thanks a bunch man...hehe

yeah i tried to get into a forum for cod4 specific scripting but...for some reason wouldn't let me register...so i came here ^>^


Alright thanks a bunch man, i will try those changes... and ill post back if it worked :)

Share this post


Link to post
Share on other sites

This topic is 2958 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this