Author Topic: x4 3.0 idea for ac130 and heli  (Read 1995 times)

Offline bhcmax

  • Rank: Private
  • *
  • Posts: 150
    • http://www.bhc-rangers.com
x4 3.0 idea for ac130 and heli
« on: June 02, 2010, 11:13:36 am »
First  the ac130

any way of making the ac130 show on hud ,? and if it can show as belonging to allie or enemy ,? ie red or green , much like heli on hud

2nd idea
Heli
tie in the superb gunner view you get with ac130 on the heli , ive seen it done on another mod , cant remember which..
so when you get heli,
your basicly aiming down on map like in ac130

now that would be very cool

Offline 4peterjan4

  • Rank: Private
  • *
  • Posts: 505
    • http://www.specialforces-clan.com
Re: x4 3.0 idea for ac130 and heli
« Reply #1 on: June 02, 2010, 12:30:09 pm »
Hey Max,

If u mean this with an Hud Icon i have already added something like that..


Offline bhcmax

  • Rank: Private
  • *
  • Posts: 150
    • http://www.bhc-rangers.com
Re: x4 3.0 idea for ac130 and heli
« Reply #2 on: June 02, 2010, 02:33:23 pm »
Nice  what youve done m8 ,
with the plane icon
but i mean more like the radar map,  showing th ac130 as either friend or foe and where it is in the sky, simillar to the way it shows heli flyover and airstrikes

Offline 4peterjan4

  • Rank: Private
  • *
  • Posts: 505
    • http://www.specialforces-clan.com
Re: x4 3.0 idea for ac130 and heli
« Reply #3 on: June 02, 2010, 02:41:13 pm »
Quote from: "bhcmax";p="33808"
Nice  what youve done m8 ,
with the plane icon
but i mean more like the radar map,  showing th ac130 as either friend or foe and where it is in the sky, simillar to the way it shows heli flyover and airstrikes

Ah okay,

I will look into that soon..

Greetings PhoeniX

Offline 4peterjan4

  • Rank: Private
  • *
  • Posts: 505
    • http://www.specialforces-clan.com
Re: x4 3.0 idea for ac130 and heli
« Reply #4 on: July 03, 2010, 01:01:45 pm »
Hm i tried to find the file where the icons are controlled.. But couldn't find it..

Anyone else could help us out?

I am also interested in the ac130 showing up on the radar/hud :)

Greetings Phoenix

Offline Sammy

  • Rank: Private
  • *
  • Posts: 105
Re: x4 3.0 idea for ac130 and heli
« Reply #5 on: July 03, 2010, 03:18:32 pm »
Unless there is a better way I think it has to be created as an objective/gameobject and setting it to follow a specific entity, such as how a bomb icon is created for S&D and linked to a player. However, since the ac130 model is already linked it might refer to that instead and will have to be set using the position function on each frame. The S&D gametype script for waypoints and the bomb has example functions.

Offline 4peterjan4

  • Rank: Private
  • *
  • Posts: 505
    • http://www.specialforces-clan.com
Re: x4 3.0 idea for ac130 and heli
« Reply #6 on: July 04, 2010, 03:19:58 am »
Hey Sammy,

Yeah i know that one  :)

Its an good example but i am a nooby at how to do this things  :P

Offline Sammy

  • Rank: Private
  • *
  • Posts: 105
Re: x4 3.0 idea for ac130 and heli
« Reply #7 on: July 04, 2010, 02:12:23 pm »
In the script reference under the objective section are some functions.  I havent tried it but maybe something like this in the ac130 script after the model is created.  The 9999 is a temp number and doesnt check to see whether or not that objective already exists. When the round is over you will need to add the objective_delete function to the rest of the cleanup section. I will try it out later when I have some time but if it works let me know.   :D

ac130objNumber = 9999;
Objective_Add( ac130objNumber, "active");
Objective_Team( ac130objNumber, "allies" );
Objective_Icon( ac130objNumber, your2diconshader);
Objective_OnEntity( ac130objNumber, level.ac130model );

[EDIT] 9999 does not work. Only 0-15. So I assume that 16 is the max and will cause a problem if there are too many. Dunno if the heli and planes count towards that total. The createobjective code has functions to look for free slots based on that method of creating objectives instead of doing it manually and in the end maybe its better to just use those to avoid having to reinvent the wheel.

Offline 4peterjan4

  • Rank: Private
  • *
  • Posts: 505
    • http://www.specialforces-clan.com
Re: x4 3.0 idea for ac130 and heli
« Reply #8 on: July 04, 2010, 02:30:17 pm »
Thanks for the reply Sammy  :) ,

I am sorry to say but i don't know where to add it..

I can try it but i think it will give to many errors haha..

When you got time i hope you will take a look at this to  :)

Greetings PhoeniX

Offline Sammy

  • Rank: Private
  • *
  • Posts: 105
Re: x4 3.0 idea for ac130 and heli
« Reply #9 on: July 04, 2010, 03:45:27 pm »
Ok this hack creates a compass icon for a uav flying around. When the radar is off the icon is on the top bar otherwise it is located around the map normally. I figure it could be shown/hidden when the ac130 is activated by using objective_state. The icon has to be destroyed in the ac130 cleanup section.

Precache the compass icon in init. You might have to add the mtl to mod.csv for gametypes other than S&D.
   precacheShader( "compass_waypoint_capture" );

After the lines creating the script model
   objective = 15; //temp only and might cause conflicts
   Objective_Add( objective, "active");
   Objective_Icon( objective, "compass_waypoint_capture" );
   Objective_OnEntity( objective, level.ac130 );

However to keep things organized the S&D method would probably be better. Just instead of a bomb its a plane.

Offline 4peterjan4

  • Rank: Private
  • *
  • Posts: 505
    • http://www.specialforces-clan.com
Re: x4 3.0 idea for ac130 and heli
« Reply #10 on: July 04, 2010, 03:58:03 pm »
Okay Sammy  :) ,

I will post the stock _ac130.gsc that comes with X4 V3.0 ..

Maybe you could say me than after which line i have to add it  :) .

I do not mean you do not good explain  8)

But i need a little bit more assistance  :D .

Code: [Select]
#include maps\mp\_utility;

init()
{
precacheModel("c130_zoomrig");
precacheModel("vehicle_ac130_low");
precacheShader("ac130_overlay_25mm");
precacheShader("ac130_overlay_40mm");
precacheShader("ac130_overlay_105mm");
precacheShader("ac130_overlay_grain");
precacheShader("hudStopwatch");
precacheShader( "black" );
precacheItem("ac130_25mm_mp");
precacheItem("ac130_40mm_mp");
precacheItem("ac130_105mm_mp");

level.physicsSphereRadius["ac130_25mm_mp"] = 200;
level.physicsSphereRadius["ac130_40mm_mp"] = 600;
level.physicsSphereRadius["ac130_105mm_mp"] = 1000;
level.physicsSphereForce["ac130_25mm_mp"] = 0.5;
level.physicsSphereForce["ac130_40mm_mp"] = 3.0;
level.physicsSphereForce["ac130_105mm_mp"] = 6.0;
level.ac130_rotationSpeed = 40;
}

main()
{
ac130Origin = level.ex_playArea_Centre;
ac130Origin = getAboveBuildingsLocation(ac130Origin);  

level.ac130 = spawn("script_model", ac130Origin);
level.ac130 setModel("c130_zoomrig");
level.ac130.angles = (0,75,0);
level.ac130 hide();
  
level.ac130model = spawn("script_model", ac130Origin);
level.ac130model setModel("vehicle_ac130_low");
level.ac130.angles = (0,75,0);
level.ac130model linkTo(level.ac130, "tag_player", (000,0,0), (0,0,0));
level.ac130model hide();  
  
thread rotatePlane(true);
}

getAboveBuildingsLocation(location)
{
trace = bullettrace(location + (0,0,10000), location, false, undefined);
startorigin = trace["position"] + (0,0,-514);
  
zpos = 0;
  
maxxpos = 13; maxypos = 13;
for (xpos = 0; xpos < maxxpos; xpos++)
{
for (ypos = 0; ypos < maxypos; ypos++)
{
thisstartorigin = startorigin + ((xpos/(maxxpos-1) - .5) * 1024, (ypos/(maxypos-1) - .5) * 1024, 0);
thisorigin = bullettrace(thisstartorigin, thisstartorigin + (0,0,-10000), false, undefined);
zpos += thisorigin["position"][2];
}
}

zpos = zpos / (maxxpos*maxypos);
zpos = zpos + 1000;
  
return (location[0], location[1], zpos);
}

rotatePlane(toggle)
{
level notify("stop_rotatePlane_thread");
level endon("stop_rotatePlane_thread");
  
if(toggle)
{
for(;;)
{
level.ac130 rotateyaw( 360, level.ac130_rotationSpeed );
wait level.ac130_rotationSpeed;
}
}
else level.ac130 rotateyaw( level.ac130.angles[2], 0.05 );
}

ac130_attachPlayer()
{
self endon("end_respawn");
self endon("spawn");
level endon("ex_gameover");
self endon("disconnect");
self endon("death");
  
if(level.inPrematchPeriod) return;
if(isDefined(level.ac130Player)) return;
  
self hide();
level.ac130model show();
  
level.ac130Player = self;
level.ac130Player.ac130 = true;
level.ac130Player hide();
level.ac130Player.health = 99999;
  
self [[level.ex_clientcmd]]("gocrouch");
level.ac130Player linkTo(level.ac130, "tag_player", (4000,0,0), (0,0,0));

thread changeWeapons();
}

ac130_attachPlayer_go()
{
self endon("end_respawn");
self endon("spawn");
level endon("ex_gameover");
self endon("disconnect");
self endon("death");
self endon("ex_dead");
self endon("joined_spectators");

if(level.inPrematchPeriod) return;
if(isDefined(level.ac130Player)) return;
  
   level.ac130Player = self;
level.ac130Player.ac130 = true;
level.ac130Player hide();

if(level.ex_ac130_thermal)
{
self thread togglethermalOn();
}

level.ac130Player setClientDvar( "ui_hud_hardcore", 1 );

//Record weapons and ammo before we take them away.
ammoClipList = [];
ammoStockList = [];
weaponsList = self GetWeaponsList();
 
for (i = 0; i < weaponsList.size; i++)
{
ammoClipList[ammoClipList.size] = self GetWeaponAmmoClip( weaponsList[i] );
ammoStockList[ammoStockList.size] = self GetWeaponAmmoStock( weaponsList[i] );
}
  
originalHealth = self.health;
  
level.ac130model show();

self SetActionSlot( 1, "" );
self SetActionSlot( 3, "" );
  
self thread CleanUp_AC130();

level.ac130Player.health = 999999;
 
self [[level.ex_clientcmd]]("gocrouch");
level.ac130Player linkTo(level.ac130, "tag_player", (4000,0,0), (0,0,0));
self hide();
  
if(level.ex_ac130_hud) level.ac130Player thread ac130_hud();  

thread changeWeapons();
  
if(level.ex_air_raid_global) thread extreme\_ex_utils::playSoundLoc("air_raid",(0,0,0));
if(level.ex_air_raid_team) thread extreme\_ex_utils::playSoundOnPlayers("air_raid");
  
self iprintlnbold("You have " + level.ex_ac130_timer + " Seconds");
iprintln("^3AC130 GUNSHIP INBOUND ^1TAKE COVER!");

if(level.ex_ac130_sound) self thread playac130Sound();
 
players = level.players;
for(i = 0; i <players>= weapon.size) currentWeapon = 0;
  
level.ac130Player takeAllWeapons();
level.ac130Player giveWeapon( weapon[currentWeapon].weapon );  
level.ac130Player setClientDvar( "cg_fov", weapon[currentWeapon].fov );
level.ac130Player switchToWeapon( weapon[currentWeapon].weapon );
level.ac130Player SetWeaponAmmoClip( weapon[currentWeapon].weapon, 999 );
self thread setWepText(weapon[currentWeapon].settext);
self thread setOverlay(weapon[currentWeapon].overlay);
level.ac130Player thread screenshakeblackscreen();

level.ac130Player PlayLocalSound( "weap_rpg_twist_plr" );  
while(level.ac130Player useButtonPressed()) wait 0.05;
}
}

setOverlay(overlay)
{
level endon("ex_gameover");
self endon("end_respawn");
self endon("spawn");
self endon("disconnect");
self endon("death");
self endon("ac130_detached");
  
if(!isDefined(self.ac130_overlay))
{
self.ac130_overlay = newClientHudElem( self );
self.ac130_overlay.x = 0;
self.ac130_overlay.y = 0;
self.ac130_overlay.alignX = "center";
self.ac130_overlay.alignY = "middle";
self.ac130_overlay.horzAlign = "center";
self.ac130_overlay.vertAlign = "middle";
self.ac130_overlay.foreground = true;
}
self.ac130_overlay setshader(overlay, 640, 480);

if(level.ex_ac130grain)
{
if(!isDefined(self.ac130_grain))
{
self.ac130_grain = newClientHudElem( self );
self.ac130_grain.x = 0;
self.ac130_grain.y = 0;
self.ac130_grain.alignX = "left";
self.ac130_grain.alignY = "top";
self.ac130_grain.horzAlign = "fullscreen";
self.ac130_grain.vertAlign = "fullscreen";
self.ac130_grain.foreground = true;
self.ac130_grain.alpha = 0.5;
}
self.ac130_grain setshader("ac130_overlay_grain", 640, 480);
}
self waittill("useButtonPressed");

self.ac130_overlay destroy();
self.ac130_grain destroy();
}

setWepText(settext)
{
level endon("ex_gameover");
self endon("end_respawn");
self endon("spawn");
self endon("disconnect");
self endon("death");
self endon("ac130_detached");
  
if(!isDefined(self.ac130_weptext))
{
self.ac130_weptext = newClientHudElem( self );
self.ac130_weptext.x = 0;
self.ac130_weptext.y = 0;
self.ac130_weptext.alignX = "left";
self.ac130_weptext.alignY = "bottom";
self.ac130_weptext.horzAlign = "left";
self.ac130_weptext.vertAlign = "bottom";
self.ac130_weptext.foreground = true;
self.ac130_weptext.glowColor = (0.2, 0.3, 0.7);
self.ac130_weptext.glowAlpha = 1;
}
self.ac130_weptext settext(settext, 256, 256);
}

screenshakeblackscreen()
{
   level endon("ex_gameover");
   self endon("disconnect");
   self endon("death");
   self endon("ac130_detached");

   for(;;)
   {
 level.ac130Player waittill("projectile_impact", weapon, position, radius);

 thread shotFiredScreenShake( weapon );
 thread shotFiredPhysicsSphere(position, weapon);
 wait 0.05;
   }
}

shotFiredScreenShake(weapon)
{
   level endon("ex_gameover");
   self endon("disconnect");
   self endon("death");
   self endon("ac130_detached");

   switch(weapon)
   {
 case "ac130_105mm_mp":
duration = 0.2;
break;
 case "ac130_40mm_mp":
duration = 0.1;
break;
 default:
duration = 0;
break;
}
if(duration) earthquake(duration, 1, level.ac130Player.origin, 1000);

if(level.ex_ac130_shotFiredDarkScreen)
{
   if(duration) level.ac130Player thread shotFiredDarkScreenOverlay();
}
}

shotFiredPhysicsSphere(center, weapon)
{
wait 0.1;
physicsExplosionSphere(center, level.physicsSphereRadius[weapon], level.physicsSphereRadius[weapon] / 2, level.physicsSphereForce[weapon]);
}

CleanupSpawned()
{
if (isDefined(self.ac130_overlay)) self.ac130_overlay destroy();
if (isDefined(self.ac130_weptext)) self.ac130_weptext destroy();
if (isDefined(self.ac130_grain)) self.ac130_grain destroy();
}

CleanUp_AC130()
{
if(isDefined(level.ex_mapannouncer)) level.ex_mapannouncer destroy();
if(isDefined(level.ex_modinfo_hud)) level.ex_modinfo_hud destroy();
if(isDefined(self.hud_statsscore)) self.hud_statsscore destroy();
if(isDefined(self.hud_statshead)) self.hud_statshead destroy();
if(isDefined(self.hud_statsknife)) self.hud_statsknife destroy();
if(isDefined(self.hud_statsnade)) self.hud_statsnade destroy();
if(isDefined(self.hud_statskill)) self.hud_statskill destroy();
if(isDefined(self.hud_statsdeath)) self.hud_statsdeath destroy();
if(isDefined(self.hud_statskd)) self.hud_statskd destroy();
if(isDefined(self.ex_healthbar)) self.ex_healthbar destroy();
if(isDefined(self.ex_healthback)) self.ex_healthback destroy();
if(isDefined(self.ex_healthcross)) self.ex_healthcross destroy();  
if(isDefined(self.ex_firstaidicon)) self.ex_firstaidicon destroy();
if(isDefined(self.ex_firstaidval)) self.ex_firstaidval destroy();
if(isDefined(level.logo_img)) level.logo_img destroy();
if(isDefined(level.ex_alliesicon)) level.ex_alliesicon destroy();
if(isDefined(level.ex_alliesnumber)) level.ex_alliesnumber destroy();
if(isDefined(level.ex_axisicon)) level.ex_axisicon destroy();
if(isDefined(level.ex_axisnumber)) level.ex_axisnumber destroy();
if(isDefined(level.ex_deadalliesicon)) level.ex_deadalliesicon destroy();
if(isDefined(level.ex_deadalliesnumber)) level.ex_deadalliesnumber destroy();
if(isDefined(level.ex_deadaxisicon)) level.ex_deadaxisicon destroy();
if(isDefined(level.ex_deadaxisnumber)) level.ex_deadaxisnumber destroy();
if(isDefined(self .ex_hudstats)) self.hud_stats destroy();
if(isDefined(self.ex_laserdot)) self.ex_laserdot destroy();
if(isDefined(self.ex_hudstats)) self.ex_hudstats destroy();
}

resetWeapons(weaponsList, ammoClipList, ammoStockList)
{
useAltMode = true;
self takeAllWeapons();
 
class = self.class;
self maps\mp\gametypes\_class::setClass( class );

self maps\mp\gametypes\_class::giveLoadout(self.owner.pers["team"], self.owner.class);
  
// initialize specialty array
self.specialty = [];
self.specialty[0] = self.pers[class]["loadout_perk1"];
self.specialty[1] = self.pers[class]["loadout_perk2"];
self.specialty[2] = self.pers[class]["loadout_perk3"];

self maps\mp\gametypes\_class::register_perks();
 
if ( getDvarInt( "scr_enable_nightvision" ) )
self setActionSlot( 1, "nightvision" );
 
for( i = 0; i < weaponsList.size; i++ )
{
if(!AC130Weapons(weaponsList[i]))
{
self giveWeapon( weaponsList[i] );
}
 
if( isPrimaryWeapon (weaponsList[i]) && WeaponType( weaponsList[i] ) == "bullet" )
{
self setSpawnWeapon( weaponsList[i] );
}
 
switch ( weaponsList[i])
{
case "frag_grenade_mp":
self switchToOffhand( "frag_grenade_mp" );
break;
case "flash_grenade_mp":
self setOffhandSecondaryClass("flash");
break;
case "smoke_grenade_mp":
case "concussion_grenade_mp":
self setOffhandSecondaryClass("smoke");
break;
}
 
switch ( weaponsList[i] )
{
case "claymore_mp":
case "rpg_mp":
case "c4_mp":
self maps\mp\gametypes\_class::setWeaponAmmoOverall( weaponsList[i], ammoClipList[i] );
self setActionSlot( 3, "weapon", weaponsList[i] );
self setActionSlot( 4, "" );
useAltMode = false;
break;
default:
self setWeaponAmmoClip( weaponsList[i], ammoClipList[i] );
self setWeaponAmmoStock( weaponsList[i], ammoStockList[i] );
break;
}
}
if ( useAltMode )
{
self setActionSlot( 3, "altMode" );
self setActionSlot( 4, "" );
}
self maps\mp\gametypes\_class::cac_selector();
}

AC130Weapons(weapon)
{
switch(weapon)
{
case "ac130_25mm_mp":
case "ac130_40mm_mp":
case "ac130_105mm_mp":
return true;
default:
return false;
}
}

isPrimaryWeapon( weaponname )
{
return isdefined( level.primary_weapon_array[weaponname] );
}

ac130_hud()
{
level endon("ex_gameover");
self endon("end_respawn");
self endon("spawn");
self endon("disconnect");
self endon("death");
self endon("ac130_detached");

self.HUDItem[ "hud_text_top" ] = newClientHudElem( self );
  self.HUDItem[ "hud_text_top" ].x = 0;
  self.HUDItem[ "hud_text_top" ].y = 0;
  self.HUDItem[ "hud_text_top" ].alignX = "left";
  self.HUDItem[ "hud_text_top" ].alignY = "top";
  self.HUDItem[ "hud_text_top" ].horzAlign = "left";
  self.HUDItem[ "hud_text_top" ].vertAlign = "top";
  self.HUDItem[ "hud_text_top" ].fontScale = 2.5;
  self.HUDItem[ "hud_text_top" ] settext ( &"AC130_HUD_TOP_BAR" );
   self.HUDItem[ "hud_text_top" ].glowColor = (0.2, 0.3, 0.7);
   self.HUDItem[ "hud_text_top" ].glowAlpha = 1;
  self.HUDItem[ "hud_text_top" ].alpha = 1.0;

  self.HUDItem[ "hud_text_left" ] = newClientHudElem( self );
  self.HUDItem[ "hud_text_left" ].x = 0;
  self.HUDItem[ "hud_text_left" ].y = 60;
  self.HUDItem[ "hud_text_left" ].alignX = "left";
  self.HUDItem[ "hud_text_left" ].alignY = "top";
  self.HUDItem[ "hud_text_left" ].horzAlign = "left";
  self.HUDItem[ "hud_text_left" ].vertAlign = "top";
  self.HUDItem[ "hud_text_left" ].fontScale = 2.5;
  self.HUDItem[ "hud_text_left" ] settext ( &"AC130_HUD_LEFT_BLOCK" );
   self.HUDItem[ "hud_text_left" ].glowColor = (0.2, 0.3, 0.7);
   self.HUDItem[ "hud_text_left" ].glowAlpha = 1;
  self.HUDItem[ "hud_text_left" ].alpha = 1.0;

  self.HUDItem[ "hud_text_right" ] = newClientHudElem( self );
  self.HUDItem[ "hud_text_right" ].x = 0;
  self.HUDItem[ "hud_text_right" ].y = 50;
  self.HUDItem[ "hud_text_right" ].alignX = "right";
  self.HUDItem[ "hud_text_right" ].alignY = "top";
  self.HUDItem[ "hud_text_right" ].horzAlign = "right";
  self.HUDItem[ "hud_text_right" ].vertAlign = "top";
  self.HUDItem[ "hud_text_right" ].fontScale = 2.5;
  self.HUDItem[ "hud_text_right" ] settext ( &"AC130_HUD_RIGHT_BLOCK" );
   self.HUDItem[ "hud_text_right" ].glowColor = (0.2, 0.3, 0.7);
   self.HUDItem[ "hud_text_right" ].glowAlpha = 1;
  self.HUDItem[ "hud_text_right" ].alpha = 1.0;

  self.HUDItem[ "hud_text_bottom" ] = newClientHudElem( self );
  self.HUDItem[ "hud_text_bottom" ].x = 0;
  self.HUDItem[ "hud_text_bottom" ].y = 0;
  self.HUDItem[ "hud_text_bottom" ].alignX = "center";
  self.HUDItem[ "hud_text_bottom" ].alignY = "bottom";
  self.HUDItem[ "hud_text_bottom" ].horzAlign = "center";
  self.HUDItem[ "hud_text_bottom" ].vertAlign = "bottom";
  self.HUDItem[ "hud_text_bottom" ].fontScale = 2.5;
self.HUDItem[ "hud_text_bottom" ] settext ( &"AC130_HUD_BOTTOM_BLOCK" );
   self.HUDItem[ "hud_text_bottom" ].glowColor = (0.2, 0.3, 0.7);
   self.HUDItem[ "hud_text_bottom" ].glowAlpha = 1;
  self.HUDItem[ "hud_text_bottom" ].alpha = 1.0;

  self.HUDItem[ "thermal_mode" ] = newClientHudElem( self );
  self.HUDItem[ "thermal_mode" ].x = -80;
  self.HUDItem[ "thermal_mode" ].y = 50;
  self.HUDItem[ "thermal_mode" ].alignX = "right";
  self.HUDItem[ "thermal_mode" ].alignY = "top";
  self.HUDItem[ "thermal_mode" ].horzAlign = "right";
  self.HUDItem[ "thermal_mode" ].vertAlign = "top";
self.HUDItem[ "thermal_mode" ].fontScale = 2.5;
  self.HUDItem[ "thermal_mode" ] settext ( &"AC130_HUD_THERMAL_WHOT" );
   self.HUDItem[ "thermal_mode" ].glowColor = (0.2, 0.3, 0.7);
   self.HUDItem[ "thermal_mode" ].glowAlpha = 1;
   self.HUDItem[ "thermal_mode" ].alpha = 1.0;

self.HUDItem[ "coordinate_agl" ] = newClientHudElem( self );
self.HUDItem[ "coordinate_agl" ].x = 0;
self.HUDItem[ "coordinate_agl" ].y = 20;
self.HUDItem[ "coordinate_agl" ].alignX = "right";
self.HUDItem[ "coordinate_agl" ].alignY = "top";
self.HUDItem[ "coordinate_agl" ].horzAlign = "right";
self.HUDItem[ "coordinate_agl" ].vertAlign = "top";
self.HUDItem[ "coordinate_agl" ].fontScale = 2.5;
self.HUDItem[ "coordinate_agl" ] settext ( &"AC130_HUD_AGL" );
   self.HUDItem[ "coordinate_agl" ].glowColor = (0.2, 0.3, 0.7);
   self.HUDItem[ "coordinate_agl" ].glowAlpha = 1;
self.HUDItem[ "coordinate_agl" ].alpha = 1.0;

self.HUDItem[ "keypress" ] = newClientHudElem( self );
self.HUDItem[ "keypress" ].x = 0;
self.HUDItem[ "keypress" ].y = -60;
self.HUDItem[ "keypress" ].alignX = "left";
self.HUDItem[ "keypress" ].alignY = "bottom";
self.HUDItem[ "keypress" ].horzAlign = "left";
self.HUDItem[ "keypress" ].vertAlign = "bottom";
self.HUDItem[ "keypress" ].fontScale = 1.5;
self.HUDItem[ "keypress" ] settext ( &"AC130_HINT_CYCLE_WEAPONS" );
self.HUDItem[ "keypress" ].alpha = 1.0;

self.HUDItem[ "keypressthermal" ] = newClientHudElem( self );
self.HUDItem[ "keypressthermal" ].x = 0;
self.HUDItem[ "keypressthermal" ].y = -40;
self.HUDItem[ "keypressthermal" ].alignX = "left";
self.HUDItem[ "keypressthermal" ].alignY = "bottom";
self.HUDItem[ "keypressthermal" ].horzAlign = "left";
self.HUDItem[ "keypressthermal" ].vertAlign = "bottom";
self.HUDItem[ "keypressthermal" ].fontScale = 1.5;
self.HUDItem[ "keypressthermal" ] settext ( &"AC130_HINT_TOGGLE_THERMAL" );
self.HUDItem[ "keypressthermal" ].alpha = 1.0;
}

ac130_hudOff()  
{
hud_items = [];
hud_items[ hud_items.size ] = "hud_text_top";
hud_items[ hud_items.size ] = "hud_text_left";
hud_items[ hud_items.size ] = "hud_text_right";
hud_items[ hud_items.size ] = "hud_text_bottom";
hud_items[ hud_items.size ] = "thermal_mode";
   hud_items[ hud_items.size ] = "keypressthermal";
  hud_items[ hud_items.size ] = "keypress";
hud_items[ hud_items.size ] = "coordinate_agl";

for ( i = 0 ; i < hud_items.size ; i++ )
{
if ( isdefined( self.HUDItem[ hud_items[ i ] ] ) )
self.HUDItem[ hud_items[ i ] ] destroy();
}
}

playac130Sound()
{
  self endon("stop_ac130sound");

while(level.ac130Player)  
{
self PlayLocalSound( "ambient_ac130_x4" );
wait level.ex_ac130_timer;
}
}

stopac130Sound()
{
self notify("stop_ac130sound");
self StopLocalSound( "ambient_ac130_x4" );
}

shotFiredDarkScreenOverlay()
{
self notify( "darkScreenOverlay" );
self endon( "darkScreenOverlay" );

if ( !isdefined( self.darkScreenOverlay ) )
{
self.darkScreenOverlay = newClientHudElem( self );
self.darkScreenOverlay.x = 0;
self.darkScreenOverlay.y = 0;
self.darkScreenOverlay.alignX = "left";
self.darkScreenOverlay.alignY = "top";
self.darkScreenOverlay.horzAlign = "fullscreen";
self.darkScreenOverlay.vertAlign = "fullscreen";
self.darkScreenOverlay setshader ( "black", 640, 480 );
self.darkScreenOverlay.sort = -10;
self.darkScreenOverlay.alpha = 0.0;
}
self.darkScreenOverlay.alpha = 0.0;
self.darkScreenOverlay fadeOverTime( 0.2 );
self.darkScreenOverlay.alpha = 0.6;
wait 0.4;
self.darkScreenOverlay fadeOverTime( 0.8 );
self.darkScreenOverlay.alpha = 0.0;
}

togglethermalOn()
{
level.ac130Player endon("end_respawn");
level.ac130Player endon("spawn");
level.ac130Player endon("ex_gameover");
level.ac130Player endon("disconnect");
level.ac130Player endon("death");
level.ac130Player endon("ex_dead");
level.ac130Player endon("joined_spectators");  

while(isAlive(level.ac130Player))
{
wait (0.2);
if(level.ac130Player meleeButtonPressed())
{
self PlayLocalSound("item_nightvision_off");  
level.ac130Player setclientdvar("r_filmtweakdesaturation", 0);
level.ac130Player setclientdvar("r_filmtweakenable", 0);
level.ac130Player setclientdvar("r_filmusetweaks", 0);  
level.ac130Player setclientdvar("r_filmtweakbrightness", 0);  
}
else
if(level.ac130Player fragButtonPressed())
{
self PlayLocalSound( "item_nightvision_on" );
level.ac130Player setclientdvar("r_filmtweakdesaturation", 1);
level.ac130Player setclientdvar("r_filmtweakenable", 1);
level.ac130Player setclientdvar("r_filmusetweaks", 1);  
level.ac130Player setclientdvar("r_filmtweakbrightness", 0.3);    
}
}
}

This is the one that comes with the X4 V3.0 Release Candidate..

Greetings PhoeniX

Offline Sammy

  • Rank: Private
  • *
  • Posts: 105
Re: x4 3.0 idea for ac130 and heli
« Reply #11 on: July 04, 2010, 04:23:16 pm »
Put the compass precache after this in init
//already in ac130.gsc
precacheShader( "black" );
//new
precacheShader( "compass_waypoint_capture" );

Put these after creating the script model
//already in ac130.gsc
level.ac130model hide();
//new
objective = 15; //temp only and might cause conflicts
Objective_Add( objective, "active");
Objective_Icon( objective, "compass_waypoint_capture" );
Objective_OnEntity( objective, level.ac130 );

I looked and I dont have the waypoint in my csv so I suspect you dont need to add it and recompile. For testing you might want to comment out the hide line so the ac130model is showing when you first start the game. Again this is just a quick example to get it to show up and not any kind of finalized code.

Offline 4peterjan4

  • Rank: Private
  • *
  • Posts: 505
    • http://www.specialforces-clan.com
Re: x4 3.0 idea for ac130 and heli
« Reply #12 on: July 05, 2010, 01:11:27 am »
Okay i have done like u said  :)

Now its like this even without an AC130  :P



When the AC130 is in the air you don't see this  :?

Offline Sammy

  • Rank: Private
  • *
  • Posts: 105
Re: x4 3.0 idea for ac130 and heli
« Reply #13 on: July 05, 2010, 01:31:15 am »
Yes, the code was just a basic example of how to use an objective. You can show/hide by using 'objective_state' in the ac130 functions that attach and detach the player.

Offline 4peterjan4

  • Rank: Private
  • *
  • Posts: 505
    • http://www.specialforces-clan.com
Re: x4 3.0 idea for ac130 and heli
« Reply #14 on: July 05, 2010, 01:36:56 am »
Okay  8)

Am sorry to say but i expected you could give us the right code  :) .

I am serious an nooby at this LMAO  :P