I want to make a combat dummy who can only be attacked with ranged weapons for story purposes.
I created a placeable, set it the Combat Dummy appearance and changed its variable 2da to var_placeable_react (so when destroyed it can set a flag in a plot).
For some reason, I can't find something I could use in its properties to tell it to NOT be a container (right-clicking it ingame tries to loot stuff, although there is nothing on him). Anyone knows? It would certainly be useful for creating a bunch of breakable placeables in my module.
Also, I want to ensure it can only be destroyed with arrows, else it defeats the purpose of said dummy since it's an archery competition. How can I control what damage type works and what it's immune to?
Make a custom placeable
Débuté par
wyvern14
, déc. 19 2009 09:19
#1
Posté 19 décembre 2009 - 09:19
#2
Posté 19 décembre 2009 - 09:34
Well, I overrode the placeable 2DA and made a line for a new combat dummy so it's attackable, but it doesnt play the destroy animation.
I have no idea how to make it immune to stuff and trigger a comment from a nearby NPC (lie "hey, no magic, this is an archery contest!)
I have no idea how to make it immune to stuff and trigger a comment from a nearby NPC (lie "hey, no magic, this is an archery contest!)
#3
Posté 19 décembre 2009 - 09:37
You should read the wiki - look for the tutorial about creating a placeable from a model. You need to change the StateController.
#4
Posté 19 décembre 2009 - 11:19
I did, StateController is now StateCnt_Static, so it's attackable. It's using the combat dummy placeable, so I didn't have to do the model gimmick.
My concern is about the type of damage that works or not, and recognize damage type done to it to create reactions. I'll try to make a custom placeable_core, see if I can cook something cool.
My concern is about the type of damage that works or not, and recognize damage type done to it to create reactions. I'll try to make a custom placeable_core, see if I can cook something cool.
#5
Posté 20 décembre 2009 - 03:18
Extensive testing - magic doesn't affect my dummy so I'm safe on that count. Just need to prevent people from punching it to death.
Ok I tried to modify my plot and plot script with a defined flag on if crossbow is equipped (called CROSSBOW_ON). I ammended my plot script like this:
<i>
#include "log_h"
#include "utility_h"
#include "wrappers_h"
#include "plot_h"
#include "plt_wh_fest_archery"
int StartingConditional()
{
event eParms = GetCurrentEvent();
int nType = GetEventType(eParms);
string strPlot = GetEventString(eParms, 0);
int nFlag = GetEventInteger(eParms, 1);
object oParty = GetEventCreator(eParms);
object oConversationOwner = GetEventObject(eParms, 0);
int nResult = FALSE;
object oPC = GetHero();
plot_GlobalPlotHandler(eParms);
if(nType == EVENT_TYPE_SET_PLOT)
{
int nValue = GetEventInteger(eParms, 2);
int nOldValue = GetEventInteger(eParms, 3);
switch(nFlag)
{
case QUEST_ACCEPTED:
{
object oBarrel = GetObjectByTag("crossbow_barrel");
object oDummy = GetObjectByTag("archery_dummy_valid");
SetObjectInteractive(oBarrel, TRUE);
SetObjectInteractive(oDummy, TRUE);
PrintToLog("barrel and dummy interactive");
break;
}
case CROSSBOW_ON:
{
object oDummy = GetObjectByTag("archery_dummy_valid");
SetPlot(oDummy, FALSE);
break;
}
}
}
else // EVENT_TYPE_GET_PLOT -> defined conditions only
{
switch(nFlag)
{
case CROSSBOW_ON:
{
object oBow = GetObjectByTag("archery_crossbow");
if (GetItemInEquipSlot(0,oPC,1) == oBow)
nResult = TRUE;
break;
}
case TARGET_KILLED:
{
object oDummy = GetObjectByTag("archery_dummy_valid");
if(GetHealth(oDummy) == 0)
nResult = TRUE;
break;
}
}
}
plot_OutputDefinedFlag(eParms, nResult);
return nResult;
}</i>
Overall, I want my flag to toggle on/off if the crossbow is equipped. If the flag is off, I want the dummy to have plot on, if the crossbow is equipped, I want plot to be off so we can damage it. Right now, all I'm getting ingame is an interactive dummy with plot always true.
Ok I tried to modify my plot and plot script with a defined flag on if crossbow is equipped (called CROSSBOW_ON). I ammended my plot script like this:
<i>
#include "log_h"
#include "utility_h"
#include "wrappers_h"
#include "plot_h"
#include "plt_wh_fest_archery"
int StartingConditional()
{
event eParms = GetCurrentEvent();
int nType = GetEventType(eParms);
string strPlot = GetEventString(eParms, 0);
int nFlag = GetEventInteger(eParms, 1);
object oParty = GetEventCreator(eParms);
object oConversationOwner = GetEventObject(eParms, 0);
int nResult = FALSE;
object oPC = GetHero();
plot_GlobalPlotHandler(eParms);
if(nType == EVENT_TYPE_SET_PLOT)
{
int nValue = GetEventInteger(eParms, 2);
int nOldValue = GetEventInteger(eParms, 3);
switch(nFlag)
{
case QUEST_ACCEPTED:
{
object oBarrel = GetObjectByTag("crossbow_barrel");
object oDummy = GetObjectByTag("archery_dummy_valid");
SetObjectInteractive(oBarrel, TRUE);
SetObjectInteractive(oDummy, TRUE);
PrintToLog("barrel and dummy interactive");
break;
}
case CROSSBOW_ON:
{
object oDummy = GetObjectByTag("archery_dummy_valid");
SetPlot(oDummy, FALSE);
break;
}
}
}
else // EVENT_TYPE_GET_PLOT -> defined conditions only
{
switch(nFlag)
{
case CROSSBOW_ON:
{
object oBow = GetObjectByTag("archery_crossbow");
if (GetItemInEquipSlot(0,oPC,1) == oBow)
nResult = TRUE;
break;
}
case TARGET_KILLED:
{
object oDummy = GetObjectByTag("archery_dummy_valid");
if(GetHealth(oDummy) == 0)
nResult = TRUE;
break;
}
}
}
plot_OutputDefinedFlag(eParms, nResult);
return nResult;
}</i>
Overall, I want my flag to toggle on/off if the crossbow is equipped. If the flag is off, I want the dummy to have plot on, if the crossbow is equipped, I want plot to be off so we can damage it. Right now, all I'm getting ingame is an interactive dummy with plot always true.
#6
Posté 22 décembre 2009 - 11:44
Ok I did a lot of workarounds and I have the effect I want:
- can't melee the dummy (a trigger around it sets plot to true on the dummy if entered and pops a message about "This is an ARCHERY competition, not a fist fight")
- custom destroy animation and some override magic for sounds, goes attackable when I tell it to, np
BUT
It won't recognize being destroyed and set a plot flag accordingly, so we're forever stuck in practice mode. Basically, what I did is assign it to Team 100, and in my area core, I wrote the following:
case EVENT_TYPE_TEAM_DESTROYED:
{
if(GetEventInteger(ev,0) == 100)
{
WR_SetPlotFlag(PLT_WH_FEST_ARCHERY, PRACTICE_COMPLETED, TRUE);
}
if(GetEventInteger(ev,0) == 75)
{
WR_SetPlotFlag(PLT_WH_FEST_ARCHERY, CHALLENGE_COMPLETED, TRUE);
}
break;
}
It compiles fine and I don't see anything wrong, but perhaps I'm refering to the team # wrong?
Team 75 refers to a bunch of empty bottles I want to get destroyed for the next part. My plot is indeed wh_fest_archery. I initially used the variables with a var_placeable_react but it didn't do squat (unless I read this wrong, but it's plot name as is in PLC_REACT_DESTROY_SET_PLOT and the flag # in PLC_REACT_DESTROY_SET_FLAG).
Can we not use teams to track placeable destruction?
- can't melee the dummy (a trigger around it sets plot to true on the dummy if entered and pops a message about "This is an ARCHERY competition, not a fist fight")
- custom destroy animation and some override magic for sounds, goes attackable when I tell it to, np
BUT
It won't recognize being destroyed and set a plot flag accordingly, so we're forever stuck in practice mode. Basically, what I did is assign it to Team 100, and in my area core, I wrote the following:
case EVENT_TYPE_TEAM_DESTROYED:
{
if(GetEventInteger(ev,0) == 100)
{
WR_SetPlotFlag(PLT_WH_FEST_ARCHERY, PRACTICE_COMPLETED, TRUE);
}
if(GetEventInteger(ev,0) == 75)
{
WR_SetPlotFlag(PLT_WH_FEST_ARCHERY, CHALLENGE_COMPLETED, TRUE);
}
break;
}
It compiles fine and I don't see anything wrong, but perhaps I'm refering to the team # wrong?
Team 75 refers to a bunch of empty bottles I want to get destroyed for the next part. My plot is indeed wh_fest_archery. I initially used the variables with a var_placeable_react but it didn't do squat (unless I read this wrong, but it's plot name as is in PLC_REACT_DESTROY_SET_PLOT and the flag # in PLC_REACT_DESTROY_SET_FLAG).
Can we not use teams to track placeable destruction?
Modifié par wyvern14, 22 décembre 2009 - 11:48 .





Retour en haut






