Enemy insists on being friends

Have a really dumb question? Ask it here to get help from the experts (or those with too much time on their hands)

Moderator: Moderator

Message
Author
xnd
Archmage
Posts: 307
Joined: Sat Mar 21, 2015 7:33 pm

Re: Enemy insists on being friends

#16 Post by xnd »

well, I tried it here:

game.zone:addEntity(game.level, m, "actor", x, y)
game.level.map:particleEmitter(x, y, 1, "temporal_teleport")
game:playSoundNear(self, "talents/teleport")

self:setPersonalReaction(m, -100)

--self:setEffect(self.EFF_IMMINENT_PARADOX_CLONE, t.getDuration(self, t) + t.getModifier(self, t), {})
return true
end,
info = function(self, t)
local duration = t.getDuration(self, t)
return ([[You summon your future self to fight alongside you for %d turns. At some point in the future, you'll be pulled into the past to fight alongside your past self after the initial effect ends.
This spell splits the timeline. Attempting to use another spell that also splits the timeline while this effect is active will be unsuccessful.]]):format(duration)
end,



But that did nothing. It made a nil value error message but still brought the clone and the clone was still friendly.

error:

/engine/interface/ActorTalents.lua:148: in function </engine/interface/ActorTalents.lua:138>
Lua Error: /engine/interface/GameTargeting.lua:118: /engine/interface/ActorTalents.lua:148: /data-Chrono_Xorn/talents/Chrono_Xorn.lua:765: attempt to call method 'setPersonalReaction' (a nil value)
stack traceback:
/data-Chrono_Xorn/talents/Chrono_Xorn.lua:765: in function </data-Chrono_Xorn/talents/Chrono_Xorn.lua:703>
[C]: in function 'xpcall'
/engine/interface/ActorTalents.lua:145: in function </engine/interface/ActorTalents.lua:138>
At [C]:-1
At [C]:-1 error
At /engine/interface/GameTargeting.lua:118 fct
At /engine/interface/GameTargeting.lua:124 targetMode
At /engine/interface/GameTargeting.lua:253 targetMouse
At /mod/class/Game.lua:2113 fct
At /engine/Mouse.lua:56


--
edit: putting it up before the m:
also gives error but doesnt let clone summon at all.

HousePet
Perspiring Physicist
Posts: 6215
Joined: Sun Sep 09, 2012 7:43 am

Re: Enemy insists on being friends

#17 Post by HousePet »

Wait...
Who is summoning this creature and who is it supposed to be hostile to?
My feedback meter decays into coding. Give me feedback and I make mods.

xnd
Archmage
Posts: 307
Joined: Sat Mar 21, 2015 7:33 pm

Re: Enemy insists on being friends

#18 Post by xnd »

the pc self summons and it is hostile to the pc summoner. although, the idea was to have it show up every so often on its own.

i tried to get

name = "Anomaly Evil Twin",
type = {"chronomancy/anomalies", 1},

talent to work and had failed so went to the talent it refered to to try with that but am going to try the evil twin talent again.
it has
local m = makeParadoxClone(self, self, getAnomalyDuration(self, t)*2)
game.zone:addEntity(game.level, m, "actor", x, y)
m.faction = "enemies"
m.summoner = nil
m.target = self
checkAnomalyTriggers(self, self)
game.level.map:particleEmitter(x, y, 1, "generic_teleport", {rm=60, rM=130, gm=20, gM=110, bm=90, bM=130, am=70, aM=180})

m.target = self looks like it would set the added clone to target the pc who is defined as self, right?

--
edit:

yeah the problem with that talent is it turns this line

local m = makeParadoxClone(self, self, getAnomalyDuration(self, t)*2)

into nil value error for makeParadoxClone

HousePet
Perspiring Physicist
Posts: 6215
Joined: Sun Sep 09, 2012 7:43 am

Re: Enemy insists on being friends

#19 Post by HousePet »

Oh, m.summoner = self is probably override reactions. As your own summoned creatures cannot be hostile to you.
My feedback meter decays into coding. Give me feedback and I make mods.

xnd
Archmage
Posts: 307
Joined: Sat Mar 21, 2015 7:33 pm

Re: Enemy insists on being friends

#20 Post by xnd »

thats what I figured when i got offline last night and did

summoner = nil, summoner_gain_exp = false,

but i also did

ai_target = {actor=self},

m:attack(self)
m.target = self

at same time so wasn't sure which did it.

i seem to have fixed it. but i had looked in the summoner ai and didnt see what looked like it would force that. and even if it did, then the original code with friendly stuff in it may as well not have been there.

and i made it so i dont have to target, the clone just appears closest spot next to me. i got sent to Eidolon in like 2 or 3 turns lol killed each other at same time.

I saw a code like
auto_talents
in character save game from setting a talent to auto and I tried putting that in some places and even in the race like auto_talents = { with the talent but it didn't make it auto.

i saw a
hide = "always",
line and thought i would make it auto and hide it but it isnt working. any suggestions?

or do I turn
action = function (self, t)

into something like
passive = function (self, t)

...

HousePet
Perspiring Physicist
Posts: 6215
Joined: Sun Sep 09, 2012 7:43 am

Re: Enemy insists on being friends

#21 Post by HousePet »

Probably not a good idea to make it trigger from autouse.
If you want to get this talent to randomly summon an evil clone of yourself, you will need to change the action function into a callbackOnActBase function and change the talent mode to passive.
My feedback meter decays into coding. Give me feedback and I make mods.

Post Reply