[mod Request] Emergancy Stop!!!!

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
User avatar
Chobittsu
Posts: 2210
Joined: Wed, 14. Apr 10, 21:12
x4

[mod Request] Emergancy Stop!!!!

Post by Chobittsu » Wed, 23. Jun 10, 19:14

I'm sick of my TSs and Large Capital ships plowing into stations and other ships. We have Boost Extension and Turbo Boost, I think we need a Brake Extension!

Really simple, just a Boost Extension but backwards. I'm sure SOMEONE on here could whip this up in a few minutes. And I'm sure that other players have had the same problem, so this could save lives (sorta).

My standard deathrate is 25% in combat, 75% collisions, could I get a hand making that 0%?

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Wed, 23. Jun 10, 19:19

incrediably easy to create

esentially its just a one line scripts, tied into the method you want to activate it.

Code: Select all

[PLAYERSHIP] -> set ship speed 0

mark_a_condren
Posts: 1468
Joined: Wed, 3. Aug 05, 05:05
x3tc

Post by mark_a_condren » Wed, 23. Jun 10, 19:34

[PLAYERSHIP] -> set ship speed 0
ROFL !!!

So instead of the spaceflies being splattered on the outside of the windscreen, it's the occupants splattered on the inside.

(sorry i just got a really vivid mental picture of it)

MarCon

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Wed, 23. Jun 10, 21:27

at least it'll allow for another mod/ship upgrade

Airbags :P

stealthhammer
Posts: 1461
Joined: Fri, 12. Sep 08, 04:27

Post by stealthhammer » Wed, 23. Jun 10, 22:22

--Splat, Ow my nose... :lol:


Would be nice to have an E-break now and then and with a hot key. Really need it since we now have the turbo boost and the kestrel is a true missile with a seat on the end now.
"The more we, as a human race, becomes more advanced, the more we, as a human race, lose our humanity and common sense." - Sean Patrick Feeney

"Technological progress is like an axe in the hands of a pathological criminal." - Albert Einstine

User avatar
Serial Kicked
Posts: 3823
Joined: Fri, 12. Aug 05, 20:46
x3tc

Post by Serial Kicked » Wed, 23. Jun 10, 22:33

Guys, seriously it's just 3 lines of code.
Read the tutorials and tons of help topic already there, please.


plugin.emergency.brake

Code: Select all

[PLAYERSHIP] -> set speed 0
setup.emergency.brake (will setup the hotkey on game start)

Code: Select all

$installed = get global variable: name='ebrake.installed'
if not $installed
- $hotkey.id =  register hotkey "Emergency Break" to call script 'plugin.emergency.brake'
- set global variable: name='ebrake.installed' value=$hotkey.id
end
uninstall.emergency.brake (run it manually to remove the hotkey)

Code: Select all

$hotkey.id = get global variable: name='ebrake.installed' 
unregister hotkey $hotkey.id
X3:TC/AP Pirate Guild 3 - Yaki Armada 2 - Anarkis Defense System

Anarkis Gaming HQ
Independent Game Development
X3 Scripting and Modding Station

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Wed, 23. Jun 10, 23:31

even less if you use the hotkey manager ;)

can be done with 2 scripts, each with 1 line.

the brake script setting the speed, and the setup script using the hotkey manager

DreamsofanEagle
Posts: 135
Joined: Fri, 30. Oct 09, 04:06

Post by DreamsofanEagle » Thu, 24. Jun 10, 16:53

I think what would work better is cutting the time to decelerate quickly. Even more helpful when an enemy capital decides to ram you.

User avatar
Chobittsu
Posts: 2210
Joined: Wed, 14. Apr 10, 21:12
x4

Post by Chobittsu » Fri, 25. Jun 10, 00:09

Thanks Serial Kicked and Cycrow, I appreciate your time on the matter.
I'll try and put those lines of code to good use. Need the experience with the Script Editor anyway. :P Luck and Profit

User avatar
apricotslice
Posts: 14129
Joined: Sun, 16. May 04, 13:01
x4

Post by apricotslice » Fri, 25. Jun 10, 01:49

That is all nice for the player ship, but the OP seems to be talking more about the computer controlled ships the player owns.

How do you implement that to stop AI controlled ships hitting things ?

As I see it, one extension of this would be during the attack target (or protect or follow) movement, if a ship gets say 100 meters away from the target ship, then it executes a dead stop, changes direction and then maximum exceleration away.

Just a thought.

User avatar
Serial Kicked
Posts: 3823
Joined: Fri, 12. Aug 05, 20:46
x3tc

Post by Serial Kicked » Fri, 25. Jun 10, 02:00

@chobit-389: no problem.

@apricotslice: :? i thought you knew at least basic scripting.

setup.emergency.brake.ai

Code: Select all

$aim -> get player tracking aim        // get what the player is aiming at
$aim.race = $aim -> get owner race     // check for ownership         
If $aim.race = Player
- $aim -> call script '!ship.cmd.stay' // "Standby" order
- $aim -> set speed 0
end
X3:TC/AP Pirate Guild 3 - Yaki Armada 2 - Anarkis Defense System

Anarkis Gaming HQ
Independent Game Development
X3 Scripting and Modding Station

User avatar
apricotslice
Posts: 14129
Joined: Sun, 16. May 04, 13:01
x4

Post by apricotslice » Fri, 25. Jun 10, 02:04

Basic basic. I'm better at adapting existing code than writing new code.

And that wasnt what I was suggesting.

I dont mean a trigger the player presses to stop one of their ships colliding, I mean integrate the stop mechanism in to the movement scripts so it happens automatically with all NPC and player AI ships.

User avatar
Serial Kicked
Posts: 3823
Joined: Fri, 12. Aug 05, 20:46
x3tc

Post by Serial Kicked » Fri, 25. Jun 10, 02:26

Oh oki, sorry for the misunderstanding.

That's a whole different story :p

Apparently it was supposed to be integrated as there's a dummy signal file standing for "collision warning" (does it even work if used?). I guess it was disregarded because it doesn't work well with SETA.

Technically it's doable (with or without this signal). But the result will probably not be as good as you are expecting. Well, it would work as long as SETA is off or low. But on 8x or 10x settings, there's simply too much frames being skipped for this to work well.

And before you ask, no I won't give it a try sorry, I am busy with my own projects atm.
X3:TC/AP Pirate Guild 3 - Yaki Armada 2 - Anarkis Defense System

Anarkis Gaming HQ
Independent Game Development
X3 Scripting and Modding Station

User avatar
apricotslice
Posts: 14129
Joined: Sun, 16. May 04, 13:01
x4

Post by apricotslice » Fri, 25. Jun 10, 02:45

If someone is running seta, then collisions are inevitable anyway ! Thus their own problem. :D

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”