PDA

View Full Version : script - make placeable exit


Vox Kalam
04-27-2007, 05:00 AM
almost done with one mod, just one last issue. How do you make a placeable exit? Specifically, make it blow up after a conversation?

stoffe
04-27-2007, 06:07 AM
almost done with one mod, just one last issue. How do you make a placeable exit? Specifically, make it blow up after a conversation?

You can deal damage to placeables like normal if they aren't Plot or Static-flagged. I think applying EffectDeath() will destroy it too.

If you just want to remove it you can use the DestroyObject() script command. For example:



void main() {
object oPlaceable = GetObjectByTag("MyPlaceableTag");
effect eBoom = EffectVisualEffect( VFX_FNF_GRENADE_FRAGMENTATION );

ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eBoom, GetLocation(oPlaceable));
DestroyObject(oPlaceable, 0.5, TRUE);
}


(MyPlaceableTag should be set to the tag of the placeable.)

Vox Kalam
04-27-2007, 06:28 AM
Thanks. Now I just encountered a glitch... grr... How come I set up a conversation for the placable, but every time the PC selects it, and trie to interact with it...nothing happens?

stoffe
04-27-2007, 06:35 AM
Thanks. Now I just encountered a glitch... grr... How come I set up a conversation for the placable, but every time the PC selects it, and trie to interact with it...nothing happens?

You'll need to put the name of a script file in the OnUsed event slot on the placeable that starts the conversation when the placeable is used. A simple script like this should work:


void main() {
ActionStartConversation(GetLastUsedBy());
}


That would start conversation with the one using the placeable using the DLG file set in the placeable template. Also make sure the placeable is not set as Static, and has the Usable and Party Interact checks set.

Vox Kalam
04-27-2007, 12:48 PM
Ktool won't let me compile the script, what do I have to add to it, exactly?

stoffe
04-27-2007, 12:52 PM
Ktool won't let me compile the script, what do I have to add to it, exactly?

Gah, typo... the opening { after the function name was missing. It's been fixed in the above post. :)

Vox Kalam
04-27-2007, 03:12 PM
ok, thanks
Last one, I promise. The script to equip an item that's in your inventory isn't compiling.

This is what I'm using:
[QUOTE]void main()
{
AssignCommand(GetFirstPC(), ActionEquipItem("g_w_lghtsbr01", 4);
}QUOTE]
It keeps saying syntax error at ";".
Unexpected, this is...and unfortunate.

tk102
04-27-2007, 05:27 PM
should be AssignCommand(GetFirstPC(), ActionEquipItem("g_w_lghtsbr01", 4)); missing an extra paranthesis at the end

Vox Kalam
04-27-2007, 07:30 PM
Error: Type mismatch in parameter 1 in call to "ActionEquipItem"
Error: Required argument missing in call to "AssignCommand"

Frrrrtshewith@!$#$...

tk102
04-27-2007, 08:34 PM
Ha, ha, oh sorry... it's a Friday.
If you already possess the item:
AssignCommand(GetFirstPC(), ActionEquipItem(GetItemPossessedBy(GetFirstPC(),"g_w_lghtsbr01"), 4));
if you need to spawn the item first...

AssignCommand(GetFirstPC(), ActionEquipItem(CreateItemOnObject("g_w_lghtsbr01",GetFirstPC()), 4));