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

Members Online

»
0 Active | 9 Guests
Online:

LATEST FORUM THREADS

»
Script errors
CoD4 MP Mapping
water
CoD4 MP 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 4
Category: CoD4 Scripting
Scripting and coding with Call of Duty 4.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Restricted Access subscribe
Author Topic: Whats wrong with this script.
mayhem
General Member
Since: Sep 11, 2007
Posts: 61
Last: Sep 1, 2008
[view latest posts]
Level 3
Category: CoD4 Scripting
Posted: Sunday, Aug. 31, 2008 10:04 am
When i run my map i get an error saying "string" is not an object
and when i see console for details it points me towards the line in my elevator.gsc that says "floor1" waittill ("trigger");

In radiant i have an elevator with a targetname of elevator :P and two triggers. One called floor1 and one called ground.

In my mapname.gsc file i have.
"maps\mp\elevator::main();"
And in my .csv i have "rawfile,maps/mp/elevator.gsc"

And this is the script im using

maps\mp\_load::main();
thread elevator_floor1();
thread elevator_ground();
}

elevator_floor1()
{
elevator = getentarray("elevator","targetname");
floor1 = getentarray("floor1","targetname");

while(1)
{
"floor1" waittill ("trigger");
wait 2;
elevator moveZ (120,5,2,2);
elevator waittill ("movedone");
}
}

elevator_ground()
{
elevator = getentarray("elevator","targetname");
ground = getentarray("ground", "targetname");

while(1)
{
"ground" waittill ("trigger");
wait 2;
elevator moveZ (-120,5,2,2);
elevator waittill ("movedone");
}
}
Share |
ukdjaj
General Member
Since: Jun 1, 2008
Posts: 2690
Last: May 3, 2013
[view latest posts]
Level 9
Category: CoD4 Scripting
Posted: Sunday, Aug. 31, 2008 10:22 am
Try this you shouldn't have "" in your script and it should be "trig" otherwise theres nothing for floor 1 to do.


Code:

maps\mp\_load::main();
thread elevator_floor1();
thread elevator_ground();
}

elevator_floor1()
{
elevator = getentarray("elevator","targetname");
floor1 = getentarray("floor1","targetname");

while(1)
{
trig waittill ("trigger");
wait 2;
elevator moveZ (120,5,2,2);
elevator waittill ("movedone");
}
}

elevator_ground()
{
elevator = getentarray("elevator","targetname");
ground = getentarray("ground", "targetname");

while(1)
{
trig waittill ("trigger");
wait 2;
elevator moveZ (-120,5,2,2);
elevator waittill ("movedone");
}
}


i think if that don't work take out ""
Share |
mayhem
General Member
Since: Sep 11, 2007
Posts: 61
Last: Sep 1, 2008
[view latest posts]
Level 3
Category: CoD4 Scripting
Posted: Sunday, Aug. 31, 2008 10:30 am
awww now i get a error saying script compile error unitialised variable "trig"

trig waittill "trigger";
Share |
ukdjaj
General Member
Since: Jun 1, 2008
Posts: 2690
Last: May 3, 2013
[view latest posts]
Level 9
Category: CoD4 Scripting
Posted: Sunday, Aug. 31, 2008 11:20 am
Ok then try this

Code:


maps\mp\_load::main();
thread elevator_floor
thread elevator_ground
}
elevator_floor()
{
elevator = getent("elevator","targetname");
floor = getent("floor1","targetname");

while(1)
{
floor waittill ("trigger");
wait 2;
elevator moveZ (120,5,2,2);
elevator waittill ("movedone");
}
}

elevator_ground()
{
elevator = getent("elevator","targetname");
down = getent("ground", "targetname");

while(1)
{
ground waittill ("trigger");
wait 2;
elevator moveZ (-120,5,2,2);
elevator waittill ("movedone");
}
}
Share |
ukdjaj
General Member
Since: Jun 1, 2008
Posts: 2690
Last: May 3, 2013
[view latest posts]
Level 9
Category: CoD4 Scripting
Posted: Sunday, Aug. 31, 2008 11:21 am
that will work BUT if it doesn't, then wait for rasta or caretaker.
Share |
Restricted Access Restricted Access subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 Scripting

Latest Syndicated News

»
Why console gaming is dying
Quote:Consider this: Dedicated gaming sales — including living-room consoles...
Devs: Games are being dumb...
Click 'read more' to view the contents of this post.
Loadout
Gun Crafting to the Max. edited on Sep. 25, 2012 06:57 pm by Morp...
Introducing the Source Fil...
Surprised this wasn't made a long time ago. Sounds like a nice little feature.
Introducing the Source Fil...
The Source Filmmaker (SFM) is the movie-making tool built and used by us he...

Partners & Friends

»