Page 2 of 2

Re: Scripting problems, need help

Posted: Thu Oct 18, 2012 3:21 am
by lalaxy
Hi!

The plan is ready then :)
I have a few questions there more :) I use the gothroughportal to handle the ports...Then i need to change it or write a script inside what check "loadingscreen not appears" number or anything else??? Then drop party...
And then how can i call a returnpath wp only for this case???
And the returnpath's end need to call back the oroginal wp ? :)

Regards

Re: Scripting problems, need help

Posted: Thu Oct 18, 2012 6:42 am
by rock5
Well GoThroughPortal does everything for you so all you have to do is

Code: Select all

if GoThroughPortal() == false then -- Tries to go through portal and if it fails...
    -- Do something if it fails eg.
    code to drop party
    waitForLoadingScreen()
    loadPaths("returnpath")
end
Of course this means it doesn't try to enter the portal again. I guess you could write it so it tries a couple of times before dropping the party but that's harder to write.

Re: Scripting problems, need help

Posted: Thu Oct 18, 2012 10:23 am
by lalaxy
Thy for code, it will be the solution :)

Additional idea: Can we make a counter or anything what couts the number of gothroughportal? i mean if the false of the gothrough number is 5 or 10 then break only party...In this case we can solve the normal "potral dont work" problem and the "portal isnt there" problem ?

Regards

Re: Scripting problems, need help

Posted: Thu Oct 18, 2012 11:00 am
by rock5
Like I said, that is a little more tricky, but ok if your interested.

This is how you do it. First, lets say the waypoint where the GotThroughPortal is is waypoint #10. At waypoint #8 you would initialize a variable, lets call it "tries"

Code: Select all

tries = 0
Then at waypoint #10 you could do.

Code: Select all

tries = tries + 1
if GoThroughPortal() == false then -- Tries to go through portal and if it fails...
    -- Do something if it fails
    if tries > 5 then
        code to drop party
        waitForLoadingScreen()
        loadPaths("returnpath")
    else
        __WPL:setWaypointIndex(__WPL.LastWaypoint - 1)
    end
end

Re: Scripting problems, need help

Posted: Thu Oct 18, 2012 11:13 am
by lalaxy
Excellent!

Mybe a stupid question:

Code: Select all

if GoThroughPortal() == false then -- Tries to go through portal and if it fails...
    tries = tries + 1
    if tries > 5 then
        code to drop party
        waitForLoadingScreen()
        loadPaths("returnpath")
    else
        __WPL:setWaypointIndex(__WPL.LastWaypoint - 1)
    end
end
Not this way ? (tries+ moved under "if" code)

Re: Scripting problems, need help

Posted: Thu Oct 18, 2012 1:37 pm
by rock5
Doesn't really make that much difference. If the portal works then it's not going to need the variable any way. But I guess your way is the right way because you don't need to increment the variable unless it fails.

Re: Scripting problems, need help

Posted: Thu Oct 18, 2012 5:08 pm
by lalaxy
Many thx for all for this all help...I hope i dont bother u with more problems...(hope all will works fine for a long time) :)
Regards