Author |
Topic: Scripting Array Error |
Snipethis |
General Member Since: May 31, 2007 Posts: 59 Last: Apr 4, 2009 [view latest posts] |
|
|
Category: CoD4 Scripting Posted: Sunday, Mar. 8, 2009 04:49 am |
|
Anyone help please looked at following script till my Eyes Cross Pretty sure its just a Brain Fart at least i hope it is
Code: main()
maps\mp\_load::main();
thread moveslider();
{
moveslider()
{
hoist = getentArray("slide","targetname");
if(isdefined(hoist))
for(i=0;i< hoist.size;i++)
}
trig = getent ("slide_triger", "targetname");
while(1)
{
hoist movey(-199,0.05);
wait(20);
trig waittill("trigger");
lamp movey(199,0.05);
lamp waittill("movedone");
wait (5);
}
}
Am getting following Error when i try to compile:
Error
Script Compile Error
Bad Syntax
{(See console for details)
im sure we have all seen that.
looked and nothing is in the Consolel.
If someone find's the obvious please post it for me
and any sugestions if this is going to work.
Thanks
{S-K}SnipeThis
|
|
|
|
Zestycookie |
|
General Member Since: Dec 31, 2006 Posts: 148 Last: Oct 19, 2009 [view latest posts] |
|
|
|
Snipethis |
General Member Since: May 31, 2007 Posts: 59 Last: Apr 4, 2009 [view latest posts] |
|
|
Category: CoD4 Scripting Posted: Sunday, Mar. 8, 2009 05:23 am |
|
Wow ok i really messed up some reason my editor didnt updat my file so it wasent even right Script Here is the Correct script im trying to debug.
Code: main()
maps\mp\_load::main();
thread moveslider();
{
moveslider()
{
hoist = getentArray("slide","targetname");
if(isdefined(hoist))
for(i=0;i< hoist.size;i++)
}
trig = getent ("slide_triger", "targetname");
while(1)
{
trig waittill("trigger");
hoist movey(199,10);
hoist waittill("movedone");
wait(5);
trig waittill("trigger");
hoist movey(-199,10);
hoist waittill("movedone");
wait (5);
}
}
Zestycookie i am still learning with the Scripting its verry possible i left something out.
{S-K)SnipeThis
edited on Mar. 8, 2009 12:26 am by Snipethis |
|
|
|
Sevenz |
|
General Member Since: Apr 24, 2006 Posts: 2390 Last: May 10, 2013 [view latest posts] |
|
|
|
_INSANE_ |
|
General Member Since: Nov 7, 2008 Posts: 352 Last: Jul 10, 2011 [view latest posts] |
|
|
|
Category: CoD4 Scripting Posted: Sunday, Mar. 8, 2009 05:36 am |
|
This would be more of what it should look like, Snipethis.
You had missing brackets, reversed brackets, a for loop in which i saw no use for. I did see the getentArray ..but still.. I have no idea what you are trying to do.
Code: main()
{
maps\mp\_load::main();
thread moveslider();
}
moveslider()
{
hoist = getent("slide","targetname");
trig = getent("slide_trigger", "targetname");
while(1)
{
trig waittill("trigger");
hoist movey(199,10);
hoist waittill("movedone");
wait(5);
trig waittill("trigger");
hoist movey(-199,10);
hoist waittill("movedone");
wait (5);
}
} |
|
|
|
Sevenz |
|
General Member Since: Apr 24, 2006 Posts: 2390 Last: May 10, 2013 [view latest posts] |
|
|
Category: CoD4 Scripting Posted: Sunday, Mar. 8, 2009 05:40 am |
|
Quote: but still.. I have no idea what you are trying to do
me neither, so i tried to keep the original semantics as good as possible (but don't really like it):
Code: main()
{
maps\mp\_load::main();
thread moveslider_thread();
}
moveslider_thread()
{
hoist = getentArray("slide","targetname");
if(isdefined(hoist))
{
for(i=0;i< hoist.size;i++)
{
hoist[i] thread moveslider();
}
}
}
moveslider()
{
trig = getent ("slide_triger", "targetname");
while(1)
{
trig waittill("trigger");
self movey(199,10);
self waittill("movedone");
wait(5);
trig waittill("trigger");
self movey(-199,10);
self waittill("movedone");
wait (5);
}
}
Quote: i am still learning with the Scripting
you better say you started learning |
|
|
|
Snipethis |
General Member Since: May 31, 2007 Posts: 59 Last: Apr 4, 2009 [view latest posts] |
|
|
Category: CoD4 Scripting Posted: Sunday, Mar. 8, 2009 05:56 am |
|
ok Sorry what i am Trying to do is
Have this Item wich i made in Radiant of a Overhead Crain , then made a origin brush selected all and made it into a:
- script brushmodel -
with targetname, slider1
placed said item into a map conected it to a Trigger-Multiple - targetname, slider_triger - target, slider1
So all i am trying to do is move the Crain cariage back and forth on the "Y" axis.
everything i have read says if have more than one brush your moving it must be in a Array format.
As i said i am still learning or trying to
Thanks again
{S-K}SnipeThis
|
|
|
|
Sevenz |
|
General Member Since: Apr 24, 2006 Posts: 2390 Last: May 10, 2013 [view latest posts] |
|
|
Category: CoD4 Scripting Posted: Sunday, Mar. 8, 2009 06:34 am |
|
Quote: more than one brush your moving it must be in a Array format
that's not right, you have to use entity arrays if you name (targetname) more than one entity, e.g. script_brushmodel, the same way. |
|
|
|