PDA

View Full Version : [WIP]Insulting Computer Panel K1


Darth Xander
01-25-2008, 04:40 PM
Hi guys, I am in the process of making my insulting computer panel for K1 and I need some scripts but I'll leave the rest until later, what I need is a script that makes the panel explode and dissapear.

Edit: I have gotten to the scripting stage, what i need is:
A script that initiates the dialog and a script that transforms the pc into a Gizka for 30 seconds.

Thanks in advance ~DX

Stream
01-26-2008, 09:26 AM
To destroy the panel you'll need this script;


void main() {
ActionDoCommand(DestroyObject(GetObjectByTag("PANEL_TAG", 0), 1.0, 1, 0.0, 0));
}

If you enter the name of the dialog file into conversation field of the .utp, it will start when the PC selects it, you don't need a script to start the dialog unless you want it to happen automatically in which case you'll also need a trigger.

This script will make the PC look like a Gizka, although this is a permanent effect, I'm not sure how to make it last only 30 seconds but it will give you something to go by.


void main () {

object oPC = GetFirstPC();

ApplyEffectToObject(0, EffectDisguise(69), oPC);
}

--Stream

Darth Xander
01-26-2008, 10:03 AM
Ok the Gizka scritp works and the other one didn't but thats ok bos DDD kindly made me a new one.

I also need a script that turns the pc back into whatever he/she looked like before; or a script that reverses the gizka tranformation.

sekan
01-26-2008, 10:08 AM
I also need a script that turns the pc back into whatever he/she looked like before; or a script that reverses the gizka tranformation.

This script should work


void main() {
object oPC = GetFirstPC();

AssignCommand(oPC, ClearAllEffects());
}

Darth Xander
01-26-2008, 01:35 PM
Thanks sekan, also I am having problems with how to spawn the icp because I am having trouble getting the coordinates.

Stream
01-26-2008, 01:43 PM
Just press ` to bring up the console and type whereami, it will display the coordinates of the PC.

First cheats need to be enabled, open swkotor.ini in the main installation folder, and under the game options either edit or add EnableCheats=1

--Stream

Darth Xander
01-26-2008, 01:59 PM
Just press ` to bring up the console and type whereami, it will display the coordinates of the PC.

First cheats need to be enabled, open swkotor.ini in the main installation folder, and under the game options either edit or add EnableCheats=1

--Stream
I did that but the coords are extremley short when they should be a lot longer.

Stream
01-26-2008, 02:25 PM
I don't think it really matters, after a certain amount of digits it's just some really small changes that aren't very noticeable.

--Stream

Darth Xander
01-26-2008, 02:30 PM
Ok thanks.

Marius Fett
01-26-2008, 02:54 PM
The co-ords only appear long in K-GFF.

Darth Xander
01-27-2008, 06:29 AM
What if i put the coords into a spawn script, will the script work?

Marius Fett
01-27-2008, 06:38 AM
void main()
{
float x = x_co_here;
float y = y_co_here; float z = z_co_here;
float r = orientation_here;

vector vPla = Vector(x, y, z);
location lPla = Location(vPla, r);

object oPla = CreateObject(OBJECT_TYPE_PLACEABLE, "resref_here", lPla);
}
Replace x_co_here y_co_here and z_co_here with the X Y Z co-ordinates respectively.

And replace orientation_here with the orientation.

And obviously resref_here with the panels resref.

Darth Xander
01-28-2008, 04:38 PM
Ok guys, last few quesitons...I hope :XP:

First of all, which is the best dlg file to use to insert my script? bearing in mind that my icp is in the "Communications Room".

Second, could somebody provide a script that spawns an npc and a door at the same time plz?

Also before I may not have been clear by "Destroy Panel Script" I meant blows up and vanishes so may I have a script that does just that plz?

Thanks a lot for a lot for your help people i will credit you when it comes to distribution time XP
~DX

Stream
01-29-2008, 08:06 AM
To spawn and NPC & Door at the same time try this script


void main()
{

object oNPC = GetObjectByTag("NPC_TAG");
object oDoor = GetObjectByTag("DOOR_TAG");

if ((oNPC == OBJECT_INVALID) || (oDoor == OBJECT_INVALID))

CreateObject(OBJECT_TYPE_CHARACTER, "NPC_TAG", Location(Vector(x, y, z), 0.0));

CreateObject(OBJECT_TYPE_DOOR, "DOOR_TAG", Location(Vector(x, y, z), 0.0));
}

That may need tweaking as I haven't got any source files with me at the moment and I''ve done that from memory.

As for where to fire the script, it's best to choose a dialog that fires automatically.

Sorry I can't help with the destroying the panel as I haven't got nwscript here to look at.

--Stream

Darth Xander
01-30-2008, 02:21 PM
Well sorry Deadly Stream but that script does not work.

I was after a script that spawns an npc next to the pc and a door at a specific place.

EDIT: Forget the double script I found a way around that but thre are two scripts left I need.

1: A script to spawn a door at a specific lcoation and
2. A script that makes the panel "bashable" or make it blow up.

Marius Fett
01-30-2008, 03:13 PM
Isn't spawning a door the same as spawning a placeable?

If it is use this:

void main()
{
float x = X Coordinate;
float y = Y Coordinate; float z = Z Coordinate;
float r = Orientation;

vector vPla = Vector(x, y, z);
location lPla = Location(vPla, r);

object oPla = CreateObject(OBJECT_TYPE_PLACEABLE, "Template ResRef", lPla);
}

Just add the coordinates etc in as you go. :)

Stream
01-30-2008, 04:16 PM
No each kind of object is different so the game knows exactly what kind of object it's dealing with, here's the excerpt from nwscript;

int OBJECT_TYPE_CREATURE = 1;
int OBJECT_TYPE_ITEM = 2;
int OBJECT_TYPE_TRIGGER = 4;
int OBJECT_TYPE_DOOR = 8;
int OBJECT_TYPE_AREA_OF_EFFECT = 16;
int OBJECT_TYPE_WAYPOINT = 32;
int OBJECT_TYPE_PLACEABLE = 64;
int OBJECT_TYPE_STORE = 128;
int OBJECT_TYPE_ENCOUNTER = 256;
int OBJECT_TYPE_SOUND = 512;
int OBJECT_TYPE_ALL = 32767;

Have you made sure you entered the tag of the door and not the ResRef?

--Stream

Darth Xander
01-31-2008, 11:34 AM
Yes the tag and the resref are both the same.