Page 11 of 11
Posted: April 22nd, 2006, 11:15 am
by Drofder2004
Luke wrote:I think you need the origin brush or it won't rotate where you want it...but you should've selected both door and origin brush and made them a script_brushmodel at the same time, if you made them separate brushmodels it won't work.
Ah, ofcourse. forgot

Havent done rotations for a long time.
As luke said, Make the door, then make the origin brush (this will act as the "hinge") then select both and make them a script_brushmodel

Posted: April 22nd, 2006, 2:14 pm
by Soviet
ok, i did as you said and the map does not crash anymore, but the swinging door still does not work. If it is easier, could someone just tell me how to make a sliding door instead? because it really doesn't matter.
Posted: April 22nd, 2006, 3:27 pm
by Nightmare
to make the slidding door just use my tut for the moving platforms.
Posted: April 22nd, 2006, 6:19 pm
by Soviet
i tried to make a sliding door using your tutorial replacing trigger_multiple with trigger_use but it didn't work. This is my script:
Code: Select all
main()
{
thread secretdoor();
}
secretdoor()
{
platform = getent ("secretdoor","targetname");
trigger = getent ("secretdoor_trigger","targetname");
while(1)
{
trigger waittill ("trigger");
wait(1);
platform moveZ (50,1,0.1,0.1);
wait(3);
platform moveZ (-50,1,0.1,0.1);
platform waittill ("movedone");
}
}
It doesn't work. I also tried moving it on the x and y axis with different time intervals. I checked several times and the names are correct. The thing i am moving is a script_brushmodel with the targetname secretdoor. The trigger is a trigger_use with the targetname secretdoor_trigger. The .gsc file is named secretdoor and is mentioned under my main .gsc. Is there anything i am missing?
Posted: April 22nd, 2006, 8:22 pm
by Drofder2004
put iprintln's everywhere.
Code: Select all
main()
{
iprintln("Main started");
thread secretdoor();
iprintln("Secret Door Thread Run");
}
secretdoor()
{
iprintln("Secret Door Thread Started");
platform = getent ("secretdoor","targetname");
trigger = getent ("secretdoor_trigger","targetname");
while(1)
{
iprintln("While loop running");
trigger waittill ("trigger");
iprintln("Triggered");
wait(1);
platform moveZ (50,1,0.1,0.1);
iprintln("First Move");
wait(3);
platform moveZ (-50,1,0.1,0.1);
iprintln("Second Move");
platform waittill ("movedone");
iprintln("Loop Complete");
}
}
And also. Just some quick checks for common errors...
Is the file....
1. Saved as GSC and not CFG
2. Saved with the EXACT same name as the bsp
3. In the correct folder (maps\mp)
Posted: April 22nd, 2006, 10:26 pm
by Soviet
put that in place of my script, absolutely no change. And checked other stuff you said. Not sure what you meant by exact same name though im guessing main .gsc, in which case it is cause all my other scripts are working
Posted: April 22nd, 2006, 10:48 pm
by Luke
sounds like its not running your gsc. it could be that there is another gsc with the same name conflicting with it...so maybe try naming the gsc file to something more unique.
Posted: April 23rd, 2006, 2:03 am
by Soviet
i changed name of .gsc and of trigger and door brushes by adding soviet in front. I also changed the main .gsc to access the new name. Still no result

Posted: April 23rd, 2006, 2:46 am
by Luke
Do you see a hint when you're near the trigger? you could also try adding the code as a new thread in the main gsc which you know is working, coz it should do something, at least one of those iprintln's should appear in game.
Posted: April 23rd, 2006, 3:09 am
by Nightmare
Soviet, if you want you can send me the .map over X-fire or MSN and I will add it.
Posted: April 23rd, 2006, 3:48 pm
by Drofder2004
Post up all your GSC's Soviet. I'm almost 100% sure its a GSC problem and NOT a map problem.
Posted: April 23rd, 2006, 5:08 pm
by Soviet
soviet_standoff.gsc
Code: Select all
main()
{
level._effect["fire"] = loadfx ("fx/fire/tinybon.efx");
maps\mp\_fx::loopfx("fire", (-24, 8, 32), 0.4);
ambientPlay("ambient_mp_depot");
maps\mp\_load::main();
maps\mp\soviet_sound::main();
maps\mp\stuka::main();
maps\mp\soviet_elevator::main();
maps\mp\trapdoor::main();
maps\mp\sovietsecretdoor::main();
game["allies"] = "russian";
game["axis"] = "german";
game["russian_soldiertype"] = "conscript";
game["russian_soldiervariation"] = "normal";
game["german_soldiertype"] = "wehrmacht";
game["german_soldiervariation"] = "normal";
game["attackers"] = "allies";
game["defenders"] = "axis";
}
soviet_elevator.gsc
Code: Select all
main() {
level.elevatorDown = true; // elevator starts at bottom: true/false
level.elevatorMoving = false; // elevator is not currently moving
thread elevator_start();
}
elevator_start() {
elevator = getentarray ("elevatorswitch2","targetname");
if ( isdefined(elevator) )
for (i = 0; i < elevator.size; i++)
elevator[i] thread elevator_think();
}
elevator_think() {
while (1) {
self waittill ("trigger");
if (!level.elevatorMoving)
thread elevator_move();
}
}
elevator_move() {
elevatormodel = getent ("elevatormodel", "targetname");
level.elevatorMoving = true;
speed = 2;
height = 192;
wait (1);
if (level.elevatorDown) { // moves to top
elevatormodel playsound ("elevator1"); // sound definition for soundaliases.csv
wait (1); // wait a second to hear the motor start and then start the movement of the lift - feels more realistic
elevatormodel moveZ (-250,4,1,1);
elevatormodel waittill ("movedone");
level.elevatorDown = false;
wait (5);
elevatormodel playsound ("elevator1"); // sound definition for soundaliases.csv
wait (1); // wait a second to hear the motor start and then start the movement of the lift - feels more realistic
elevatormodel moveZ (250,4,1,1);
elevatormodel waittill ("movedone");
level.elevatorDown = true;
}
level.elevatorMoving = false;
}
soviet_sound.gsc
Code: Select all
main()
{
thread message1();
}
message1()
{
messagetrig = getent ("fireburn","targetname");
while(1)
{
messagetrig waittill ("trigger",user);
user playSound("fireburn");
wait 3;
}
}
sovietsecretdoor.gsc
Code: Select all
main()
{
iprintln("Main started");
thread sovietsecretdoor();
iprintln("Secret Door Thread Run");
}
sovietsecretdoor()
{
iprintln("Secret Door Thread Started");
platform = getent ("sovietsecretdoor","targetname");
trigger = getent ("sovietsecretdoor_trigger","targetname");
while(1)
{
iprintln("While loop running");
trigger waittill ("trigger");
iprintln("Triggered");
wait(1);
platform moveZ (50,1,0.1,0.1);
iprintln("First Move");
wait(3);
platform moveZ (-50,1,0.1,0.1);
iprintln("Second Move");
platform waittill ("movedone");
iprintln("Loop Complete");
}
}
stuka.gsc
Code: Select all
main()
{
level thread planes();
}
planes()
{
level.PlaneSpeed = 3.5;
stuka1 = getent ("stuka1","targetname");
stuka2 = getent ("stuka2","targetname");
stuka3 = getent ("stuka3","targetname");
temp = getent (stuka1.target,"targetname");
stuka1.dest = temp.origin;
stuka1.start = stuka1.origin;
stuka1 hide();
temp = getent (stuka2.target,"targetname");
stuka2.dest = temp.origin;
stuka2.start = stuka2.origin;
stuka2 hide();
temp = getent (stuka3.target,"targetname");
stuka3.dest = temp.origin;
stuka3.start = stuka3.origin;
stuka3 hide();
wait 2;
while (1)
{
stuka1 thread plane_flyby("stuka_flyby");
wait .15;
stuka2 thread plane_flyby("stuka_flyby");
wait .15;
stuka3 thread plane_flyby("stuka_flyby");
wait 60;
}
}
plane_flyby(sound)
{
// If you specified a sound to play then play it
if (isdefined (sound))
self playsound (sound);
wait 15;
self show();
self moveto(self.dest, level.PlaneSpeed, 0.1, 0.1);
wait level.PlaneSpeed;
self hide();
self.origin = self.start;
}
trapdoor.gsc
Code: Select all
main()
{
trapdoor();
}
trapdoor()
{
door = getent ("trapdoor","targetname"); //the door it self with the origin
door_trigger = getent ("trapdoor_trigger","targetname"); // a trigger use to activte the door
while(1)
{
door_trigger waittill ("trigger");
door rotateto ((0,0,90),1);
wait 6;
door rotateto ((0,0,0),1);
}
}
and yes, a hand comes up when i look at the trigger ingame and i also tried adding to main .gsc, didn't work
Posted: April 23rd, 2006, 5:23 pm
by Drofder2004
Ok, do this. Move all your GSS files to another folder for now.
We are going to use a new script JUST to test this door.
So.
soviet_standoff.gsc
Code: Select all
main()
{
maps\mp\sovietsecretdoor::main();
}
sovietsecretdoor.gsc
Code: Select all
main()
{
wait 10; // FOR TESTING
iprintln("Secret Door Thread Started");
platform = getent ("sovietsecretdoor","targetname");
trigger = getent ("sovietsecretdoor_trigger","targetname");
while(1)
{
iprintln("While loop running");
trigger waittill ("trigger");
iprintln("Triggered");
wait(1);
platform moveZ (50,1,0.1,0.1);
iprintln("First Move");
wait(3);
platform moveZ (-50,1,0.1,0.1);
iprintln("Second Move");
platform waittill ("movedone");
iprintln("Loop Complete");
}
}
Now hopefully. When you start up your map your first gsc will run. That GSC should then run the secret door GSC.
Then after 10 seconds you the thread will start.
You should now start seeing messages on the left hand side...
1. "Secret Door Thread Started"
2. "While loop running"
3. "Triggered" <-After you press the trigger.
4. "First Move" <- After 1 second
5. "Second Move" <-After another 3 seconds
6. "Loop Complete"
If you dont get any of that, then we have a map problem.