Page 1 of 2

whats wrong with this code my map doesnt load it freezes

Posted: August 30th, 2007, 12:28 am
by Deadly
i named my map dd_zelda (its a remake but jumpmap of a zelda level)

Code: Select all

main()

{
thread dd_zelda1();
thread dd_zelda2();
thread dd_zelda3();
}

dd_zelda1() 
{ 
dd_zelda1 = getent("dd_zelda1","targetname");
trigger = getent("fan1_trig","targetname");
while (1) 
{ 
dd_zelda1 rotateyaw(-360, 5);
dd_zelda1 waittill("rotatespin");
} 
}

dd_zelda2() 
{ 
dd_zelda2 = getent("dd_zelda2","targetname");
trigger = getent("fan1_trig","targetname");   
while (1) 
{ 
dd_zelda2 rotateyaw(-360, 5);
dd_zelda2 waittill("rotatespin");
}
} 

dd_zelda3() 
{
dd_zelda3 = getent("dd_zelda3","targetname");
trigger = getent("fan1_trig","targetname");   
while (1) 
{ 
dd_zelda3 rotateyaw(-360, 5);
dd_zelda3 waittill("rotatespin");
} 
}

Posted: August 30th, 2007, 12:51 am
by Nightmare
when it freezes upon loading, it is usually because either the script flooded or the script_brushmodels were badly made in the .map file.
Send it to me and I will have a look.

Re: whats wrong with this code my map doesnt load it freezes

Posted: August 30th, 2007, 4:19 am
by Lethal323
Deadly wrote:i named my map dd_zelda (its a remake but jumpmap of a zelda level)

Code: Select all

main()

{
thread dd_zelda1();
thread dd_zelda2();
thread dd_zelda3();
}

dd_zelda1() 
{ 
dd_zelda1 = getent("dd_zelda1","targetname");
trigger = getent("fan1_trig","targetname");
while (1) 
{ 
dd_zelda1 rotateyaw(-360, 5);
dd_zelda1 waittill("rotatespin");
} 
}

dd_zelda2() 
{ 
dd_zelda2 = getent("dd_zelda2","targetname");
trigger = getent("fan1_trig","targetname");   
while (1) 
{ 
dd_zelda2 rotateyaw(-360, 5);
dd_zelda2 waittill("rotatespin");
}
} 

dd_zelda3() 
{
dd_zelda3 = getent("dd_zelda3","targetname");
trigger = getent("fan1_trig","targetname");   
while (1) 
{ 
dd_zelda3 rotateyaw(-360, 5);
dd_zelda3 waittill("rotatespin");
} 
}
This is irrelevant but why did you do this line of code?

Code: Select all

trigger = getent("fan1_trig","targetname");   
You never told the trigger to do anything... So why get it?

Posted: August 30th, 2007, 9:17 am
by YaNo
Ya and the 3 triggers are the same aswell :\

Re: whats wrong with this code my map doesnt load it freezes

Posted: August 30th, 2007, 7:42 pm
by Pedsdude
Yano wrote:Ya and the 3 triggers are the same aswell :\
Indeed, much better to do it this way if you want it so that one trigger sets all three things rotating at the same time:

Code: Select all

main()

{
thread dd_zelda();
}

dd_zelda() 
{ 
dd_zelda1 = getent("dd_zelda1","targetname");
dd_zelda2 = getent("dd_zelda2","targetname");
dd_zelda3 = getent("dd_zelda3","targetname");
trigger = getent("fan1_trig","targetname");
while (1) 
{
trigger waittill ("trigger");
dd_zelda1 rotateyaw(-360, 5);
dd_zelda2 rotateyaw(-360, 5);
dd_zelda3 rotateyaw(-360, 5);
dd_zelda1 waittill("rotatespin");
dd_zelda2 waittill("rotatespin");
dd_zelda3 waittill("rotatespin");
} 
}
I'm not sure about the end bit having three waittill's (I'm probably wrong), but try it anyway.

Posted: August 30th, 2007, 8:22 pm
by Nightmare
having three waittill at the end will not work the way you want it to.
the best is to just keep the same script above, but just remove where it gets the trigger entity.

Posted: August 31st, 2007, 12:37 am
by Lethal323
Nightmare wrote:having three waittill at the end will not work the way you want it to.
the best is to just keep the same script above, but just remove where it gets the trigger entity.
Why is that? the trigger is being used...



Here is what nightmare says the script should look like...

Code: Select all

main() 

{ 
thread dd_zelda(); 
} 

dd_zelda() 
{ 
dd_zelda1 = getent("dd_zelda1","targetname"); 
dd_zelda2 = getent("dd_zelda2","targetname"); 
dd_zelda3 = getent("dd_zelda3","targetname"); 
trigger = getent("fan1_trig","targetname"); 
while (1) 
{ 
trigger waittill ("trigger"); 
dd_zelda1 rotateyaw(-360, 5); 
dd_zelda2 rotateyaw(-360, 5); 
dd_zelda3 rotateyaw(-360, 5); 
dd_zelda3 waittill("rotatespin"); 
} 
}

Posted: August 31st, 2007, 3:28 am
by Nightmare
By the script above, I meant what deadly originally had.
And that still wouldn't work as intended. but since its a rotating loop, it wouldn't make much of a difference.

Re: whats wrong with this code my map doesnt load it freezes

Posted: August 31st, 2007, 4:51 pm
by Pedsdude
This is what Nightmare meant:

Code: Select all

main()

{
thread dd_zelda1();
thread dd_zelda2();
thread dd_zelda3();
}

dd_zelda1() 
{ 
dd_zelda1 = getent("dd_zelda1","targetname");
trigger = getent("fan1_trig","targetname");
while (1) 
{ 
trigger waittill ("trigger");
dd_zelda1 rotateyaw(-360, 5);
dd_zelda1 waittill("rotatespin");
} 
}

dd_zelda2() 
{ 
dd_zelda2 = getent("dd_zelda2","targetname");
trigger = getent("fan1_trig","targetname");   
while (1) 
{ 
trigger waittill ("trigger");
dd_zelda2 rotateyaw(-360, 5);
dd_zelda2 waittill("rotatespin");
}
} 

dd_zelda3() 
{
dd_zelda3 = getent("dd_zelda3","targetname");
trigger = getent("fan1_trig","targetname");   
while (1) 
{ 
trigger waittill ("trigger");
dd_zelda3 rotateyaw(-360, 5);
dd_zelda3 waittill("rotatespin");
} 
}

Posted: August 31st, 2007, 8:33 pm
by Nightmare
no this is what I meant. :P

Code: Select all

main()

{
thread dd_zelda1();
thread dd_zelda2();
thread dd_zelda3();
}

dd_zelda1()
{
dd_zelda1 = getent("dd_zelda1","targetname");
while (1)
{
dd_zelda1 rotateyaw(-360, 5);
dd_zelda1 waittill("rotatespin");
}
}

dd_zelda2()
{
dd_zelda2 = getent("dd_zelda2","targetname"); 
while (1)
{
dd_zelda2 rotateyaw(-360, 5);
dd_zelda2 waittill("rotatespin");
}
}

dd_zelda3()
{
dd_zelda3 = getent("dd_zelda3","targetname"); 
while (1)
{
dd_zelda3 rotateyaw(-360, 5);
dd_zelda3 waittill("rotatespin");
}
}

Posted: August 31st, 2007, 9:27 pm
by [SoE]_Zaitsev
Just curious, what map from what game are you converting ? =)

Posted: September 1st, 2007, 1:51 am
by JDogg
[SoE]_Zaitsev wrote:Just curious, what map from what game are you converting ? =)
It's a remake of a zelda level

Posted: September 1st, 2007, 11:24 am
by [SoE]_Zaitsev
well doh :P

There are multiple Zelda games and tons of different zones.

Posted: September 1st, 2007, 3:22 pm
by JDogg
[SoE]_Zaitsev wrote:well doh :P

There are multiple Zelda games and tons of different zones.
Well doh, you could have asked what Zelda game are you making a map off :lol:

Posted: September 1st, 2007, 3:50 pm
by [SoE]_Zaitsev
I did >_>