Jump to content

using if, else_if, else


joemann

Recommended Posts

Validator returns two types  errors for the following code :

 

if, else_if and else are invalid nodes.

 

certain narrative events are set be triggered but are never called.

 

What does this mean?

 

the code is as follows:

( narrative event .230 does pop up, but does not fire the follow-up events)

 

# .230 Disciplining Spouse, Lover or Concubine - player is male, lover is female
narrative_event = {
    id = RSLVisits.230
    desc = "RSLVisits230"
    picture = discipline_spouse_01
    title = rsl_disciplining_spouse
    
    is_triggered_only = yes # Triggered from .2
    
    if = {                     # She seems to like it
        limit = {
                is_submissive = yes

        }
        random_list = {
            70 = { ##accepts punishment        
            event_target:rsl_visit_target = { add_character_modifier = { name = rsl_sore_bottom duration = 30 }}
            event_target:rsl_visit_target = {character_event = { id = RSLVisits.9200 }} ## spank bottom
        
            }
            30 = { ## loves punishment
            event_target:rsl_visit_target = { add_character_modifier = { name = rsl_sore_bottom duration = 30 }}
            event_target:rsl_visit_target = { add_character_modifier = { name = rsl_good_sex duration = 30 }}
            event_target:rsl_visit_target = { character_event = { id = RSLVisits.9201 }} ## play with bottom make her come
            add_trait = submissive
            }

        }
    }
    else_if = {
        limit = {
                is_submissive = no   ## only works for those cases where the spouse has other traits than those listed for submissive or dominant
                is_dominant = no

            }
            event_target:rsl_visit_target = { add_character_modifier = { name = rsl_sore_bottom duration = 30 }}
            event_target:rsl_visit_target = { character_event = { id = RSLVisits.9200 }} ## spank bottom

        }
    else = {
        limit = {
                is_dominant = yes

        }
        random_list = {
            70 = { ##accepts punishment        
            event_target:rsl_visit_target = { add_character_modifier = { name = rsl_sore_bottom duration = 30 }}
            event_target:rsl_visit_target = { character_event = { id = RSLVisits.9200 }} ## spank bottom
        
            }
            30 = { ## resists punishment
            event_target:rsl_visit_target = { add_character_modifier = { name = rsl_sore_bottom duration = 60 }}
            event_target:rsl_visit_target = { character_event = { id = RSLVisits.9202 }} ## cane her bottom make her scream
            
            

                }        
        
            }
        }    
        option = {
                    name = rsl_option1
    }
}

## A well spanked bottom will teach her
narrative_event = {
    id = RSLVisits.9200
    desc = "RSLVisits9200"
    picture = discipline_spouse_02
    title = rsl_disciplining_spouse1
    
    is_triggered_only = yes # by event .230
    
    option = {
                name = rsl_option1
    }

}

Link to comment
12 minutes ago, joemann said:

Validator returns two types  errors for the following code :

 

if, else_if and else are invalid nodes.

 

certain narrative events are set be triggered but are never called.

 

What does this mean?

 

the code is as follows:

( narrative event .230 does pop up, but does not fire the follow-up events)

 

# .230 Disciplining Spouse, Lover or Concubine - player is male, lover is female
narrative_event = {
    id = RSLVisits.230
    desc = "RSLVisits230"
    picture = discipline_spouse_01
    title = rsl_disciplining_spouse
    
    is_triggered_only = yes # Triggered from .2
    
    if = {                     # She seems to like it
        limit = {
                is_submissive = yes

        }
        random_list = {
            70 = { ##accepts punishment        
            event_target:rsl_visit_target = { add_character_modifier = { name = rsl_sore_bottom duration = 30 }}
            event_target:rsl_visit_target = {character_event = { id = RSLVisits.9200 }} ## spank bottom
        
            }
            30 = { ## loves punishment
            event_target:rsl_visit_target = { add_character_modifier = { name = rsl_sore_bottom duration = 30 }}
            event_target:rsl_visit_target = { add_character_modifier = { name = rsl_good_sex duration = 30 }}
            event_target:rsl_visit_target = { character_event = { id = RSLVisits.9201 }} ## play with bottom make her come
            add_trait = submissive
            }

        }
    }
    else_if = {
        limit = {
                is_submissive = no   ## only works for those cases where the spouse has other traits than those listed for submissive or dominant
                is_dominant = no

            }
            event_target:rsl_visit_target = { add_character_modifier = { name = rsl_sore_bottom duration = 30 }}
            event_target:rsl_visit_target = { character_event = { id = RSLVisits.9200 }} ## spank bottom

        }
    else = {
        limit = {
                is_dominant = yes

        }
        random_list = {
            70 = { ##accepts punishment        
            event_target:rsl_visit_target = { add_character_modifier = { name = rsl_sore_bottom duration = 30 }}
            event_target:rsl_visit_target = { character_event = { id = RSLVisits.9200 }} ## spank bottom
        
            }
            30 = { ## resists punishment
            event_target:rsl_visit_target = { add_character_modifier = { name = rsl_sore_bottom duration = 60 }}
            event_target:rsl_visit_target = { character_event = { id = RSLVisits.9202 }} ## cane her bottom make her scream
            
            

                }        
        
            }
        }    
        option = {
                    name = rsl_option1
    }
}

## A well spanked bottom will teach her
narrative_event = {
    id = RSLVisits.9200
    desc = "RSLVisits9200"
    picture = discipline_spouse_02
    title = rsl_disciplining_spouse1
    
    is_triggered_only = yes # by event .230
    
    option = {
                name = rsl_option1
    }

}

Start by wrapping your if...else_if...else stuff into an "immediate = {}"  That should solve most of it.  Also, make sure your "option" is on its own, not a part of the "immediate" block.

Link to comment

Did this. It solves the trigger problem but else_if and else are still deemed invalid.

 

I wrote it as follows:

is_triggered_only = yes # Triggered from .2
    immediate = {
            if = {                     # She seems to like it
                limit = {
                    is_submissive = yes

                }
                random_list = {
                    70 = { ##accepts punishment        
                    event_target:rsl_visit_target = { add_character_modifier = { name = rsl_sore_bottom duration = 30 }}
                    event_target:rsl_visit_target = {character_event = { id = RSLVisits.9200 }} ## spank bottom
        
                    }
                    30 = { ## loves punishment
                    event_target:rsl_visit_target = { add_character_modifier = { name = rsl_sore_bottom duration = 30 }}
                    event_target:rsl_visit_target = { add_character_modifier = { name = rsl_good_sex duration = 30 }}
                    event_target:rsl_visit_target = { character_event = { id = RSLVisits.9201 }} ## play with bottom make her come
                    add_trait = submissive
                    }

                }
            }
            else_if = {
                limit = {
                        is_submissive = no   ## only works for those cases where the spouse has other traits than those listed for submissive or dominant
                        is_dominant = no

                    }
                    event_target:rsl_visit_target = { add_character_modifier = { name = rsl_sore_bottom duration = 30 }}
                    event_target:rsl_visit_target = { character_event = { id = RSLVisits.9200 }} ## spank bottom

            }
            else = {
                limit = {
                        is_dominant = yes

                }
                random_list = {
                    70 = { ##accepts punishment        
                    event_target:rsl_visit_target = { add_character_modifier = { name = rsl_sore_bottom duration = 30 }}
                    event_target:rsl_visit_target = { character_event = { id = RSLVisits.9200 }} ## spank bottom
        
                    }
                    30 = { ## resists punishment
                    event_target:rsl_visit_target = { add_character_modifier = { name = rsl_sore_bottom duration = 60 }}
                    event_target:rsl_visit_target = { character_event = { id = RSLVisits.9202 }} ## cane her bottom make her scream
            
            

                        }                
                    }
                }
            }    
                option = {
                            name = rsl_option1
                }
}

 

Link to comment

 Tri

is_triggered_only = yes # Triggered from .2
    immediate = {
            if = {                     # She seems to like it
                limit = {
                    is_submissive = yes

                }
                random_list = {
                    70 = { ##accepts punishment        
                    event_target:rsl_visit_target = { add_character_modifier = { name = rsl_sore_bottom duration = 30 }}
                    event_target:rsl_visit_target = {character_event = { id = RSLVisits.9200 }} ## spank bottom
        
                    }
                    30 = { ## loves punishment
                    event_target:rsl_visit_target = { add_character_modifier = { name = rsl_sore_bottom duration = 30 }}
                    event_target:rsl_visit_target = { add_character_modifier = { name = rsl_good_sex duration = 30 }}
                    event_target:rsl_visit_target = { character_event = { id = RSLVisits.9201 }} ## play with bottom make her come
                    add_trait = submissive
                    }

                }
            }
            else_if = {
                limit = {
                        is_submissive = no   ## only works for those cases where the spouse has other traits than those listed for submissive or dominant
                        is_dominant = no

                    }
                    event_target:rsl_visit_target = { add_character_modifier = { name = rsl_sore_bottom duration = 30 }}
                    event_target:rsl_visit_target = { character_event = { id = RSLVisits.9200 }} ## spank bottom

            }
            else = {
                limit = {
                        is_dominant = yes

                }
                random_list = {
                    70 = { ##accepts punishment        
                    event_target:rsl_visit_target = { add_character_modifier = { name = rsl_sore_bottom duration = 30 }}
                    event_target:rsl_visit_target = { character_event = { id = RSLVisits.9200 }} ## spank bottom
        
                    }
                    30 = { ## resists punishment
                    event_target:rsl_visit_target = { add_character_modifier = { name = rsl_sore_bottom duration = 60 }}
                    event_target:rsl_visit_target = { character_event = { id = RSLVisits.9202 }} ## cane her bottom make her scream
            
            

                        }                
                    }
                }
            }    
                option = {
                            name = rsl_option1
                }
}

ed both

Link to comment

Latest attempt  follows what the wiki says about else_if command. Still not working. Validator  still saying

 


"At <mod>\events\RSLVisits.txt [narrative_event\immediate\else_if] (Line 292, column 4):
Invalid node "else_if" in scope CharCommand (value is: <a complex type>)"

 

I'll come back to it tomorrow. Thanks for your help!

 

# .230 Disciplining Spouse, Lover or Concubine - player is male, lover is female
narrative_event = {
    id = RSLVisits.230
    desc = "RSLVisits230"
    picture = discipline_spouse_01
    title = rsl_disciplining_spouse
    
    is_triggered_only = yes # Triggered from .2
    immediate = {
            if = {                     # She seems to like it
                limit = {
                    is_submissive = yes

                }
                random_list = {
                    70 = { ##accepts punishment        
                    event_target:rsl_visit_target = { add_character_modifier = { name = rsl_sore_bottom duration = 30 }}
                    event_target:rsl_visit_target = { narrative_event = { id = RSLVisits.9200 }} ## spank bottom
        
                    }
                    30 = { ## loves punishment
                    event_target:rsl_visit_target = { add_character_modifier = { name = rsl_sore_bottom duration = 30 }}
                    event_target:rsl_visit_target = { add_character_modifier = { name = rsl_good_sex duration = 30 }}
                    event_target:rsl_visit_target = { narrative_event = { id = RSLVisits.9201 }} ## play with bottom make her come
                    add_trait = submissive
                    }

                }
            }
            else_if = {
                    limit = {
                        is_submissive = no   ## only works for those cases where the spouse has other traits than those listed for submissive or dominant
                        is_dominant = no

                    }
                    event_target:rsl_visit_target = { add_character_modifier = { name = rsl_sore_bottom duration = 30 }}
                    event_target:rsl_visit_target = { narrative_event = { id = RSLVisits.9200 }} ## spank bottom

            }
            else_if = {
                limit = {
                        is_dominant = yes

                }
                random_list = {
                    70 = { ##accepts punishment        
                    event_target:rsl_visit_target = { add_character_modifier = { name = rsl_sore_bottom duration = 30 }}
                    event_target:rsl_visit_target = { narrative_event = { id = RSLVisits.9200 }} ## spank bottom
        
                    }
                    30 = { ## resists punishment
                    event_target:rsl_visit_target = { add_character_modifier = { name = rsl_sore_bottom duration = 60 }}
                    event_target:rsl_visit_target = { narrative_event = { id = RSLVisits.9202 }} ## cane her bottom make her scream
                    }
                }
            
            }
            else = {
                    event_target:rsl_visit_target = { add_character_modifier = { name = rsl_sore_bottom duration = 30 }}  ## if none of the conditions apply we go to default mode
                    event_target:rsl_visit_target = { narrative_event = { id = RSLVisits.9200 }} ## spank bottom
                                                            
            }
    }    
        option = {
                name = rsl_option1
    }
}

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use