Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed (Author was flagged for spam)

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

23
[Modding] Using the "If" scope correctly?
Post Flair (click to view more posts with a particular flair)
Author Summary
GTAIVisbest is in Modding
Post Body

Hello everyone,

So I'm trying to make an event with an "if" chain. Something like this:

  • One button in an event will bring up 1 of 4 different events, depending on conditions. To do this I will use the "if" scope.

I know for a FACT that you can use "if" commands in March of the Eagles, because some of the vanilla events for march of the eagles have it. However, each time I try to use it, and I click that button, the game will bring up EACH of the 4 events, regardless of what conditions are true.

My event:

country_event = {
    id = 5110
    title = "EVT_MIL_"TITLE"
    desc = "EVT_MIL_DESC"

    is_triggered_only = yes

    #Return to previous menu
    option = {
        name = "EVTRETURN"
    }

    #Mobilization
    option = {
        name = "EVT_MOBILIZATION"
        #You're insurgency so not available
        if = {
            limit = {
                government = insurgency
            }
            country_event = 5111 #Not available, sorry
        }

        #Eligible but not at war
        if = {
            limit = {
                AND = {
                    NOT = { government = insurgency }
                    war = no
                }
            }
            country_event = 5112 # You need to be at war
        }

        #You're already mobilized
        if = {
            limit = {
                AND = {
                    NOT = { government = insurgency }
                    war = yes
                    has_country_modifier = mobilize_modifier
                }
            }
            country_event = 5113
        }

        #At war, not yet mobilized, you can mobilize
        if = {
            limit = {
                AND = {
                    NOT = { government = insurgency }
                    war = yes
                    NOT = { has_country_modifier = mobilize_modifier }
                }
            }
            country_event = 5114  
        }
    }
}

Vanilla event:

option = {
    name = "EVTOPT_OK"
    if = {
        limit = {
            exists = POL
            alliance_with = POL
        }
        POL = {
            manpower = 0.015
        }
    }
    if = {
        limit = {
            NOT = {
                exists = POL
            }
            NOT = {
                alliance_with = POL
            }
        }
        prestige = 5
    }
}

to summarize:

Vanilla events seem to have "if" structures set up correctly. When I try using the event and firing it in my mod, the game ignores the "if" and "limit" and "conditions" and just launches all my commands, in this case, 4 events. Instead of only 1 event being launched depending on the correct conditions, all 4 are launched.

Any experienced modders that could help a yung modder out here?

Author
Account Strength
0%
Account Age
13 years
Verified Email
Yes
Verified Flair
No
Total Karma
97,708
Link Karma
26,710
Comment Karma
69,365
Profile updated: 8 months ago
Posts updated: 9 months ago

Subreddit

Post Details

Location
We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
7 years ago