• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.
Yes this is what I am talking about. If I now just had a scope that would let me scope to any character in the world, I would be able to replace the modifier mechanism I use in my targeting system. However, being able to inflict events on characters in a general vicinity deliberately will be enough for now I guess.


@Captain Gars Follow up question, when using this kinda events, the root would need to be the character who was the starter of the first event correct? I would not be able to use the flags to start an event randomly on the affected character some times later?
 
Yes this is what I am talking about. If I now just had a scope that would let me scope to any character in the world, I would be able to replace the modifier mechanism I use in my targeting system. However, being able to inflict events on characters in a general vicinity deliberately will be enough for now I guess.


@Captain Gars Follow up question, when using this kinda events, the root would need to be the character who was the starter of the first event correct? I would not be able to use the flags to start an event randomly on the affected character some times later?

Wouldn't the event targets system introduced last time around be a better way of doing what I think you want to do?
 
I do use it, but I need some way to store multiple targets, before calling them back into the event scoping to apply the effect. I have already written a working system, I just was hoping these flags would have options to let me do independent follow on event chains randomly firing from on_pulse events.
 
Yes this is what I am talking about. If I now just had a scope that would let me scope to any character in the world, I would be able to replace the modifier mechanism I use in my targeting system. However, being able to inflict events on characters in a general vicinity deliberately will be enough for now I guess.


@Captain Gars Follow up question, when using this kinda events, the root would need to be the character who was the starter of the first event correct? I would not be able to use the flags to start an event randomly on the affected character some times later?

I do use it, but I need some way to store multiple targets, before calling them back into the event scoping to apply the effect. I have already written a working system, I just was hoping these flags would have options to let me do independent follow on event chains randomly firing from on_pulse events.

I'm not sure I understand what it is you want to do. Post example code here with some pseudo-code filling in for what you think can't be done. That way it's easier to figure out if it's doable, or if it can be implemented.
 
Update:

- Added remove_guardian effect
- Added friend filter to targeted decisions
 
Last edited:
  • 2
Reactions:
Example:

Code:
# In start event
random_character = {
   set_character_flag = did_something_to_@ROOT
}

Code:
# In later event
random_character = {
   limit = {
     has_character_flag = did_something_to_@ROOT
   }
   ...
}
Just to clarify, each did_something_to_999 will be a unique flag, correct? So I couldn't do:
Code:
random_character = {
   limit = {
     has_character_flag = did_something_to_ # affect anybody who has the flag in relation to any other body
   }
   ...
}

- Added remove_guardian effect
Yay! I had a kludge for this, but it didn't work very well. :cool:
 
Just to clarify, each did_something_to_999 will be a unique flag, correct? So I couldn't do:
Code:
random_character = {
   limit = {
     has_character_flag = did_something_to_ # affect anybody who has the flag in relation to any other body
   }
   ...
}

I'm not sure what you mean by unique. If you're using my example above while playing character 999, the random character will get the flag did_something_to_999. Had you targeted more character instead of just one random, all of them would have gotten did_something_to_999.

Had you used this code, you as a character would have gotten a number of individual flags appended by the character ids of you courtiers:

Code:
any_courtier = {
   ROOT = {
     set_character_flag = has_courtier_@PREV
   }
}
 
I'm not sure what you mean by unique. If you're using my example above while playing character 999, the random character will get the flag did_something_to_999. Had you targeted more character instead of just one random, all of them would have gotten did_something_to_999.

Had you used this code, you as a character would have gotten a number of individual flags appended by the character ids of you courtiers:

Code:
any_courtier = {
   ROOT = {
     set_character_flag = has_courtier_@PREV
   }
}


Gars with this example, is there a way to scope to a particular courtier as the root, essentially, letting the flags become a replacement for empty opinion modifiers?


Can we use something like this,

Code:
ROOT = { 
  any_courtier = {
  limit = { has character_flag = has_courtier_*}
  }
 }

as a means to recall all the courtiers who were saved in the previous block of code?

Currently, I use two targeted decisions to save desired targets for an event, I have to save them using empty modifiers, with these new flags, can I replace this mechanism?
 
Code:
ROOT = {
   any_courtier = {
      limit = {
         ROOT = {
            has_character_flag = has_courtier_@PREV
         }
      }
   }
}
Really, this wasn't hard to figure out.
 
What I want to know is if using something like @root would work? and would it be possible to scope to all characters into the game and do a similar check?
 
Sure it would, but any check of all characters in the game is extremely CPU intensive.
 
I am aware of this, Hence my inqueries, I want to know if it is at all possible to use the id after the flag to recover the original root scope in a series of events. Currently, I get around the cpu implications by using a single targeted decision to save empty opinion modifiers on the root character. Then I have an event fire on the root character that converts those opinion modifiers into event scopes. All in all, it is a rather limited method and every time I increase the available targets, I need to add in even more redudancies to the code. Now, if there was an easier way to initiate events on anyone with the particular flag, and using the id appended to the flag as a scope, I would be able to achieve much the same with far less coding. Does this make sense?
 
Like the Captain said, post pseudocode of what you want to do so the Captain can determine if what you want is feasible to implement, rather than continuing posting vague ideas. My impression is, however, that it is not possible to extract the a portion of a flag to use as a scope with the current scripting language.
 
I'm not sure what you mean by unique. If you're using my example above while playing character 999, the random character will get the flag did_something_to_999. Had you targeted more character instead of just one random, all of them would have gotten did_something_to_999.

Had you used this code, you as a character would have gotten a number of individual flags appended by the character ids of you courtiers:

Code:
any_courtier = {
   ROOT = {
     set_character_flag = has_courtier_@PREV
   }
}
What I mean is, is it possible to have some events set character flags of the form some_flag_@ROOT (or other scope, that's not the important part), such that multiple people have the flag with multiple people's IDs, and then in some other trigger, be able to test if a character has *any* some_flag_<any ID>? Or is that something we're best sticking with the dummy opinion modifiers for?
 
No (if I'm understanding you right, but where is the pseudocode?), but what you can do is:
Code:
<scope> = {
   <some other scope> = {
      set_character_flag = some_flag
      set_character_flag = some_flag_@PREV
   }
}
Code:
trigger = {
   has_character_flag = some_flag
   <test if you can find any character to whom you have some_flag_@THEM>
Again, post pseudocode so we have a more concrete idea of what you want to be able to do. Setting/testing flags is cheap.
 
  • 1
Reactions:
issue is, I am not sure even how to represent the idea.

Essentially I am looking for a flag version of the reverse_opinion_modifier scope.

The other thing I am looking for is a way to just check the for the first bit of the flag.

So if the flag is someflag_@root
I want to be able to just check someflag.

Then use a reverse_dynamic_flag scope, to scope to the id of the flag applier.
 
Like I said to jursamaj, flags are cheap (take up only one bit, and are quick to test.) If you want to test a short version of the flag, set the short version of the flag in addition to the long version. As for reverse testing, just do some scope swapping to get to the right scope to be able to use @root/@PREV/@From etc. But really, if you can't come up with pseudocode you haven't thought it out well enough and ought to bring this to a separate thread so we aren't cluttering up the Captain's thread.
 
  • 3
  • 2
Reactions:
Rich there is my damned example! I want a command for flags akin to the reverse_opinion_modifier,

Consider the following tangental events.
Code:
character_event = {
id = 1
immediate = {
  location = {
   random_province_character ={
   set_character_flag = cursed
   set_character_flag = cursed_@root
  }
}
}


Character_event = {
id = 2
trigger = {
  has_character_flag = cursed
  }
immediate = {
  reverse_character_flag = {
   flag = cursed
   do other action
  } (with this scoping to any character whose id is appended to the flag)
}
}


Yes I can do this through empty opinion modifiers, but it would also require addition code to avoid fall through. If I can do it with the flag appending it becomes considerably more elegant.
 
Code:
character_event = {
   id = 1
      location = {
         random_province_character = {
            set_character_flag = cursed_someone
            set_character_flag = cursed_@root
            ROOT = {
               set_character_flag = cursed_by_someone
               set_character_flag = cursed_by_@PREV
            }
         }
      }
   }
}
character_event = {
   id = 2
   trigger = {
      has_character_flag = cursed_by_someone
   }
   immediate = {
      location = {
         random_province_character = {
            limit = {
               has_character_flag = cursed_@ROOT
            }
            do stuff
         }
      }
   }
}
 
  • 1
Reactions: