Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 17 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty
Category: CoDUO Mapping
CoD United Offensive mapping and level design.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: HowTo: Rotate Effects (Example Lighthouse)
Sgt_Skywalker
General Member
Since: Mar 27, 2004
Posts: 35
Last: Dec 16, 2005
[view latest posts]
Level 2
Category: CoDUO Mapping
Posted: Tuesday, Feb. 15, 2005 01:53 pm
Hi admins,
feel free to bring this kinda tutorial to your tutorial section if you like it. Sorry if you find errors or if my explanations sound strange. I'm not a native english speaker. [devilishgrin]

Okay, we'll start...
Searching alot for some neat effects like dynamic lights is very frustrating if you map for CoD. The reason for this is: CoD does not support almost any dynamic effect as you know it from Quake 3. Many techniques for implementing effects look quite different. Unfortunately neither Infinity Ward nor Gray Matter present some detail documentation for the use of shaders, effects or any "CoD-specialities". Maybe one day we will get some more info from them *hint-hint* :casanova:
Therefor all the informations in this tutorial were found out by studying the pk3 files that came with the game.

Make a lighthouse:
First we open our map in Graydiant and create a script_model in our world. I use the original xmodel from the SP-map Sicily1. Its called "xmodel/o_br_prp_lhouse_lamp".
You could also create a script_brushmodel. The most important is next to open your entity editor (key "N") while your new script_model / script_brushmodel is still selected.
Add a key "targetname" and give it the value lighthouse_light. This targetname will reappear later in your script file. That's it for Radiant. Save your map and compile it.

For convenience reasons I always create a startup script (e.g. c:call of dutyuomapsmpmymap.gsc) with the following content:
Code:
 // Made by Sgt. Skywalker
// Copyright 2005
main() {
ambientPlay("ambient_mp_harbor");

game["allies"] = "american";
game["axis"] = "german";
game["attackers"] = "axis";
game["defenders"] = "allies";

game["american_soldiertype"] = "airborne";
game["american_soldiervariation"] = "normal";
game["german_soldiertype"] = "german_waffen";
game["german_soldiervariation"] = "normal";

mapsmp_load::main();
mapsmpmymap_fx::main(); //kick off fx script here


So I have a second script (e.g. c:call of dutyuomapsmpmymap_fx.gsc) where all the interesting stuff happens:
Code:

// Made by Sgt. Skywalker
// Copyright 2005
main()
{
level._effect["light_beam"] = loadfx ("fx/map_sicily1/v_light_lighthouse.efx");
// which effect will we use
wait(2); // wait 2 seconds to get some cpu threads
level thread lighthouse_light(); // call thread "lighthouse_light"
}

lighthouse_light() // the fx thread
{
lighthouse_lights = getentarray("lighthouse_light","targetname");
// create an array of all script_models and script_brushmodels
// which targetname is lighthouse_light
for ( i = 0; i < lighthouse_lights.size; i++ ) // loop the whole time
{
playfxontag( level._effect["light_beam"], lighthouse_lights, "tag_light" ); // play fx
lighthouse_lights thread lighthouse_move(); // call thread lighthouse_light_move
wait(0.2); // wait 0,2 seconds or it will look silly if 10 lighthouses rotate identically
}
}

lighthouse_light_move() // move the fx
{
while(1) // yet another loop
{
self rotateto((0,45,0),4,1,1); // rotate within 4 seconds by 45 degrees on y-axis
self waittill("rotatedone"); // wait until the rotation is done
self rotateto((0,-45,0),4,1,1); // Play it again, Sam
self waittill("rotatedone"); // yet another waiting time
}
}



Syntax of self rotateto((x,y,z),a,b,c):
x = rotate around x-axis
y = rotate around y-axis
z = rotate around z-axis
a = time in secs how long rotation will take
b = time in secs for accelleration
c = time in secs for decelleration

I hope you like it.
sincerely Sgt. Skywalker

Ingame it will look like this:
Share |
O-NM-Elmo
General Member
Since: May 20, 2004
Posts: 57
Last: Jul 22, 2005
[view latest posts]
Level 3
Category: CoDUO Mapping
Posted: Tuesday, Feb. 15, 2005 08:32 pm
Holy crap dude, this is just fantastic.
Certainly going to give you credit for this.I started my current map with a lighthouse similar to the one in the SP mission.
And from the beginning I wanted it to be functional, however I was sure I couldn't make this one work.
And now U made this tut in just about the right time.
Btw this works in MP right?
Tnx alot
Share |
Sgt_Skywalker
General Member
Since: Mar 27, 2004
Posts: 35
Last: Dec 16, 2005
[view latest posts]
Level 2
Category: CoDUO Mapping
Posted: Tuesday, Feb. 15, 2005 08:42 pm
hi elmo,

great that this information came just in time for you
and you are right, I forgot to mention this in my post: yes, this works for multiplayer!
another point to tell you all: there is at least one error in the first script. after the line "maps\mp\mymap_fx::main(); //kick off fx script here" you need to place antoher bracket "}" for closing the main thread again.

sorry again

cheers
Sgt. Skywalker
Share |
O-NM-Elmo
General Member
Since: May 20, 2004
Posts: 57
Last: Jul 22, 2005
[view latest posts]
Level 3
Category: CoDUO Mapping
Posted: Wednesday, Feb. 16, 2005 08:45 am
I tried the lighthouse stuff out, but in-game I get a script compiler error
The console say's that this line is an unknown function:

lighthouse_lights thread lighthouse_move(); // call thread lighthouse_light_move
Share |
Hercules
General Member
Since: Jan 23, 2005
Posts: 775
Last: Apr 26, 2011
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoDUO Mapping
Posted: Wednesday, Feb. 16, 2005 09:27 am
yes i also get a bad script error i go back to my gsc file see what problem is from the details the console gives me and it said bad syntax all my other FX work fine apart from this [eek] could someone fix this problem

[angryalien]
Share |
Sgt_Skywalker
General Member
Since: Mar 27, 2004
Posts: 35
Last: Dec 16, 2005
[view latest posts]
Level 2
Category: CoDUO Mapping
Posted: Wednesday, Feb. 16, 2005 05:05 pm
sorry sorry sorry guys...

it seems pasting into the thread produced some strange errors..
first you have to place it to your uomapsmp directory. it will not work in CoD-"Classic".

so please try this for your mymap_fx.gsc:

main()
{
level._effect["light_beam"] = loadfx ("fx/map_sicily1/v_light_lighthouse.efx");
wait(2);
level thread lighthouse_light();
}

lighthouse_light()
{
lighthouse_lights = getentarray("lighthouse_light","targetname");
for ( i = 0; i < lighthouse_lights.size; i++ )
{
playfxontag( level._effect["light_beam"], lighthouse_lights, "tag_light" );
lighthouse_lights thread lighthouse_light_move();
wait(0.2);
}
}

lighthouse_light_move()
{
while(1)
{
self rotateto((0,45,0),4,1,1);
self waittill("rotatedone");
self rotateto((0,-45,0),4,1,1);
self waittill("rotatedone");
}
}

i hope this works fine for you

me culpa.... [puke]

cheers Sg.t Skywalker
Share |
O-NM-Elmo
General Member
Since: May 20, 2004
Posts: 57
Last: Jul 22, 2005
[view latest posts]
Level 3
Category: CoDUO Mapping
Posted: Wednesday, Feb. 16, 2005 06:13 pm
Aiight, I will try it out.

*Edit*

It's working.
Thanks for helmping me out.
Share |
StrYdeR
General Member
Since: May 11, 2004
Posts: 11671
Last: Oct 7, 2021
[view latest posts]
Level 10
Admin
Forum Moderator
Im a HOST of MODSonair
Category: CoDUO Mapping
Posted: Thursday, Feb. 17, 2005 01:01 am
nice one skywalker...can we add it to the tuts section? [angryalien]
Share |
O-NM-Elmo
General Member
Since: May 20, 2004
Posts: 57
Last: Jul 22, 2005
[view latest posts]
Level 3
Category: CoDUO Mapping
Posted: Thursday, Feb. 17, 2005 09:01 am
That would be very wise, this is an awesome tut.
Share |
Sgt_Skywalker
General Member
Since: Mar 27, 2004
Posts: 35
Last: Dec 16, 2005
[view latest posts]
Level 2
Category: CoDUO Mapping
Posted: Thursday, Feb. 17, 2005 04:49 pm
stryder,

i'd love to see my tu in your gorgeous tut's section [casanova]
thanks alot.

cheers
Sgt. Skywalker
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty : CoDUO Mapping

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»