How to make multiple scripts for deathrun map?

Chat area specifically for CoDJumper

Moderator: Core Staff

Post Reply
jumpeer
CJ Wannabe
CJ Wannabe
Posts: 1
Joined: November 30th, 2014, 4:14 pm

How to make multiple scripts for deathrun map?

Post by jumpeer » November 30th, 2014, 4:36 pm

My problem: I'm working on a deathrun map and I'm constantly having problems with the script. I just don't know how to have multiple scripts for each trap and other stuff. I have a door and I added a script and it works. But when I added my trap, I added the new trap script to the .gsc file where I have my door script and nothing seems to work- only the door not the trap/s. (I want at least 10 traps but don't know how to handle the scripting)

THE SCRIPT:

#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;
#include common_scripts\utility;
main()
{
maps\mp\_load::main();

thread lift();
thread lift1();

}

lift()
{

lift=getent("lift","targetname");
lift_trigger=getent("lift_trigger","targetname");



while(1)
{


lift_trigger waittill ("trigger");

lift movez (180,4,1,1);

wait(60);

lift movez (-0,4,1,1);

wait(2);




}

}





lift1()
{

lift1=getent("lift1","targetname");
lift_trigger2=getent("lift_trigger2","targetname");



while(1)
{


lift_trigger2 waittill ("trigger");

lift1 movey (-136,4,1,1);

wait(5);

lift1 movey (136,4,1,1);

wait(2);




}

}


I don't know what's wrong with it, I know absolutely nothing about scripting (I just followed a tutorial)
So, do I have to make a new .gsc file for each trap then? I have tried that, but it said I needed to replace the doors script file with the one I want to put.
I really need some help, because I have been looking for help online but didn't find any useful info.
I have another problem I just rage of: When I Compile BSP, compile reflections, build fast file, update zone file (save) and when I test my map, nothing that I added appears. The old things are there but not the new stuff I added. I tried EVERYTHING (Believe me, everything!) but..... no......
Thank you for answering and sorry if this was too long and annoying. I just need help because no one wants/can to help me with my problem!

User avatar
Stagox
CJ Wannabe
CJ Wannabe
Posts: 3
Joined: January 23rd, 2015, 1:22 am
Location: Netherlands

Re: How to make multiple scripts for deathrun map?

Post by Stagox » January 23rd, 2015, 2:19 pm

Hello jumpeer,

I took a look at your script and changed it a little bit. It should work fine now. Note: I haven't tested the script.

Code: Select all

/* I never use this.
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;
#include common_scripts\utility;
*/
main()
{

	maps\mp\_load::main();
	
	game["allies"] = "marines";
	game["axis"] = "opfor";
	game["attackers"] = "axis";
	game["defenders"] = "allies";
	game["allies_soldiertype"] = "desert";
	game["axis_soldiertype"] = "desert";
	
	setdvar("compassmaxrange","1800");

	
	thread lift();
	thread lift1();

}

lift()
{
	platform = getEnt("lift","targetname");
	lift_trigger = getEnt("lift_trigger","targetname");

	while(1)
	{
		lift_trigger waittill("trigger", player);
		platform moveZ(180,4,1,1);
		platform waittill("movedone");
		//wait 5;		How long the platform should stay still before it goes back again.
		platform moveZ(-0,4,1,1); //I'm not sure if this is what you've wanted, or if it's a mistake: -0 should be -180?
		platform waittill("movedone");
		//wait 2;		//Time before you can use the trigger again.
	}
}

lift1()
{
	platform = getEnt("lift1","targetname");
	lift_trigger = getEnt("lift_trigger2","targetname");

	while(1)
	{
		lift_trigger waittill("trigger");
		platform moveY(-136,4,1,1);
		platform waittill("movedone");
		//wait 5;		How long the platform should stay still before it goes back again.
		platform moveY(136,4,1,1);
		platform waittill("movedone");
		//wait 2;		//Time before you can use the trigger again.
	}
}
About the compile error.

Are there any errors while compiling? If the problem still occurs, copy and paste the compile log so I can look for any errors.

Stagox

Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 4 guests