December 22, 2024, 08:07:09

Author Topic: Removing IP Drive EFXs  (Read 6867 times)

Offline Justaman16493

  • Recruit
  • *
  • Posts: 8
  • Karma: 0
    • View Profile
Removing IP Drive EFXs
« on: February 27, 2011, 09:13:43 »
hey everyone

i just wanted to know how i can remove the ip drive effects, i have been able to take away the background effect of it when the ship already has engaged the ip drive and is now on its way to a planet for example, i know how to get rid of the "boom" effect when it blasts into IP, but my question is how can you take away the charge up to IP (the blue slingshot like effect), the reason i need it removed is because star wars lightspeed looks not even slightly close to the original Nexus effect, infact engaging the hyperdrive in star wars dosent really have an effect, the ship just kinda speeds up and then disapears, i need the same thing for when the ship drops out of lightspeed, also while im here i might aswell ask because its still linked to the IP Drive, how can i stop the ship from having to rotate before it can go into lightspeed, just like how it is in Stargate War Begins, so basically i need it the same as the hyperspace drive in stargate war begins just instead of having a hyperspace window the ship disappears.

thanks in advance

Offline Mularac

  • Lieutenant
  • ***
  • Posts: 531
  • Karma: 11
    • View Profile
Re: Removing IP Drive EFXs
« Reply #1 on: February 27, 2011, 17:03:59 »
Well, then you've asked the right question.

The War Begins hyperspace code is a heavily modified version of the Babylon 5 jump point code, but much simpler, however I won't be explaining how it works here, so lets move on.

It does basically two things: Accelarates a ship onwards, and it then plays an efx. So, If you only want the accelaration part, then all you have to do is go to the file "universe\tactics\subroutines\IncomingJumpPoint.inc" and comment out every line that says "playEfx(...);" and voilá.

That's for the Hyperspace incoming effect, for the outgoing you have to modify the file "universe\tactics\mod_commands\AI_JumpPointOut.command" in the same fashion.

(Also... While writing this I encountered a pretty embarrising design flaw in my code... The file named AI_JumpPointOut.command should be named JumpPointOut, and the first line, where it says:
"Name AI_JumpPointOut" it should say instead: "Name Player_JumpPointOut" I've included a version of said file for you to try)

Once you've included both files, you'll have to do some backround coding to get it fully to work. Firstly, you have to create a dummy device named "hyperspace" or something. The device should quite empty and not have any particular function. Example from our tacticstype.ini:

Code: [Select]
DEVICETYPE 357
Name "supp_jumpdrive"
Category 4
Sets 18 60 61 100 135 ;
EnergyIn 40
Detected 50
Scanned 140
Hpmax 1500
RepairHP 12
DEVICETYPE

Then, include a file somewhere in your mod with this piece of coding:

Code: [Select]

Machine "Hyperspace"

State Hyperspace

Rule event in
name "Hyper"
:action
SelectEx(s.this:devtype=#supp_jumpdrive,
EnableActivateEvents(s.this,1);
Debug("Enabled Activate events for the device", s.this, "on the ship:", s.this:owner);
);
:end
END

Rule event tick
:action
SelectEx(s.this:devtype=#supp_jumpdrive,
EnableActivateEvents(s.this,1);
);
:end
END
tick 2   //This bit is optional. I keep for convenience, if I make ships appear or something like that
                           //during a mission I don't have to code something else

RULE event DeviceActivated
:action
if(e.device:devtype=#supp_jumpdrive,
SendCommand(e.device:owner, "Player_JumpPointOut", 0, 0);
);

:end
END

RULE event DeviceDeactivated
:action
if(e.device:devtype=#supp_jumpdrive,
Delay(0,0.1,
SendCommand(e.device:owner, "Player_HoldPosition",0,0);
,e.device:=p.device);
);
:end
END

Rule event LongRangeArrived
:action
SelectEx(s.this:devtype=#supp_jumpdrive,
EnableActivateEvents(s.this,1);
);
:end
END
END
END

For example, you could place this file in a folder named "includes" in your mod_mission folder and name however you want. Just don't forget to include it in your mission scripts and all. Preferily, you should create a "link" or "nexus" file, that would include all the necesary files for each mission and start all the machines (take a look at WB "main_link.inc" file in the \universe\mod_missions\includes\ folder)
And lastly, add this line into your mod_commands.ini in the tactics folder (if you don't have that file, then you have to create it): Single 12 "JumpPointOut" ;
Simple as that.

So, with that done, the backround code will be done, so now on to specifics:
To make a ship jump to hyperspace, you only have to do one of two things: either press the former hyperspace button (F12) or activate the supp_jumpdrive device.
If you want to make a ship jump to hyperspace via coding, all you have to do is execute this line of coding:

SendCommand(<the ship>, "Player_JumpPointOut", 0, 0);

Where <the ship> is the variable with the ship you'll tell it to jump.

If you want to make a ship appear from hyperspace is a bit more complicated, but not much.
Firstly, you have to include a machine with the incomingJumpPoint.inc code in it, so add this somewhere in your mission:

Code: [Select]
Machine "Hyperspace" //The name hyperspace is an example
#include "..\tactics\subroutines\IncomingJumpPoint.inc"
END

To make a ship jump, you have to first add it to the jumping group (you can have as many ships jumping simultaneously as you want) by issuing this command:

Code: [Select]
M:GetMachine("Hyperspace"):ChangeState(InitJp, e.ship1:=myShip1 ; e.ship2:=myShip2 ; e.ship3:=myShip3 ; e.ship4 := myShip4);

or

Code: [Select]
M:GetMachine("Hyperspace"):ChangeState(InitJp, e.ship1:=myShip1);
M:GetMachine("Hyperspace"):ChangeState(InitJp, e.ship1:=myShip2);
M:GetMachine("Hyperspace"):ChangeState(InitJp, e.ship1:=myShip3);
M:GetMachine("Hyperspace"):ChangeState(InitJp, e.ship1:=myShip4);

Makes no difference. Only know that you can only add 4 at a time (although that can easily be modified in the IncomingJumpPoint.inc file).
And once you want to make all those ships appear from hyperspace, all you have to do is issue the command

Code: [Select]
M:GetMachine("Hyperspace"):ChangeState(IncomingJumpPoint,0);

And done. The ships appear from hyperspace.
Please know that you can only re-use the machine once all the ships have appeared from hyperspace, not sooner.
This code also issues a LongRangeArrived and Runaway command when the ships arrive/leave, so if you've used them before you can leave them there.

If you have any questions, feel free to ask right away. Also, anyone is more than free to borrow and use this code as they see fit.
« Last Edit: February 27, 2011, 17:14:45 by Mularac »

Offline Justaman16493

  • Recruit
  • *
  • Posts: 8
  • Karma: 0
    • View Profile
Re: Removing IP Drive EFXs
« Reply #2 on: March 01, 2011, 12:35:51 »
thanks mularac, worked well, although im now thinking that ill give the hyperdrive a window effect but something very simple which i have actually figured out how to do already so im fine on that part, i changed my mind because it looked abit odd not having an effect, i can always change it back if i feel like it and i most likely will change my mind :) lol

thanks again mularac for the help

Offline Mularac

  • Lieutenant
  • ***
  • Posts: 531
  • Karma: 11
    • View Profile
Re: Removing IP Drive EFXs
« Reply #3 on: March 01, 2011, 18:00:12 »
Sure, no problem. Adding or removing an effect is trivial anyway.

If you have any questions, just shoot.