Opferlamm-Clan Board
www.opferlamm-clan.de
Verantwortlich für diese bösen Machenschaften: siehe Impressum

Registrierung Kalender Mitgliederliste Suche Häufig gestellte Fragen Zur Startseite

Opferlamm-Clan Board » Call of Duty 2 » Call of Duty 2 - Mapping » CoD2-Mapping-Hilfe » zebrehliches Glas/Fenster ohne script? » Hallo Gast [Anmelden|Registrieren]
Letzter Beitrag | Erster ungelesener Beitrag Druckvorschau | An Freund senden | Thema zu Favoriten hinzufügen
Neues Thema erstellen Antwort erstellen
Zum Ende der Seite springen zebrehliches Glas/Fenster ohne script?
Autor
Beitrag « Vorheriges Thema | Nächstes Thema »
Necromonga
Teetrinker


Dabei seit: 12.06.2006
Beiträge: 30


zebrehliches Glas/Fenster ohne script? Auf diesen Beitrag antworten Zitatantwort auf diesen Beitrag erstellen Diesen Beitrag editieren/löschen Diesen Beitrag einem Moderator melden       Zum Anfang der Seite springen

Orginal von Modsonline.com

Schaut mal wie simpel es bei COD war ohne mühsames scripten tolle Effekte zu machen.

Breakable Windows With No Scripting
Sat. May. 8, 2004
How to make breakable windows in your map without scripting

Tutorial by t-bag

1. Start by making the broken window first:
-make the broken window out of brushes. This will be how you want it to look after it is shot out.
-select all of them. With them highlighted right click and from the drop down menu select script and then brushmodel.
-Once that is done hit n to bring up the entities window.
-enter a key: script_exploder and value: 10.
(The value that you choose can be any number except 1 or 2, because you usually assign 1 or 2 to your S&D objectives.)
-Enter a key: targetname and a value: exploder
2. Now make the unbroken window:
-make the unbroken window out of brushes. This will be how you want it to look before it is shot out.
-select the unbroken window brush. With it highlighted right click and from the drop down menu select script and then brushmodel.
-Once that is done hit n to bring up the entities window.
-enter a key: script_exploder and value: 10.
(you enter the same value as you did for the broken window.)
3. Now make the damage trigger:
-make a brush with the common/trigger texture. The brush should cover the window and overlap a bit so that when something hits the trigger brush it will tell the game engine to break the window.
-select the trigger brush. With it highlighted right click. From the dropdown menu select trigger and then damage.
-Once that is done hit n to bring up the entities window.
-enter a key: script_exploder and value: 10.

There are a bunch of little boxes you can check. For instance if you check no_pistol it will tell the game engine that the window can't be broken by pistol.

You can stop there if you want to. It will work as is right now. It just won't have any breaking glass effects.

4. To add breakable glass effects just right click near the breakable window.
-from the dropdown menu select script and then model.
-a window will pop up in the background for you to choose the model. Select fx. Now bring up the entities window if it isn't already up. For the model key, just make sure that the value says only xmodel/fx
-enter a key: script_exploder and value: 10.
-enter a key: script_fxid and a value glassbreak
(the value can be whatever alias you choose to assign, you will just have to make sure that you list that alias in your fx.gsc file.)

5. now you have to make an origin for the effect.
- Right click somewhere near the effect. From the menu select script and then origin.
-deselect the origin model.
-now select the fx model, then select the origin. (the order is important)
-press control k to connect them.
-you can drag the origin around to change the angle that the effect goes off to.

6. (optional) add a trigger to tell the player that the window can be broken.
-make a brush in the trigger texture and place it where you want the player to be alerted.
-right click and select trigger and then use.
-hit n to bring up entities and enter a key:hintstring and a value: Whatever message you want it to display.

Alternatively you can use another effect (like whistling wind or whatever) to tell the player that something is different about that particular window.

7. If you used and effect you need to make a yourmapname_fx.gsc file that you will put in the pk3 under the maps/mp folder along with your bsp file. Here is a sample:

main()
{
precacheFauch böse );
}

precacheFauch böse )
{

level._effect["glassbreak"] = loadfx ("fx/impacts/glass_shatter.efx");

}

8. Add a line to your gsc file to tell it to load the fx file:

maps\mp\yourmapname_fx::main();

And that should do it!
You can modify this tutorial to make breakable boxes (with weapons or health inside or that cover up tunnel entrances) , walls that fall down if they a grenade goes off by it, sewer grates that have to be blown up with grenades, anything you can think of. You would just change the effect to an appropriate effect for what you are trying to do. Hope this is helpful. You can see a demonstration of breakble windows, grates and objects in my new map Arkov.
Thanks to t-bag for this tutorial.


Und nun das ganze für COD2, oder zumindest ein Versuch.


http://www.modsonline.com/Forums-top-22323.html

Da vergeht doch einem die Lust am mappen wenn man sowas sieht. Und durch das ganze script englisch steigt man auch nicht so ganz durch.

Cod war so einfach und simpel aufgebaut.Aber warum einfach machen wenn es auch kompliziert geht.Typisch COD2.
Hätte Cod annähernd so ne gute Grafik wie Cod2, würde ich nur in Cod/ codUO mappen.

Steigt jemand von euch da durch? @scripte
Necromonga ist offline E-Mail an Necromonga senden Homepage von Necromonga Beiträge von Necromonga suchen Nehmen Sie Necromonga in Ihre Freundesliste auf
Necromonga
Teetrinker


Dabei seit: 12.06.2006
Beiträge: 30


Auf diesen Beitrag antworten Zitatantwort auf diesen Beitrag erstellen Diesen Beitrag editieren/löschen Diesen Beitrag einem Moderator melden       Zum Anfang der Seite springen

//Tutorial für zebrechliches Glas "kann das mal jemand übersetzten?"

// The triggers must have an origin brush in the center. Select both brushes and then turn them into a trigger_damage.
// Retexture the origin brush.
// The triggers are all named "window" and are slightly thicker then the windows they are for.
// Create two script_brushmodels. One for the unbroken window, and one for the broken window.
// Both windows must also have center origin brushes.
// Each trigger must target an unbroken window.
// Each unbroken window must target a broken window.
// Place all three entities in the same spot.
// The three entities can be cloned, but make sure all the parts are selected.

//Scripting

// In your main script add this line, " maps\mp\_breakwindow::window_think(); " -- just above the "_load::main()" line.
// Also, place this line at the very top, " #include maps\mp\_utility; ".
// for sound you must add the following lines to your map's main/soundaliases/mapname.csv file.
// window_break,1,glass/glass05.wav,0.8,1,na,0.9,1.05,120,800,,streamed,,,,all
_mp
// window_break,2,glass/glass08.wav,0.8,1,na,0.9,1.05,120,800,,streamed,,,,all
_mp

window_think()
{
windows = getentarray("window","targetname"); //find everything with targetname "window"
if(isdefined(windows)) //if there were window triggers found
{
windowfx = loadfx ("fx/glass/glass_break4.efx"); //define the glass effect
for(i=0;i<windows.size;i++) //start threads listening for all window triggers
{
windows[i] thread window(windowfx);
}
}
//end breaking windows main
}

window(windowfx) //This determines where, when, and how to play the glass breaking effect
{
if(!isdefined(self.target)) //see if window trigger still exists
{
iprintln("no target key found for window trigger at ", self getorigin());
return;
}

window = getent(self.target,"targetname"); //get the targetname (id) for the unbroken window

if(!isdefined(window)) //see if trigger has target (the unbroken window)
{
iprintln("window not found for window trigger at ", self getorigin());
return;
}

if(!isdefined(window.origin)) //check for origin key on window
{
iprintln("origin key not found for window at ", self getorigin());
return;
}

self enableGrenadeTouchDamage(); //grenade impact will break window
window disableGrenadeBounce(); //so you can throw grenades through
window notsolid(); //allow player & bullets to move through broken window.


brokenwindow = getent(window.target,"targetname"); //get the targetname for broken window

org = spawn("script_origin",window.origin); //copy of origin of this trigger
sampledist = 1; //accuracy in determiniting size of window
spacing = 24; //distance between each small breaking glass effect

while(org istouching(window)) //determines end of trigger along x axis to nearest 1 unit, windows that are not aligned with an axis will not work because of this.
{
org.origin += (sampledist,0,0);
}
xendorg = org.origin; //record largest whole x value
xdist = org.origin[0]-window.origin[0]; //record size along x axis
org.origin = window.origin;

while(org istouching(window)) //determines end of trigger along y axis to nearest 1 unit
{
org.origin += (0,sampledist,0);
}
yendorg = org.origin; //record largest whole y value
ydist = org.origin[1]-window.origin[1]; //record size along y axis
org.origin = window.origin;

while(org istouching(window)) //determines end of trigger along z axis to nearest 1 unit
{
org.origin += (0,0,sampledist);
}
zendorg = org.origin; //record largest whole z value
zdist = org.origin[2]-window.origin[2]; //record size along z axis

point = []; //will hold all of the points to start glass effects

if(ydist>xdist) //window is aligned along the x axis, windows running along z axis will not work because of this.
{
direction = vectornormalize(xendorg-window.origin); //creates a vector perpendicular to the window for the width of the effect.
//Note that the width of the trigger will affect how far glass flies.
ycount = (int(ydist)/spacing); //determines how many effects along y axis (rounds down)
if(!(ycount))
ycount = 1; //must have at least 1
zcount = (int(zdist)/spacing); //determines how many effects along z axis (rounds down)
if(!(zcount))
zcount = 1; //must have at least 1
ystart = window.origin[1]+((ydist - (ycount*spacing))/2); //Since the effect has a pretetermined size, make the amount of error equal on both sides.
zstart = window.origin[2]+((zdist - (zcount*spacing))/2); //Since the effect has a pretetermined size, make the amount of error equal on both sides.
//Determine where center points are for glass effect.
for(x=0;x<ycount;x++)
{
for(y=0;y<zcount;y++)
{
point[x][y] = (window.origin[0], ystart+(spacing*x), zstart+(spacing*y));
}
}

}
else //window is aligned along the x axis
{
direction = vectornormalize(yendorg-window.origin); //creates a vector perpendicular to the window for the width of the effect.
xcount = (int(xdist)/spacing); //determines how many effects along x axis (rounds down)
if(!(xcount))
xcount = 1; //must have at least 1
zcount = (int(zdist)/spacing); //determines how many effects along z axis (rounds down)
if(!(zcount))
zcount = 1; //must have at least 1
xstart = window.origin[0]+((xdist - (xcount*spacing))/2); //Since the effect has a pretetermined size, make the amount of error equal on both sides.
zstart = window.origin[2]+((zdist - (zcount*spacing))/2); //Since the effect has a pretetermined size, make the amount of error equal on both sides.
//Determine where center points are for glass effect.
for(x=0;x<xcount;x++)
{
for(y=0;y<zcount;y++)
{
point[x][y] = (xstart+(spacing*x), window.origin[1], zstart+(spacing*y));
}

}
}
org delete(); //free memory
window show(); //show unbroken window
if(isdefined(brokenwindow)) //Broken window brush isn't necessary
{
brokenwindow hide(); //make broken window disappear.
brokenwindow notsolid(); //allow player to move through broken window.

}
breaktype = self breakwait(); //Function is defined below. There it waits for window break event.
if(isdefined(brokenwindow))
{
brokenwindow show(); //show broken window
if(isdefined(brokenwindow.target))
{
clipper = getent(brokenwindow.target,"targetname"); //get the targetname (id) for the player clip
if (isdefined(clipper.script_noteworthy))
{
if (clipper.script_noteworthy != "block")
clipper notsolid();
}
else clipper notsolid();
}
}
window hide(); //hide unbroken window
if(breaktype != "smallbreak") //bigbreak
{
direction = vectormultiply(direction,5); //enhance the distance particles fly
}

//Use the info gathered earlier to play the effects
for(i=0;i<point.size;i++)
{
for(j=0;j<point[i].size;j++)
{
//iprintln("point = " + point[i][j]);
//iprintln("window origin = " + window.origin);
playfx(windowfx,point[i][j],direction); //this is the money shot
self playsound ("window_break");
}
}
wait 2; //allow effects to finish playing out before thread ends
window delete(); //remove unbroken window
self delete(); //remove trigger
}

//Determine big or small break, affecting how far glass flies
breakwait()
{
level.windamage_min = 199;
level.max_hits = 3;
no_of_hits = 0;

while(1) //Thread hangs here waiting for sufficient damage on the trigger
{
self waittill ("damage",amount);
self playsound ("window_break");
iprintlnbold("Window damage = ", amount); // <--- Add this line for debug.
if(amount > level.windamage_min)
{
return ("bigbreak");
}
no_of_hits += 1; //window accumulates damage
iprintlnbold("Hits so far = ", no_of_hits); // <--- Add this line for debug.
if(no_of_hits > level.max_hits) //The trigger has been set off
break;

}
return ("smallbreak");
}

vectormultiply (vec, dif) //used to enhance the direction vector so glass flies farther
{
vec = (vec[0] * dif, vec[1] * dif, vec[2] * dif);
return vec;
}

// end

//problems:
//Unbroken windows do no allow bullets to pass through.
//Can't make them notsolid() because they need to block players.
//Make unbroken windows show bullethole
Necromonga ist offline E-Mail an Necromonga senden Homepage von Necromonga Beiträge von Necromonga suchen Nehmen Sie Necromonga in Ihre Freundesliste auf
Private Grob
Mapper vom Dienst


images/avatars/avatar-594.jpg


Dabei seit: 25.04.2006
Beiträge: 475


Auf diesen Beitrag antworten Zitatantwort auf diesen Beitrag erstellen Diesen Beitrag editieren/löschen Diesen Beitrag einem Moderator melden       Zum Anfang der Seite springen

Sooo ein Script um Fenster zu zerbrechen??? Nein danke, das tue ich mir im Leben nicht an geschockt

Jaja, CoD1 und UO war schon relativ gesehen einfacher. Schon alleine mit dem Custom Texturen bzw. Ladebildschirm. Was war das schön einfach und jetzt? Voll der Krampf mit dem Assault Manager um dann zwei(!) Dateien für ein Bild zu bekommen....

Schwachsinn Teufel

Grüße
Private Grob
(Micka)
Private Grob ist offline E-Mail an Private Grob senden Beiträge von Private Grob suchen Nehmen Sie Private Grob in Ihre Freundesliste auf
Baumstruktur | Brettstruktur
Gehe zu:
Neues Thema erstellen Antwort erstellen
Opferlamm-Clan Board » Call of Duty 2 » Call of Duty 2 - Mapping » CoD2-Mapping-Hilfe » zebrehliches Glas/Fenster ohne script?

Impressum ||Datenschutzerklärung

Forensoftware: Wbb - WoltLab GmbH || zum Archiv