Hello, I have a quick question. If a script is run from a trigger and causes damage to an entering character, the feedback says 'something' damaged the character. Is there a way to cause the ApplyEffectToObject call to report the damage as coming from a named source, such as 'the raging fire'?
Hmm, now that I think about it some more, perhaps if the damage comes from a hidden placeable or creature, the engine would use that name?
Thank you.
'Something' caused damage?
Débuté par
rjshae
, juil. 07 2011 02:58
#1
Posté 07 juillet 2011 - 02:58
#2
Posté 07 juillet 2011 - 05:01
Basically, whatever object running the script deals the damage, so all you have to do is use ExecuteScript to run a damage script from another object, like a placeable or I-point. I think there might be a more elegant way of doing it, using some function to modify the damage effect, but I'm not sure.
#3
Posté 07 juillet 2011 - 05:29
A very simple way would be to have the script send a text message to the player saying "a raging fire caused you damage". While it wouldn't get rid of the "something", it would inform the player. You could also give the trigger a name, not just have a generic trigger (blank name by default?).
#4
Posté 07 juillet 2011 - 10:36
You can use a placeable with the required name, and use the AssignCommand function to assign the damage-dealing effect to it within the trigger's script. Then the damage will register as having come from the named placeable instead of 'someone'.
The placeable doesn't need to be usable (so it won't highlight with the Z key), although I don't think it can be static. So basically, uncheck both the 'Usable' and 'Static' fields. Put it somewhere where the player can't walk right through it though.
You can also try using an Ipoint with the correct name, although I'm not sure whether the game engine considers them viable damage-dealing entities. You can always experiment. The advantage of the Ipoint is that it won't show up at all in the game, so there's no need to camouflage it.
The placeable doesn't need to be usable (so it won't highlight with the Z key), although I don't think it can be static. So basically, uncheck both the 'Usable' and 'Static' fields. Put it somewhere where the player can't walk right through it though.
You can also try using an Ipoint with the correct name, although I'm not sure whether the game engine considers them viable damage-dealing entities. You can always experiment. The advantage of the Ipoint is that it won't show up at all in the game, so there's no need to camouflage it.
#5
Posté 08 juillet 2011 - 07:36
Thanks for the suggestions. I'll try running a few experiments to see what works...
#6
Posté 11 juillet 2011 - 01:04
I tried the approach of using the Ipoint, with the On Enter script creating the placeable at the location of the entering object (or somewhere nearby). Unfortunately, the engine would not create a valid object so I can't get the Ipoint to run ExecuteScript. I'm not sure why the CreateObject is failing. It works okay if I create a normal placeable, but that looks odd.
#7
Posté 11 juillet 2011 - 01:36
The i-point blueprint has an extra space at the end.
#8
Posté 11 juillet 2011 - 01:49
Lugaid of the Red Stripes wrote...
The i-point blueprint has an extra space at the end.
... at the end of it's tag. Its "invisible" so you can't know its there. Somebody made a typo when they were creating the game here.
#9
Posté 13 juillet 2011 - 10:09
Ah! Thanks.
#10
Posté 14 juillet 2011 - 04:06
_Knightmare_ wrote...
Lugaid of the Red Stripes wrote...
The i-point blueprint has an extra space at the end.
... at the end of it's tag. Its "invisible" so you can't know its there. Somebody made a typo when they were creating the game here.
Yup, that worked like a charm. I have the trigger damage coming from the Ipoint now, and the damage feedback uses the name I assigned. Thanks.





Retour en haut







