Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

script - make placeable exit

Page: 1 of 1
 Vox Kalam
04-27-2007, 5:00 AM
#1
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, 6:07 AM
#2
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, 6:28 AM
#3
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, 6:35 AM
#4
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
#5
Ktool won't let me compile the script, what do I have to add to it, exactly?
 stoffe
04-27-2007, 12:52 PM
#6
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, 3:12 PM
#7
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, 5:27 PM
#8
should be AssignCommand(GetFirstPC(), ActionEquipItem("g_w_lghtsbr01", 4)); missing an extra paranthesis at the end
 Vox Kalam
04-27-2007, 7:30 PM
#9
Error: Type mismatch in parameter 1 in call to "ActionEquipItem"
Error: Required argument missing in call to "AssignCommand"

Frrrrtshewith@!$#$...
 tk102
04-27-2007, 8:34 PM
#10
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));
Page: 1 of 1