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

Members Online

»
0 Active | 52 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 4
Category: CoD4 MP Mapping
CoD 4 mapping and level design for multiplayer.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: Going prone in water?
paulb39
General Member
Since: Jan 3, 2006
Posts: 492
Last: Oct 16, 2011
[view latest posts]
Level 5
Category: CoD4 MP Mapping
Posted: Tuesday, Sep. 14, 2010 11:45 pm
I'm very close to being done with a map, but I have a small problem.

I have a pond in my map, and I can go prone in the water, I don't want people to be able to do that.

I don't want them to drown either.

Is there anyway to make it so when your in water you can't go prone? Like it is in WaW.
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: CoD4 MP Mapping
Posted: Wednesday, Sep. 15, 2010 12:06 am
I think CoD4 has a function allowProne();

So you could set up a trigger in the area you want (under the water) and then grab it via a script, maybe something like;

Code:
player_noprone()
{
	pronetrig=getent("prone_trigger","targetname");
for( ;; )
{
	pronetrig waittill ("trigger", player);

	if( isPlayer( player ) && player isTouching( pronetrig ) && isAlive( player ))
	{	
		level.player allowProne(false);
}


Been a while since i done anything on cod so i havn't tested this but it should get you going.
Share |
Tristan4592
General Member
Since: Apr 26, 2007
Posts: 235
Last: Nov 11, 2010
[view latest posts]
Level 4
MODSCON
Im a fan of MODSonair
Category: CoD4 MP Mapping
Posted: Wednesday, Sep. 15, 2010 12:07 am
using this:
Code:
level.player AllowProne( false );

and a trigger, make a simple script which calls the above statement whenever the player is touching the trigger, and when they're not touching it, set it back to true so they can go prone again.

I'll make a simple test map and see if I can't get this working myself, as scripting theory is rarely the same as reality.

If I can get it to work, I'll post my full script. [biggrin]

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: CoD4 MP Mapping
Posted: Wednesday, Sep. 15, 2010 12:14 am
Actually, now i think about it that will only work for single player, you may be able to do it by setting a dvar..
Code:

#include maps\mp\_utility;


main()
{
	game["menu_client"] = "nopronecmd";

	thread playerProne();
}

playerProne()
{
	trig = getEnt( "prone", "targetname" );
	
	while(1)
	{
		trig waittill( "trigger", player );

		if( isPlayer( player ) && player isTouching( trig ) && isAlive( player ) )
		{	
			if( player GetStance() != "prone" )
			{
				player execClientCommand( "+prone" );
			}
		}
	}
}

ExecClientCommand( cmd )
{
	self setClientDvar( "nopronecmd", cmd );
	self OpenMenu( game["menu_client"] );
	self closeMenu( game["menu_client"] );
}


You will also need a new new menu called 'nopronecmd'

Code:

#include "ui/menudef.h"

{
	menuDef 
	{
		name "nopronecmd"
		rect 0 0 1 1
		visible 0
		fullscreen 0

		onOpen 
		{ 
			exec "vstr nopronecmd"; 
			close nopronecmd;
		} 
	}
}


edited on Sep. 14, 2010 08:15 pm by Rasta
Share |
paulb39
General Member
Since: Jan 3, 2006
Posts: 492
Last: Oct 16, 2011
[view latest posts]
Level 5
Category: CoD4 MP Mapping
Posted: Wednesday, Sep. 15, 2010 02:30 am
Rasta writes...
Quote:
Actually, now i think about it that will only work for single player, you may be able to do it by setting a dvar..
Code:

#include maps\mp\_utility;


main()
{
	game["menu_client"] = "nopronecmd";

	thread playerProne();
}

playerProne()
{
	trig = getEnt( "prone", "targetname" );
	
	while(1)
	{
		trig waittill( "trigger", player );

		if( isPlayer( player ) && player isTouching( trig ) && isAlive( player ) )
		{	
			if( player GetStance() != "prone" )
			{
				player execClientCommand( "+prone" );
			}
		}
	}
}

ExecClientCommand( cmd )
{
	self setClientDvar( "nopronecmd", cmd );
	self OpenMenu( game["menu_client"] );
	self closeMenu( game["menu_client"] );
}


You will also need a new new menu called 'nopronecmd'

Code:

#include "ui/menudef.h"

{
	menuDef 
	{
		name "nopronecmd"
		rect 0 0 1 1
		visible 0
		fullscreen 0

		onOpen 
		{ 
			exec "vstr nopronecmd"; 
			close nopronecmd;
		} 
	}
}


edited on Sep. 14, 2010 08:15 pm by Rasta


Thanks, tho could you walk me through it? I'm horrible with scripts. I'm guessing the first bit of code goes in its own gsc, tho how do I call it from the main gsc? I make the trigger targetname prone, right? I have no idea how to make a new menu (where does it go? And what extension does it have .menu?), and how do I call the script in the zone file?
Share |
paulb39
General Member
Since: Jan 3, 2006
Posts: 492
Last: Oct 16, 2011
[view latest posts]
Level 5
Category: CoD4 MP Mapping
Posted: Friday, Sep. 17, 2010 12:05 am
Script compile error


http://i22.photobucket.com/albums/b329/paulb39/shot00000.jpg

Zone File

include,mptypes_desert
include,mptypes_woodland
rawfile,maps/mp/_noprone.gsc
xmodel,com_barrel_piece
xmodel,com_barrel_piece2
fx,props/barrel_ignite
fx,props/barrel_fire_top
rawfile,ui/nopronecmd.menu

Any ideas?
Share |
paulb39
General Member
Since: Jan 3, 2006
Posts: 492
Last: Oct 16, 2011
[view latest posts]
Level 5
Category: CoD4 MP Mapping
Posted: Friday, Sep. 17, 2010 01:03 am
Fixed it
rawfile,ui/nopronecmd.menu was incorrect

so now map loads, but I can still go prone.... any ideas?
I made a trigger multiple with targetname prone
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: CoD4 MP Mapping
Posted: Friday, Sep. 17, 2010 10:46 am
I must have been half asleep when i posted that because it is checking if the player is in the prone position and if not is then sending the command to make him/her prone. The opposite of what you need.

Try changing;
if( player GetStance() != "prone" )
to
if( player GetStance() = "prone" )

and

player execClientCommand( "+prone" );
to
player execClientCommand( "+stand" );
Share |
paulb39
General Member
Since: Jan 3, 2006
Posts: 492
Last: Oct 16, 2011
[view latest posts]
Level 5
Category: CoD4 MP Mapping
Posted: Friday, Sep. 17, 2010 08:45 pm
Mystic writes...
Quote:
I must have been half asleep when i posted that because it is checking if the player is in the prone position and if not is then sending the command to make him/her prone. The opposite of what you need.

Try changing;
if( player GetStance() != "prone" )
to
if( player GetStance() = "prone" )

and

player execClientCommand( "+prone" );
to
player execClientCommand( "+stand" );


Script compile error :(


http://i22.photobucket.com/albums/b329/paulb39/shot0096.jpg
Share |
_INSANE_
General Member
Since: Nov 7, 2008
Posts: 352
Last: Jul 10, 2011
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD4 MP Mapping
Posted: Friday, Sep. 17, 2010 10:43 pm
if( player GetStance() == "prone" )

use two = symbols
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 MP 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

»