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

Members Online

»
0 Active | 34 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
Category: CoD Mapping
CoD mapping and level design.
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: Scripts won't start
Harbinger
General Member
Since: Nov 10, 2007
Posts: 54
Last: Apr 18, 2013
[view latest posts]
Level 3
Category: CoD Mapping
Posted: Saturday, Aug. 9, 2008 12:12 am
I have been trying to make scripts recently and I keep having the same problem for each of them. They will not run at all. Id understand if they had an error in them that made them not work but I don'd see why they don't run. Here is my most recent script.

Code:
 main()
{
thread hi;
}

hi()
{
While(1)
{
wait 100000;
iprintln("hi");
}
}


I understand that there is a loop so it woukd keep saying hi over and over but I really just wanted it to run. THe way I had it set up the file was name that _testnew.gsc and put it in maps/mp/gametypes and I did also try maps/mp. I made a .pk3 of that with pakscape and put it in my main folder calling it z_script. THen to test it id make a non dedicated unpure server. Under these settings though it didn't run. Help would be greatly appreciated.

edited on Aug. 8, 2008 08:12 pm by Harbinger
Share |
Gen_Boom
General Member
Since: Apr 24, 2006
Posts: 80
Last: May 5, 2009
[view latest posts]
Level 3
Category: CoD Mapping
Posted: Saturday, Aug. 9, 2008 12:57 am
Well your first error is the way you call your function...

thread hi();

You need the brackets even if theres no parameters in them...
Thats a function call...

another thing is your wait function...
It is also a function so you need the parameter brackets...
And if I was you id lower the value...

wait (10);

This will wait 10 second before procceding...
Share |
Harbinger
General Member
Since: Nov 10, 2007
Posts: 54
Last: Apr 18, 2013
[view latest posts]
Level 3
Category: CoD Mapping
Posted: Saturday, Aug. 9, 2008 01:28 am
ok i made the fixes but for some reason its still not going for some reason. Probably more syntax errors on my part heres the new code.

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

hi()
{
While(1)
{
wait(10);
iprintln("hi");
}
}
Share |
Gen_Boom
General Member
Since: Apr 24, 2006
Posts: 80
Last: May 5, 2009
[view latest posts]
Level 3
Category: CoD Mapping
Posted: Saturday, Aug. 9, 2008 01:36 am
o, i just realised something...

I usually run scripts from within a custom map...
Meaning, when i make a pk3 for a map, the script is ran as a .gsc file for that map...

I dont know how to run a script itself...

I know you can execute .cfg scripts from your uo folder, but thats a different format and a different scripting language...

Im not sure what you have to do to get this working...


But besides that, there is an error which i didnt realise before...

while should be lowercase :)

edited on Aug. 8, 2008 09:37 pm by Gen_Boom
Share |
Harbinger
General Member
Since: Nov 10, 2007
Posts: 54
Last: Apr 18, 2013
[view latest posts]
Level 3
Category: CoD Mapping
Posted: Saturday, Aug. 9, 2008 01:41 am
yeah still doesn't work but the problem means that its probably just not being triggered but I thought thats what the main { thread hi} thing does.
Share |
Gen_Boom
General Member
Since: Apr 24, 2006
Posts: 80
Last: May 5, 2009
[view latest posts]
Level 3
Category: CoD Mapping
Posted: Saturday, Aug. 9, 2008 01:57 am
yes, the main() function is always ran first from the file...
The problem is not within your script anymore...
Now the problem is finding the right place for the file...

main() function is located in every file, however it only belongs to that very file...
Call of Duty does not have an effect on it...

Now you have to find a way to point to your file so that it runs...

Ill think about it...
Share |
Harbinger
General Member
Since: Nov 10, 2007
Posts: 54
Last: Apr 18, 2013
[view latest posts]
Level 3
Category: CoD Mapping
Posted: Saturday, Aug. 9, 2008 02:40 am
hmm.... maybe scripts r precached like menus.. there is some sort of trigger like the ones in maps
Share |
The_Caretaker
General Member
Since: Jun 8, 2004
Posts: 11625
Last: Jul 7, 2009
[view latest posts]
Level 10
Category: CoD Mapping
Posted: Saturday, Aug. 9, 2008 07:42 am
Is the script with the hi() function your mapname.gsc file? Or another one?

A script doesn't automatically run. It needs to be called from somewhere..

maps/mp/scriptname::main();

like so... from script which IS ran... like your mapname.gsc file, whih gets ran automatically on the startup of a map.. or from a gametype .gsc file which gets ran on starting that gametype.

Share |
Harbinger
General Member
Since: Nov 10, 2007
Posts: 54
Last: Apr 18, 2013
[view latest posts]
Level 3
Category: CoD Mapping
Posted: Saturday, Aug. 9, 2008 03:18 pm
cool i think that it is now running my script but now its giving me a bad syntax error.

Code:
main()
{
thread hi;
}

hi()
{
while(1)
{
wait 10;
iprintln("hi");
}
}


This isn't in a map is there anyother place to put it other then the gametypes or map so that it would work in any gametype .

Share |
Harbinger
General Member
Since: Nov 10, 2007
Posts: 54
Last: Apr 18, 2013
[view latest posts]
Level 3
Category: CoD Mapping
Posted: Saturday, Aug. 9, 2008 03:22 pm
ok sry about the double post but i ws late i noticed i forgot the () after hi but when i run it it doesnt give me any errors but it doesnt work either
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty : CoD 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

»