Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Test Builds => Topic started by: WMCoolmon on October 29, 2005, 10:13:40 pm
-
OK, this has a helluva lot of changes (none in CVS).
Nebula.tbl
self-explanatory (http://www.hard-light.net/forums/index.php/topic,36015.0.html)
Scripting
This includes the current progress of my work on getting Lua in there. To see the valid functions and classes, use the "-output_scripting" command line. This will output, in the same directory as the EXE, an HTML file called "scripting.html" with all the implemented scripting stuff.
In addition, to actually use them, make a new table called "script.tbl" in the data/tables directoy. The "$Global:" field will create a globally-executed script.
EG:
data/tables/script.tbl
$Global: [
grpc.SetColor(255,255,255,255)
grpc.draWString(1,1,getState())
]
Note that this includes depth-checking for the [] symbols, so you should be able to use arrays without any problem (untested)
Shockwaves
Ooh, this is another fun part. Requested by redmenace for the BSG mod...And totally untested! :D
Weapons.tbl now has several new variables:
$Damage:
$Damage type:
$Arm time:
$Arm distance:
$Shockwave damage:
$Blast force:
$Inner radius:
$Outer radius:
$Shockwave speed:
$Shockwave rotation:
$Shockwave model:
$Shockwave name:
$Dinky shockwave:
+Shockwave damage:
+Blast force:
+Inner radius:
+Outer radius:
+Shockwave speed:
+Shockwave rotation:
+Shockwave model:
+Shockwave name:
Obviously shockwave rotation is the rotation of the shockwave; shockwave damage is an override for how much damage the shockwave causes.
Dinky shockwave, arm time, and arm distance are all related. The dinky shockwave values will be used if:
1) The weapon is killed by another weapon (eg subach shooting helios), and arm time and arm distance are not specified
2) The weapon is destroyed, either by hitting its target or getting shot down, but arm_time has not elapsed, or the ship that launched it is still alive and within the arm distance
Or to explain it another way...
If arming conditions are specified, the dinky shockwave will be used until both are true. (ie the weapon is armed) If no arming conditions are specified, the dinky shockwave will be used whenever the weapon is shot down.
Hopefully this means there'll be less mods with shields for the sake of protecting ships from bomb explosions. :)
Last-minute note: Right when the upload finished, I realized that I forgot to copy *all* the shockwave data to the dinky shockwave for backwards compatibility; as a result, I don't think there will be a shockwave if dinky shockwave isn't specified and a bomb is shot down. I'll fix this before CVSing.
http://fs2source.warpcore.org/exes/latest/C10292005.zip
-
2 more requests
could you add a $Arm Disttotarget and the ability to set the impact explosion if any of the $Arm options are used.
I tested it out. I think it works.
-
Oh, I get it. The Arming stuff is kinda like that sequence in "The Hunt For Red October", when the Sub rams the torpedo and doesn't take dammage because it hadn't armed itself yet.
-
:nod: Exactly right.
I added in redmenace's new disttotarget. It's "$Arm radius:" under "$Arm dist:". The section of code that checks for the $Arm variables is starting to look like a piece of scheme, though. :p
if(((wip->arm_time) && (Missiontime - wp->creation_time < wip->arm_time))
|| ((wip->arm_dist) && (weapon_parent_objp == NULL || weapon_parent_objp->type == OBJ_NONE || (vm_vec_dist(&weapon_obj->pos, &weapon_parent_objp->pos) < wip->arm_dist)))
|| ((wip->arm_radius) && (wp->homing_object == NULL
|| (wp->homing_subsys == NULL && vm_vec_dist(&weapon_obj->pos, &wp->homing_object->pos) > wip->arm_radius)
|| (wp->homing_subsys != NULL && get_subsystem_pos(&spos, wp->homing_object, wp->homing_subsys) && vm_vec_dist(&weapon_obj->pos, &spos) > wip->arm_radius))))
I don't get the impact explosion thing, though.
-
sorta like that. I request this so when a viper intercepts a cylon nuke it doesn't show that huge blast. So instead you see only a small explosion like from a typical missle.
-
this sorta opens up some possibilities for torpedo weapons and other non guided bombs.
-
Updated build linked to in first post:
- $Arm radius below $Arm distance
- $Dinky impact explosion
- $Dinky impact explosion radius
Both of the weapon explosion vars are below the original two.
Also, I threw in some code to set the velocity of muzzle flashes to be the same as the ship. In addition, I added some VERY primitive rotational velocity factoring code; this will probably only be accurate on the very outside of a ship. I don't remember enough trig right now to be able to do that.
-
i cant get it to generat the html file
-
It was a silly little bug. I've committed a fix to CVS, in the meantime, the file can be found here:
http://fs2source.warpcore.org/temp/scripting.html
-
I don't think the dinky explosion stuff is working. helios that are intercepted well before the arm radius are flowing the bomb flare thing.
$Name: Helios
+Title: XSTR("GTM-13 Helios", 3392)
+Description:
XSTR(
"Special Issue
Anti-Capital Ship Weapon
Anti-Matter Torpedo", 3393)
$end_multi_text
+Tech Title: XSTR("GTM-13 Helios", 3394)
+Tech Anim: Tech_Helios
+Tech Description:
XSTR(
"The GTM-13 Helios is the product of an entire generation of high-energy physics research, based primarily at the GTVA particle accelerator complex near Antares. The most powerful warhead in the fleet's arsenal, the Helios generates a massive shockwave from the cataclysmic annihilation of matter and anti-matter, triggered upon impact with its target. Each bank of Helios warheads can fire only once every 30 seconds. The Helios is prohibitively expensive to produce, thus its deployment is severely restricted.", 3395)
$end_multi_text
$Model File: helios.pof
$Mass: 35.0
$Velocity: 65.0
$Fire Wait: 30.0
$Damage: 6800 ;; damage applied when within inner radius
$Arm radius: 10
$Blast Force: 1000.0
$Inner Radius: 100.0 ;; radius at which damage is full (0 for impact only)
$Outer Radius: 270.0 ;; max radius for attenuated damage
$Shockwave Speed: 75 ;; velocity of shockwave. 0 for none.
$Armor Factor: 1.0
$Shield Factor: 0.02
$Subsystem Factor: 0.85
$Lifetime: 30.0
$Energy Consumed: 0.0
$Cargo Size: 25.0
$Homing: YES
+Type: ASPECT ;; Legal: HEAT, ASPECT
+Turn Time: 1.5
+Min Lock Time: 7.0 ;; Minimum lock time (in seconds)
+Lock Pixels/Sec: 25 ;; Pixels moved per sec while locking
+Catch-up Pixels/Sec: 0 ;; Pixels moved per sec while catching up
+Catch-up Penalty: 15 ;; Extra pixels to move after catching up
$LaunchSnd: 97
$ImpactSnd: 101 ;; shockwave impact sound
$FlyBySnd: -1
$Rearm Rate: 0.02
$Flags: ( "Bomb" "Huge" "No Dumbfire" "player allowed")
$Trail: ;; Trail cannot be set if Exhaust is set
+Start Width: 0.5 ;; Width of trail nearest missile
+End Width: 2.0
+Start Alpha: 1.0
+End Alpha: 0.0
+Max Life: 2.0 ;; how many seconds before trail disappears
+Bitmap: MissileTrail02 ;; Bitmap used to draw trail
$Icon: iconHelios
$Anim: Helios
$Impact Explosion: bomb_flare
$Impact Explosion Radius: 200.0
$Dinky impact explosion: ExpMissileHit1
$Dinky impact explosion radius: 0
-
Originally posted by WMCoolmon
Also, I threw in some code to set the velocity of muzzle flashes to be the same as the ship.
Does this mean we can get muzzle flashes on non-flak weapons (plz plz plz!!!11!!!11!!1111)
-
Just tried it, and yes, they work on non-flak weapons and move with the fighter.
-
w00tang! I sure hope i didnt delete all those turret muzzle flashes i had made a few days ago when i cleaned out my fs2 directories.. ok i did..
Anyways, they sucked.
But it turns out that turrets still cant use muzzle flashes, would this be hard to change?