Elise39u / LaravelAvontuur

A remade of my kilk game in larvael
0 stars 0 forks source link

choice problem #17

Open Elise39u opened 5 years ago

Elise39u commented 5 years ago

Currently choices that require a item to be working are broken They will show even without the item and wil direct you towards the ink studio If canceld you wil redirect to location 80 or else if accepted you wil enter the ink studio

At the moment there is no idea what is causing it For now be aware of it and when there is time i will look in to it

Elise39u commented 5 years ago

The issue is investigated and seems a bad code problem We look further into it but for now the game remains broken the issue lies with the development of the ink studio and its choices

Elise39u commented 5 years ago

De error lies in een elseif die niet bereik baar is De conditie schijnt kapot te zijn

Elise39u commented 5 years ago

elseif($choiceCondition == 'NEED ITEM') Is for what ever reason false always Voor nu kan ik geen fix vinden momenteel maar ik kom hier op terug

Hier is de hele choice loop <?php foreach ($location->choices as $choice) { $choiceCondition = json_encode($choice->conditions); //Error lies in a code issue with the elseif if ($choiceCondition == '[]') { ?>

                        <?php } elseif($choiceCondition == 'NEED ITEM') {
                            $choiceCheck = json_decode($choiceCondition);
                            $ItemCheck = json_decode(json_encode($inventory->get_inventory_items), true);
                            $length = count($ItemCheck);
                            foreach ($choiceCheck as $ChoiceCheck) {
                                for ($i = 0; $i < $length; $i++) {
                                    if ($ItemCheck[$i]['item_id'] == $ChoiceCheck->action_value) { ?>
                                        <li class="menuchoice"><a class="link" href="/location/{{ $choice->to_location_id }}">{{$choice->name }}</a></li>
                                    <?php } else { ?>
                                        <li class="menuchoice" style="display: none;"><a class="link" href="/location/{{ $choice->to_location_id }}">{{$choice->name }}</a></li>
                                    <?php }
                                } ?>
                            <?php }
                        } else {
                            ?>
                            <script type="text/javascript">
                            function warnUser() {
                                var Link = document.getElementById("ChoiceBendy");
                                var choice;
                                if(confirm("Warining: There is no point back onces you enter the world of joey drew until you completed it " +
                                    "DO you want to go on or not?")) {
                                    Link.setAttribute("href", "/location/" + 92)
                                } else {
                                    Link.setAttribute("href", "/location/" + 90)
                                }
                            }
                         </script>
                            <li onclick="warnUser()" class="menuchoice"><a id="ChoiceBendy" class="link" >{{$choice->name }}</a></li>

                        <?php }
                    }?>
Elise39u commented 4 years ago

The issue is solved for items but not yet for quest completed items or other secrets in the game. Were still working on this but for now item required choices should work fine

Elise39u commented 2 years ago

$conditionCheck = $choice->conditions->first();

The issues is resolved for now but later should go under a matience period. This due to fact for planning of choice with multiple items as requirement. Also gonna keep an eye on this