Jump to content

Home

script - make placeable exit


Vox Kalam

Recommended Posts

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("[color=Yellow]MyPlaceableTag[/color]");
   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.)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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:

void main()

{

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

}QUOTE]

It keeps saying syntax error at ";".

Unexpected, this is...and unfortunate.

Link to comment
Share on other sites

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));

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...