http://paste.neurohack.com/view/YyT4k/
Hello,
i am trying to make a device that temporarily makes you neutral to everyone, but the temporary part is the problem - i cant seem to get the device to revert back to the old faction standings.
help would be appreciated.
saving soveriegn dispositions
-
- Fleet Officer
- Posts: 1533
- Joined: Tue Mar 22, 2011 8:43 pm
- Location: Alaska
- Contact:
that is actually too technical for my tiny self: I would have done it simpler .
there is almost always a simple way to do it: cheap but effective.
there is almost always a simple way to do it: cheap but effective.
Last edited by shanejfilomena on Fri Jul 22, 2011 5:33 pm, edited 1 time in total.
Flying Irresponsibly In Eridani......
I don't like to kill pirates in cold blood ..I do it.. but I don't like it..
I don't like to kill pirates in cold blood ..I do it.. but I don't like it..
- alterecco
- Fleet Officer
- Posts: 1658
- Joined: Wed Jan 14, 2009 3:08 am
- Location: Previously enslaved by the Iocrym
You would need to go through all the sovereigns you are changing and get their initial disposition towards the player. Use sovGetDisposition for this.
I would recommend that you do not hardcode any of the sovereigns (to work with mods). Here some functions that might work for you, that loop over all sovereigns, stores their initial disposition and neutralizes their disposition towards the player and the reverse.
I would recommend that you do not hardcode any of the sovereigns (to work with mods). Here some functions that might work for you, that loop over all sovereigns, stores their initial disposition and neutralizes their disposition towards the player and the reverse.
Code: Select all
(setq neutralizeSovereigns (lambda nil
(block nil
;; loop over all sovereigns
(enum (typFind "v") sov
(block nil
;; save initial disposition on the type
(typSetGlobalData sov "InitialDisposition" (sovGetDisposition sov &svPlayer;))
;; neutralize sov
(sovSetDisposition sov &svPlayer; "neutral")
)
)
)
))
(setq resetSovereigns (lambda nil
(block nil
;; loop over all sovereigns
(enum (typFind "v") sov
(block (disp)
(if (setq disp (typGetGlobalData sov "InitialDisposition"))
;; reset disposition
(sovSetDisposition sov &svPlayer; disp)
)
)
)
)
))