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

Members Online

»
0 Active | 73 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: Flyover with a twist
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: Friday, May. 29, 2009 01:19 am
I'm trying to use a variation of the flyovers in my map where the plane type is changed randomly. However, each flyover has a mix of planes, kind of looks cool but not what I was looking for. This is the way I'm trying to pick the plane type. What am I doing wrong?[ohwell]

planetype = 1 + randomInt(3);
switch(planetype)
{
case 1:
plane =("xmodel/v_ge_air_me-109");
break;

case 2:
plane =("xmodel/vehicle_german_condor");
break;

case 3:
plane =("xmodel/vehicle_plane_stuka");
break;
break;
}

Here is what I'm getting.
Share |
hansgrubber
General Member
Since: Aug 7, 2004
Posts: 196
Last: Jul 6, 2009
[view latest posts]
Level 4
Category: CoDUO Mapping
Posted: Friday, May. 29, 2009 01:54 am
Im not best on scripting, been awhile but I think for starters logic wrong. this I think should be @ bottom... switch(planetype) after you randomly pick the plane... and this starts at 0 if i remmeber right planetype = 1 + randomInt(3); so it s a array of 0,1,2,3. thats 4 slots in that array hence 4 numbers plus 1. but like I said been awhile lol


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: Friday, May. 29, 2009 11:46 am
All the scripting I've been able to find using switch has it at the start. You're right about the array but changing it to:

planetype = 0 + randomInt(2);
switch(planetype)
{
case 0:
plane =("xmodel/v_ge_air_me-109");
break;

case 1:
plane =("xmodel/vehicle_german_condor");
break;

case 2:
plane =("xmodel/vehicle_plane_stuka");
break;
break;
}

gives the same results.[confused]
Share |
hansgrubber
General Member
Since: Aug 7, 2004
Posts: 196
Last: Jul 6, 2009
[view latest posts]
Level 4
Category: CoDUO Mapping
Posted: Friday, May. 29, 2009 04:07 pm
It looks like it s selecting everything so there someting wrong with case, but I think u still want 1 + instead of zero. been too long, now a days it's trial and error.and I still think you want to set the plane after you randomly chose it.
Share |
DemonSeed
General Member
Since: Apr 30, 2009
Posts: 1362
Last: Feb 19, 2018
[view latest posts]
Level 8
Im a fan of MODSonair
Category: CoDUO Mapping
Posted: Friday, May. 29, 2009 04:46 pm
This would suit you better:

Code:
getPlaneType()
{

	planetype = [];

	planetype[0] =("xmodel/v_ge_air_me-109");
	planetype[1] =("xmodel/vehicle_german_condor");
	planetype[2] =("xmodel/vehicle_plane_stuka");
	
	plane = planetype[ randomInt( planetype.size ) ];
	
	return plane;
}
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: Saturday, May. 30, 2009 01:19 am
That looks like it would work except I didn't put up all the info in the case when I asked the question.[duh] I also need to have a start position and play the sound files that goes with the plane so it would look something like this:

case 0:
plane = ("xmodel/v_ge_air_me-109", "plane", startpos, ( xx, xx, xx) );
plane playloopsound("planesnd109");
break;
sorry, my bad.
Share |
.KiLL3R.
General Member
Since: Oct 26, 2006
Posts: 1437
Last: Jul 3, 2017
[view latest posts]
Level 8
Category: CoDUO Mapping
Posted: Saturday, May. 30, 2009 03:36 am
Something like this?

Code:

main()
{
	level.planetype[0] = spawnStruct();
	level.planetype[0].origin = (452352,65,2511);
	level.planetype[0].model = "xmodel/v_ge_air_me-109";
	level.planetype[0].snd = "planesnd109";

	level.planetype[1] = spawnStruct();
	level.planetype[1].origin = (42,547,2971);
	level.planetype[1].model = "xmodel/vehicle_german_condor";
	level.planetype[1].snd = "planesndcondor";

	level.planetype[2] = spawnStruct();
	level.planetype[2].origin = (42,525,2511);
	level.planetype[2].model = "xmodel/vehicle_plane_stuka";
	level.planetype[2].snd = "planesndstuka";

	thread blah();
}

blah()
{
	num = randomInt(level.planetype.size);

	plane = spawn("script_model",level.planetype[num].origin);
	plane setModel(level.planetype[num].model);
	plane playLoopSound(level.planetype[num].snd);
}
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: Saturday, May. 30, 2009 11:01 pm
Hey thanks KiLL3R, I'll have to change a bunch of script to use yours but I'll give it a try. For the time being though, I'm going to keep trying the case, must be some way of getting it to work right.[crazy]
Share |
.KiLL3R.
General Member
Since: Oct 26, 2006
Posts: 1437
Last: Jul 3, 2017
[view latest posts]
Level 8
Category: CoDUO Mapping
Posted: Saturday, May. 30, 2009 11:09 pm
:P

Code:

main()
{
	switch(randomInt(3))
	{
		case 0:
			plane = spawn("script_model",(452352,65,2511));
			plane setModel("xmodel/v_ge_air_me-109");
			plane playLoopSound("planesnd109");
			break;

		case 1:
			plane = spawn("script_model",(42,547,2971));
			plane setModel("xmodel/vehicle_german_condor");
			plane playLoopSound("planesndcondor");
			break;

		case 2:
			plane = spawn("script_model",(42,525,2511));
			plane setModel("xmodel/vehicle_plane_stuka");
			plane playLoopSound("planesndstuka");
			break;
	}
}

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: Sunday, May. 31, 2009 12:53 am
Yeah, thanks again KiLL3R but I've tried that one. Makes a good picture though.



Strange that it doesn't work, it has to be something simple DOESN"T IT???lol[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

»