Author Topic: the uggliest hack I've seen in the FS2 source  (Read 7912 times)

0 Members and 2 Guests are viewing this topic.

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
the uggliest hack I've seen in the FS2 source
this was V's doing by the way,
look at maybe_hack_cruiser_chase_abort()
for those of you unable to look at the source at the moment it goes a little something like this
Code: [Select]

int maybe_hack_cruiser_chase_abort()
{
ship *shipp = &Ships[Pl_objp->instance];
ship *eshipp = &Ships[En_objp->instance];
ai_info *aip = &Ai_info[shipp->ai_index];

// mission sm3-08, sathanos chasing collosus
if ( stricmp(Mission_filename, "sm3-08.fs2") == 0 ) {
if (( stricmp(eshipp->ship_name, "colossus") == 0 ) || ( stricmp(shipp->ship_name, "colossus") == 0 )) {
// Changed so all big ships attacking the Colossus will not do the chase code.
// Did this so Beast wouldn't swerve away from Colossus. -- MK, 9/14/99
//if ( stricmp(shipp->ship_name, "Sathanas") == 0 ) {
// do cool hack stuff here
ai_clear_ship_goals( aip );
aip->mode = AIM_NONE;
return 1;
//}
}
}

return 0;
}


basicly it says that if the mission file name is sm3-08.fs2 (my eyes bleed already) and ether our ship or the ship we are atacking's name is colossus, don't do anything.

sm3-08.fs2 == 'their finest hour'
« Last Edit: February 26, 2004, 09:44:48 pm by 57 »
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Setekh

  • Jar of Clay
  • 215
    • Hard Light Productions
the uggliest hack I've seen in the FS2 source
!

They must have been running out of ideas. Or coffee, at 3am.
- Eddie Kent Woo, Setekh, Steak (of Steaks), AWACS. Seriously, just pick one.
HARD LIGHT PRODUCTIONS, now V3.0. Bringing Modders Together since January 2001.
THE HARD LIGHT ARRAY. Always makes you say wow.

 

Offline IceFire

  • GTVI Section 3
  • 212
    • http://www.3dap.com/hlp/hosted/ce
the uggliest hack I've seen in the FS2 source
Wouldn't it just make sense to set the Sathanas on a waypoint and let the Colossus orbit it with its guns?  I thought thats how it had been done...
- IceFire
BlackWater Ops, Cold Element
"Burn the land, boil the sea, you can't take the sky from me..."

 

Offline Taristin

  • Snipes
  • 213
  • BlueScalie
    • Skelkwank Shipyards
the uggliest hack I've seen in the FS2 source
...mission specific coding? :wtf:
Freelance Modeler | Amateur Artist

 

Offline phreak

  • Gun Phreak
  • 211
  • -1
the uggliest hack I've seen in the FS2 source
i found an uglier one!!11

Code: [Select]

// For the subspace mission (sm3-09a)
// for delta wing
// if they're sufficiently far into the mission
// if they're near one or more enemies
// every so often
// fire a synaptic if they have one.
void maybe_cheat_fire_synaptic(object *objp, ai_info *aip)
{
// Only do in subspace missions.
if ( The_mission.flags & MISSION_FLAG_SUBSPACE ) {
ship *shipp;
int num, time;

shipp = &Ships[objp->instance];

if (!(strnicmp(shipp->ship_name, NOX("delta"), 5))) {
num = shipp->ship_name[6] - '1';

if ((num >= 0) && (num <= 3)) {
time = Missiontime >> 16; // Convert to seconds.

time -= 2*60; // Subtract off two minutes.

if (time > 0) {
int modulus = 17 + num*3;

if ((time % modulus) < 2) {
int count = num_nearby_fighters(get_enemy_team_mask(OBJ_INDEX(objp)), &objp->pos, 1500.0f);

if (count > 0) {
cheat_fire_synaptic(objp, shipp, aip);
}
}
}
}
}
}

}

Offically approved by Ebola Virus Man :wtf:
phreakscp - gtalk
phreak317#7583 - discord

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
the uggliest hack I've seen in the FS2 source
shouldn't they be doing that in every mission?
that behavior, not that code
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 
the uggliest hack I've seen in the FS2 source
im guessing its a programed scripted sequence of events?

 

Offline CP5670

  • Dr. Evil
  • Global Moderator
  • 212
the uggliest hack I've seen in the FS2 source
I think that Colossus thing would have been much easier to do by just not giving them attack orders and using some fire-beams instead... :p

Look for any such thing in the source regarding sm3-10 and end-campaign; there is a bug in the last mission that might have had such a hack to correct it but was removed at some point, since the bug has suddenly started to show up.
« Last Edit: February 26, 2004, 10:50:25 pm by 296 »

 

Offline Knight Templar

  • Stealth
  • 212
  • I'm a magic man, I've got magic hands.
the uggliest hack I've seen in the FS2 source
So what you're saying is that the Colossus really sucks more than we know? *gasp*!
Copyright ©1976, 2003, KT Enterprises. All rights reserved

"I don't want to get laid right now. I want to get drunk."- Mars

Too Long, Didn't Read

 

Offline Nico

  • Venom
    Parlez-vous Model Magician?
  • 212
the uggliest hack I've seen in the FS2 source
Quote
Originally posted by PhReAk
i found an uglier one!!11

Code: [Select]

// For the subspace mission (sm3-09a)
// for delta wing
// if they're sufficiently far into the mission
// if they're near one or more enemies
// every so often
// fire a synaptic if they have one.
void maybe_cheat_fire_synaptic(object *objp, ai_info *aip)
{
// Only do in subspace missions.
if ( The_mission.flags & MISSION_FLAG_SUBSPACE ) {
ship *shipp;
int num, time;

shipp = &Ships[objp->instance];

if (!(strnicmp(shipp->ship_name, NOX("delta"), 5))) {
num = shipp->ship_name[6] - '1';

if ((num >= 0) && (num <= 3)) {
time = Missiontime >> 16; // Convert to seconds.

time -= 2*60; // Subtract off two minutes.

if (time > 0) {
int modulus = 17 + num*3;

if ((time % modulus) < 2) {
int count = num_nearby_fighters(get_enemy_team_mask(OBJ_INDEX(objp)), &objp->pos, 1500.0f);

if (count > 0) {
cheat_fire_synaptic(objp, shipp, aip);
}
}
}
}
}
}

}

[/B]


Whoa, trop chouette, là on comprend vraiment tout, j'adore. Merci, non, franchement, j'insiste, merci.
SCREW CANON!

 
the uggliest hack I've seen in the FS2 source
dude, ****.

mission specific coding is something i never expected in any usefull bit of code. they must've run out of FREDders, and have too much coders or something.

what happens when you make a compeltely different mission with the same filename?
just another newbie without any modding, FREDding or real programming experience

you haven't learned masochism until you've tried to read a Microsoft help file.  -- Goober5000
I've got 2 drug-addict syblings and one alcoholic whore. And I'm a ****ing sociopath --an0n
You cannot defeat Windows through strength alone. Only patience, a lot of good luck, and a sledgehammer will do the job. --StratComm

 

Offline RandomTiger

  • Senior Member
  • 211
the uggliest hack I've seen in the FS2 source
Not much we can do about it, we have to maintain compatibility with the default data.

 

Offline Nico

  • Venom
    Parlez-vous Model Magician?
  • 212
the uggliest hack I've seen in the FS2 source
The mission could be fixed so you can get rid of that crap?
SCREW CANON!

 

Offline RandomTiger

  • Senior Member
  • 211
the uggliest hack I've seen in the FS2 source
We need the code to work the default data.
Its all very well saying oh we will give them the fix,
but some people may never download the vp.
And in my opinion the vp should not be compulserary.

 

Offline RandomTiger

  • Senior Member
  • 211
the uggliest hack I've seen in the FS2 source
Nico, I dont see why that one is so bad, its generalised to subspace missions. However I have to agree the one Bob found is quite a bad hack.

 

Offline Nico

  • Venom
    Parlez-vous Model Magician?
  • 212
the uggliest hack I've seen in the FS2 source
I don't see why THAT ONE is so bad either, I don't even understand what it is ( since phreak believes everybody can read code ), but ten, twenty of those, and that's how you get a bloated code filled of lines useful for one single occurence in the game. Well dunno, I had the feeling that "cleaning the code" included stuff like that...
SCREW CANON!

 

Offline aldo_14

  • Gunnery Control
  • 213
the uggliest hack I've seen in the FS2 source
Quote
Originally posted by Nico
I don't see why THAT ONE is so bad either, I don't even understand what it is ( since phreak believes everybody can read code ), but ten, twenty of those, and that's how you get a bloated code filled of lines useful for one single occurence in the game. Well dunno, I had the feeling that "cleaning the code" included stuff like that...



Says in the comments...basically tells Delta wing to fire of a synaptic every  few minutes if posssible.

How often are these functions called/checked?  upon every mission?
« Last Edit: February 27, 2004, 04:45:58 am by 181 »

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
the uggliest hack I've seen in the FS2 source
every frame
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline diamondgeezer

the uggliest hack I've seen in the FS2 source
They even managed to misspell 'Sathanas'. The code seems to apply to the Ravana 'Beast' as well. My personal favourite bit is where it says 'do cool hack stuff here' :nod:

 

Offline Flaser

  • 210
  • man/fish warsie
the uggliest hack I've seen in the FS2 source
IMHO Get rid of it and all of its brothers/sisters.

The SCP is no longer in a phase where you will have any justifiable benefit from using the new exe without any supplementary data.
"I was going to become a speed dealer. If one stupid fairytale turns out to be total nonsense, what does the young man do? If you answered, “Wake up and face reality,” you don’t remember what it was like being a young man. You just go to the next entry in the catalogue of lies you can use to destroy your life." - John Dolan