674341aa845b0

674341aa859f9
1 Guest is here.
 

Topic: Tweq Question Read 1782 times  

674341aa85cdeYankee Clipper

674341aa85d41
Isn't there a way to use one of the tweq properties to convert an object from one thing to another via DML? I have a grenade launcher that secretly wants to be a fusion cannon.

674341aa86015voodoo47

674341aa86063
I'm not aware of a specific (tweq, or other) prop that would destroy the orig item and spawn a different item in its place upon activation (actually slay object and fliderize whatever is needed from its corpse), so I would just take the orig item, remove physics, set it to not rendered, move it up a notch or two, convert it into an emitter trap (make sure to set it to NOT inherit scripts), and use it to spawn the desired item upon sim (or any other suitable event, but make sure it can fire only once).

similar setup is used in the ss2tool dml fixes to spawn a hazard suit for newbie use in botm;
Code: [Select]
//lets use one of those redundant ambients to spawn a vacc suit
ObjProp 1450 "Position"
{
"Location" 118, -108, 5.55
}
+ObjProp 1450 "Scripts"
{
"Script 0" TrapTweq
}
+ObjProp 1450 "CfgTweqEmit"
{
"Halt" Stop Tweq
"AnimC" Sim
"Rate" 1000
"Max frames" 1
"Emit what" Vacc Suit
}
+ObjProp 706 "Scripts"
{
"Script 0" TriggerDestroy
}
+Link 706 1450 "SwitchLink"
{
}
+ObjProp 1450 "DiffPermit"
{
"quest var values" 1, 2
}

it's spawned when the player destroys the first membrane (at that point, I didn't want to mess around with sim activation or similar).


//just resolved a similar problem in T1, here is the dml;
Code: [Select]
//the broken zombie cannot be fixed, so lets turn him into an emitter and spawn another zombie
-ObjProp 855 "PhysType"
ObjProp 855 "Position"
{
    "Location" 19.3684, -93.0408, 31.98
}
+ObjProp 855 "Scripts"
{
    "Script 0" TrapTweqEmit
    "Script 1" ""
    "Script 2" ""
    "Script 3" ""
    "Don't Inherit" true
}
+ObjProp 855 "CfgTweqEmit"
{
    "Halt" Destroy Obj
    "Rate" 1
    "Max frames" 1
    "Emit what" Zombie
}
+ObjProp 855 "StTweqEmit"
{
"AnimS" On
}

this basically moves the orig obj up (there needs to be enough space or the new object will not be spawned), spawns the new object, and destroys the emitting object - pretty much exactly what you want.
« Last Edit: 01. February 2018, 18:38:01 by voodoo47 »

674341aa8610cYankee Clipper

674341aa86155
Beautiful!

Just for giggles I tried it (zombie method) without the repositioning, and it still worked.

674341aa861dcvoodoo47

674341aa86224
it will work as long as there is enough space.

674341aa862advoodoo47

674341aa862f5
necromancy - seems like adding the TrapTweqEmit script is actually not required.
« Last Edit: 05. January 2017, 19:12:07 by voodoo47 »
1 Guest is here.
const CFeeling& feel, // The feeling used to evaluate the action.
Contact SMF 2.0.19 | SMF © 2016, Simple Machines | Terms and Policies
FEEP
674341aa86c07