Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Making conditional branch dynamically


Jacquelinett
 Share

Recommended Posts

You'd have to compare the event variable to determine which if statement to run, they would be an array based on the total of events allowed.

eventVariable(eventNum); Pretty much.

And allow your event editor to set your eventVariable(eventNum);

I'm not fluent in how any other language handles but eh, basically the idea is the same.
Link to comment
Share on other sites

> You'd have to compare the event variable to determine which if statement to run, they would be an array based on the total of events allowed.
>
> eventVariable(eventNum); Pretty much.
>
> And allow your event editor to set your eventVariable(eventNum);
>
> I'm not fluent in how any other language handles but eh, basically the idea is the same.

I thought of that, but wouldnt it just comparing 1 statement?

say

i have an int* ConditionalBranch[MapSize], if this int[locationsomewhere, the x, y coor] have the value of a nonzero, then let say

i have a function call "Execute"

so like

Before it do the stuff in event, it check the condition first.

I suck at explaining thing, but i do what i planned, it only allow an if statement, and no else statement

neither is else if.
Link to comment
Share on other sites

That's why RPG Maker event system allows more than 1 conditional branch;

So within it's programs code, it will compare the variable each time it's in the event editor.

(First conditional)

if variable = 1 then

else

(Second conditional)

if variable = 2 then

else

end if

end if

Then when the event is saved, the variable is usually carried by a players file (or not if ran within the server) as int eventVar(eventNum)

Then the inner code will check whether the code executes or not.

if eventVar(eventNum) == int[locationsomewhere, the x, y coor]

{

Execute

}

End if

Lol my explanation is probably 100 times worse, I'm not knowing the coding language you're working with.
Link to comment
Share on other sites

> That's why RPG Maker event system allows more than 1 conditional branch;
>
> So within it's programs code, it will compare the variable each time it's in the event editor.
>
> (First conditional)
>
> if variable = 1 then
>
> else
>
> (Second conditional)
>
> if variable = 2 then
>
> else
>
> end if
>
> end if

/implying i can just type in else and else and else?

wait

i think im beginning to see what u mean

i think

im not sure

but isnt what u are trying to say

is basically do what i said earlier which is to call the check function if the data isnt 0

and the number that isnt zero represent a branch type, where u can compare thing?

but if you have an overloaded function where u put in 2 variable, then you would compare the if and else?

but what i just said make no sense
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...