Page 9 of 11

Posted: March 27th, 2006, 11:02 pm
by Luke
Soviet wrote:i guess so. I copied and pasted the brush on the top and put it on the bottom. I changed the targetname and made an alternate script for the new trigger and linked to it in main .gsc. When i went to test it it was the same as it always was
showing us the scripts might help too, and you don't need a new gsc file for every trigger(just add threads), infact you dont need a new gsc at all, its just a good way to organize sections of the maps scripting.

Posted: March 27th, 2006, 11:14 pm
by Soviet
heres the one for my first trigger

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 ("elevatorswitch","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; 
} 
else { // moves to bottom 
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; 
} 
heres the one for my second trigger

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; 
} 
else { // moves to bottom 
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; 
} 

Posted: March 28th, 2006, 12:37 am
by Drofder2004
For a start you cannot use "level.elevatordown" twice. As level means it is used in the entire script. So if level.elevatordown is down on one elevator, then it will be down for the other. Make sure you rename all "level" stuff.

(Thats why you should never copy and paste :P)

Posted: April 4th, 2006, 3:09 am
by Soviet
well i sort of got the elevator to work...whatever. thanks for the help on that.

i did what you said for the models, but it still doesn't work. I recompiled with those folders filled with the files in my call of duty/main folder and they still aren't clipped, suggestions?

Posted: April 4th, 2006, 1:12 pm
by Drofder2004
Soviet wrote:well i sort of got the elevator to work...whatever. thanks for the help on that.

i did what you said for the models, but it still doesn't work. I recompiled with those folders filled with the files in my call of duty/main folder and they still aren't clipped, suggestions?
Not 100% sure if this is necessary or not... but in my main folder. I have a folder called "xmodel" with all of the xmodels extracted from the pk3s in there (1 of the pk3s has this folder)

Other than that, I have 2 folder called collmaps and env in my textures folder.

Posted: April 4th, 2006, 1:24 pm
by Luke
Soviet wrote:well i sort of got the elevator to work...whatever. thanks for the help on that.

i did what you said for the models, but it still doesn't work. I recompiled with those folders filled with the files in my call of duty/main folder and they still aren't clipped, suggestions?
The clipped models are inside the collmaps folder, you need to open the model from there by going to file>load and point it to the textures\collmaps folder to find the model.

Posted: April 4th, 2006, 4:47 pm
by Soviet
oh ok luke, i was just putting them in using the entity screen with the key model and the value whatever it was. I'll redo them properly and see if that works. If it doesn't i'll try what you said drofder :) thanks for the help

Posted: April 4th, 2006, 5:02 pm
by Drofder2004
Nein. You do not have to open the collmaps folder :/

The way I do it...

right-click.
Misc<model
Type in...
model
xmodel/<modelname>

And then compile. And that works fine for me.

Posted: April 4th, 2006, 8:13 pm
by Soviet
well then maybe it is as long as the folder you get the model from is in main, then upon compiling the model receives clipping due to the presence of the actual model file in the main folder :?

---edit---

after extracting xmodel folder to main and recomiling, the models are still not clipped. Right now i'm too lazy to try luke's method, will work on it later

Posted: April 5th, 2006, 12:44 am
by Soviet
ah well, stupid me :P I was using the script_model entity instead of the misc_model entity. Commence in beating me with a bloody baseball bat please

Posted: April 5th, 2006, 1:38 am
by Nightmare
k


:P

Posted: April 5th, 2006, 1:45 am
by Drofder2004
Soviet wrote:ah well, stupid me :P I was using the script_model entity instead of the misc_model entity. Commence in beating me with a bloody baseball bat please
I believe script models are not solid because they can be scripted. If you want to move a solid model, then you have to use lukes method (with a slight change).

Load the collmap (file<load)
Then delete the model (not the clips).
Now get the model back using "script_model"
And make all the clip brushes as a script_brushmodel

Then move them together.

Posted: April 5th, 2006, 2:00 am
by Soviet
Drofder2004 wrote:
Soviet wrote:ah well, stupid me :P I was using the script_model entity instead of the misc_model entity. Commence in beating me with a bloody baseball bat please
I believe script models are not solid because they can be scripted. If you want to move a solid model, then you have to use lukes method (with a slight change).

Load the collmap (file<load)
Then delete the model (not the clips).
Now get the model back using "script_model"
And make all the clip brushes as a script_brushmodel

Then move them together.
thanks, ill keep that in mind if i ever want to do it. Unfortunately all i wanted was a stationary solid model

Posted: April 5th, 2006, 8:18 pm
by Soviet
ok, next comes a more complex subject: lighting. I am not sure if i am going at it the correct way. I added worldspawn entities and created my first light. The lighting does not appearing to be working on that light though...here are my light's properties

Image

if it matters the light is located in a contained area with no access to outdoor light.

and all my worldspawn settings are default for mp_depot and applied to the inner visible part of the skybox using the ctrl+shift+click method

Code: Select all

"_color" "200 200 205"
"ambient" "0.16"
"sunlight" "1"
"suncolor" "100 100 210"
"sundirection" "-45 95 0"
"sundiffusecolor" "200 200 210"
"diffusefraction" "0.6"
now, i am not absolutely complete with my map but i wished to add lighting to experiment before i continued. There are no skybox leaks that i am aware of because drofder created the skybox. The only error i am seeing upon compiling is

Code: Select all

Floatplane: bad normal
other than that i koow of nothing else that would effect my attempts of making a light.

Posted: April 5th, 2006, 10:01 pm
by Luke
The problem with the light not working is because you've put the worldspawn settings in the wrong place, they should be entered under worldspawn, which is at the bottom of the entity list.
The only values you can use on lights, to make the light bigger ect, are listed in the info box when light is selected.
"light" overrides the default 300 intensity.

Nonlinear checkbox gives inverse square falloff instead of linear

Angle adds light:surface angle calculations (only valid for "Linear" lights) (wolf)

Lights pointed at a target will be spotlights.

"radius" overrides the default 64 unit radius of a spotlight at the target point.

"exponent" changes the default 0 exponent for the angle falloff. Must be a non-negative integer. High numbers (10-20) are needed for narrow spotlight angles to show falloff over angle.

"fade" falloff/radius adjustment value. multiply the run of the slope by "fade" (1.0f default) (only valid for "Linear" lights) (wolf)

"overbrightShift" controls overbright radius. 0 is default, 1 is no overbrighting at all, fractions in between do linear interpolation.
So remove all those worldspawn settings from the light entity, and either enter the worldspawn settings manually in "worldspawn" or dl this tool which will enter them for u(outside of radiant), and u can choose from all the stock map values to use in ur map if u wanted http://www.modsonline.com/index.php?mod ... ll&id=1082