whats wrong with this code my map doesnt load it freezes

Have questions about CoD/UO mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Deadly
CJ Fan
CJ Fan
Posts: 138
Joined: July 14th, 2007, 8:53 pm
Location: New Jersey
Contact:

whats wrong with this code my map doesnt load it freezes

Post by Deadly » August 30th, 2007, 12:28 am

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");
} 
}
Image

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Post by Nightmare » August 30th, 2007, 12:51 am

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.
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

Lethal323

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

Post by Lethal323 » August 30th, 2007, 4:19 am

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?

User avatar
YaNo
CJ Worshipper
CJ Worshipper
Posts: 460
Joined: May 5th, 2005, 9:34 pm
Location: Azeroth
Contact:

Post by YaNo » August 30th, 2007, 9:17 am

Ya and the 3 triggers are the same aswell :\

Pedsdude
Site Admin
Site Admin
Posts: 15909
Joined: October 15th, 2004, 7:18 pm
Location: UK

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

Post by Pedsdude » August 30th, 2007, 7:42 pm

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.
Image
Image

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Post by Nightmare » August 30th, 2007, 8:22 pm

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.
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

Lethal323

Post by Lethal323 » August 31st, 2007, 12:37 am

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"); 
} 
}

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Post by Nightmare » August 31st, 2007, 3:28 am

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.
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

Pedsdude
Site Admin
Site Admin
Posts: 15909
Joined: October 15th, 2004, 7:18 pm
Location: UK

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

Post by Pedsdude » August 31st, 2007, 4:51 pm

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");
} 
}
Image
Image

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Post by Nightmare » August 31st, 2007, 8:33 pm

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");
}
}
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

User avatar
[SoE]_Zaitsev
Core Staff
Core Staff
Posts: 14220
Joined: October 21st, 2004, 7:17 pm
Location: Holland
Contact:

Post by [SoE]_Zaitsev » August 31st, 2007, 9:27 pm

Just curious, what map from what game are you converting ? =)
matt101harris wrote:big cock was the first thing that came to my head lol

JDogg
Too cool for CoDJumper
Too cool for CoDJumper
Posts: 3617
Joined: August 28th, 2007, 11:46 am
Location: Melbourne, Australia

Post by JDogg » September 1st, 2007, 1:51 am

[SoE]_Zaitsev wrote:Just curious, what map from what game are you converting ? =)
It's a remake of a zelda level
Image
Image

User avatar
[SoE]_Zaitsev
Core Staff
Core Staff
Posts: 14220
Joined: October 21st, 2004, 7:17 pm
Location: Holland
Contact:

Post by [SoE]_Zaitsev » September 1st, 2007, 11:24 am

well doh :P

There are multiple Zelda games and tons of different zones.
matt101harris wrote:big cock was the first thing that came to my head lol

JDogg
Too cool for CoDJumper
Too cool for CoDJumper
Posts: 3617
Joined: August 28th, 2007, 11:46 am
Location: Melbourne, Australia

Post by JDogg » September 1st, 2007, 3:22 pm

[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:
Image
Image

User avatar
[SoE]_Zaitsev
Core Staff
Core Staff
Posts: 14220
Joined: October 21st, 2004, 7:17 pm
Location: Holland
Contact:

Post by [SoE]_Zaitsev » September 1st, 2007, 3:50 pm

I did >_>
matt101harris wrote:big cock was the first thing that came to my head lol

Post Reply

Who is online

Users browsing this forum: No registered users and 32 guests