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

Members Online

»
0 Active | 34 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

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: respawning brushes?
hoodydoody
General Member
Since: Dec 26, 2010
Posts: 5
Last: Feb 7, 2011
[view latest posts]
Level 0
Category: CoDUO Mapping
Posted: Saturday, Feb. 5, 2011 05:30 pm
Hey modsonline[wave]

i already searched this forum and other sites but couldnt find anything about it....

is it possible to add destroyable brushes which respawn after some time? i wanna make something like glassattack but a little smaller and with glassplates that respawn after 20-30 seconds or somthing...

thanks in advance!


Share |
Mystic
General Member
Since: Apr 10, 2004
Posts: 6147
Last: Apr 15, 2018
[view latest posts]
Level 10
Forum Moderator
Im a fan of MODSonair
Category: CoDUO Mapping
Posted: Sunday, Feb. 6, 2011 09:58 am
Depends how your destryoing them, if your using ''hide()'' then you could use a wait timer like ''wait(10)'' then show them again with ''show()''

Share |
hoodydoody
General Member
Since: Dec 26, 2010
Posts: 5
Last: Feb 7, 2011
[view latest posts]
Level 0
Category: CoDUO Mapping
Posted: Sunday, Feb. 6, 2011 06:03 pm
well so far i only used brushmodel and a trigger for destroyable stuff
dunno if thats a bad idea but im kinda just starting with mapping^^

so this hide wait and show stuff sounds like scripting right? then i have to read through some scripting tutorials...tyvm for help [drink]
Share |
Mystic
General Member
Since: Apr 10, 2004
Posts: 6147
Last: Apr 15, 2018
[view latest posts]
Level 10
Forum Moderator
Im a fan of MODSonair
Category: CoDUO Mapping
Posted: Sunday, Feb. 6, 2011 09:19 pm
Yes, sorry forgot to say that it is indeed scripting.

Start with something very simple so you understand how it works, i'll give you a very rough guide to get you started, lots of this info can be found in much more detail if you search the forums a bit.

So first you need the wall so draw a brush in radiant, make it a script_brushmodel and give it a 'targetname' of 'wall'

Now make the broken wall, make it a script_brushmodel and give it a 'targetname' of 'wallbroken'

Finally a trigger, make it a trigger_multiple and give that a 'targetname' of 'trigger'

Thats all you need in radiant so save and compile the map.

For the script you first need to get the entities, so this will be your wall, broken wall and trigger, we do this like so
Code:

wall = getent( "wall", "targetname" ); // this is the complete wall
wallbroken = getent( "wallbroken", "targetname" ); // this is the broken wall
trigger = getent( "trigger", "targetname" ); // this is the trigger


Now you dont want the broken wall to be seen yet so you next line will be

Code:
wallbroken hide(); // hides the broken wall


So now you need to trigger the wall

Code:
trigger waittill( "trigger" ); // we wait for the trigger 


Now the trigger has been triggered you want to show the broken wall and hide the unbroken wall
Code:

wallbroken show();
wall hide();


Now its up to you but you could always use a wait function then change it back again (never tried using it before though)
Code:

wait (10); // wait 10 seconds
wallbroken hide(); // hide the broken wall
wall show();
#

So load you map, walk into the trigger (or whatever trigger you used) and see if it works, this will be very basic and look a bit odd but should get you started, good luck and any problems ask away.
Share |
hoodydoody
General Member
Since: Dec 26, 2010
Posts: 5
Last: Feb 7, 2011
[view latest posts]
Level 0
Category: CoDUO Mapping
Posted: Sunday, Feb. 6, 2011 10:53 pm
yay got it working :) first time i used a script...but it rly is just "hiding" it somehow...it acts like a caulk wall....is that my fault or is "hide" rly just hiding the texture...
Share |
Mystic
General Member
Since: Apr 10, 2004
Posts: 6147
Last: Apr 15, 2018
[view latest posts]
Level 10
Forum Moderator
Im a fan of MODSonair
Category: CoDUO Mapping
Posted: Monday, Feb. 7, 2011 12:17 am
When you turn a brush into a script_brushmodel it turns that brush into a entity. An entity doesn't have collision on it's own so you should be able to walk straight through it, im not sure why your player is colliding with it.

I have to pick my words careful here because it's hard to explain, the hide function removes the entity from view but it is still there and you can still use it again via scripts, if you used delete(); for example the entity would be removed from the game and you would be able to use it again.
Share |
TexasRebel
General Member
Since: May 1, 2006
Posts: 373
Last: Aug 20, 2013
[view latest posts]
Level 5
Category: CoDUO Mapping
Posted: Monday, Feb. 7, 2011 03:44 am
Created a small map using the script provided by Mystic. Have uploaded to the United Offensive: Tutorial Downloads Section, and should be there once approved.

Provided everything necessary to look at it in radiant, examine the code further, and a compiled working version.

Code is commented where necessary with author being Mystic as was his code used.

Solved the solid invisible wall by moving the hidden wall up 512 units, then moving back down after wait.

Code:

wall_work()
{

// collect all the wall and trigger entities

wall = getent("wall","targetname");
broken = getent("wall_broken","targetname");
trig = getent("trigger","targetname");


// precache explosion fx
// remove level.explosion and origin if not using fx

level.explosion= loadfx ("fx/explosions/exploder_brick.efx");
origin = (1536,768,0);


// hide the broken wall for start of map
broken hide();

 while(1)
 {
  trig waittill("trigger");
  

  // play explosion fx to hide the switch
  // can be taken out if you think it is not necessary

  playfx(level.explosion,origin);  


  // switch walls
  
  wall hide();
  wall movez(512,1);
  broken show();

  wait(10);
  

  // switch walls back

  wall movez(-512,1); 
  wait(1);
  broken hide();
  wall show();

 }
}
Share |
Mystic
General Member
Since: Apr 10, 2004
Posts: 6147
Last: Apr 15, 2018
[view latest posts]
Level 10
Forum Moderator
Im a fan of MODSonair
Category: CoDUO Mapping
Posted: Monday, Feb. 7, 2011 10:12 am
I just approved your download which can be found here

Credit wasn't needed as the code i posted was very basic and just to help get hoodydoody started, although i am greatful, so thank you TexasRebel.
Share |
hoodydoody
General Member
Since: Dec 26, 2010
Posts: 5
Last: Feb 7, 2011
[view latest posts]
Level 0
Category: CoDUO Mapping
Posted: Monday, Feb. 7, 2011 11:17 am
wow tyvm !!! you two rly helped me well...awesome forum :)
Share |
GomerPyle
General Member
Since: Oct 1, 2006
Posts: 357
Last: Jul 14, 2011
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoDUO Mapping
Posted: Monday, Feb. 7, 2011 02:31 pm
While this script works fine, it could use a little more work to over come a small problem. If a player happens to be in the area of the wall when it is replaced, the player gets stuck in it and when the player dies the wall disappears. Then the wall works in the following sequence of pictures.









Wish I knew something about scripting but perhaps having the script do a check to see if a player is there before replacing the wall would suffice. [confused]
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

»