Page 2 of 2

Re: xAgeSDLIntChange / responder

Posted: Wed Apr 03, 2013 11:15 pm
by dendwaler
I want my animations to respond to play to a certain stage, but starting at whatever position they were in, so I can't use loopstart loopend.
That is exactly what i also need in my age.
I have been trying to do this since about a year and never succeeded, but i am a noob in programming.
In a puzzle i need an object to move to its next position after you entered a successfull combination.
After a false combination it should reset to the beginning of the animation.
I am very interested to hear the solution when you succeed in it.!

Re: xAgeSDLIntChange / responder

Posted: Thu Apr 04, 2013 3:29 am
by diafero
Is this decrement bug also affecting Uru:CC? If yes, I could easily incorporate the fix into a new version of the Offline KI.

Re: xAgeSDLIntChange / responder

Posted: Thu Apr 04, 2013 3:43 am
by Render
Thanks all for the reply.
@ Branan, I will do a pull request (if I can find out how :shock: )
@ D'Lanor, I think I figured out how to use the loopstart-loopend combination so it works as I know where to goto, so i can fiugre out where to start.
@ Dendwaler, I will let you know when i have a solution.
@ Diafero, I don't know to be honest, I am just trying to incorporate the python in my offline age and stubled upon the bug.
Let me know if you still want me to do a pull request.

One more question, for the coders amongst us.

What peace of python do i need to prevent an XAgeSDLIntRespList from responding?
I already have a special SDL variable I can use for this, what i need is a peace of code that will read the SDL state and do a check against a variable i can define within the alcscript, something like:

If ButtonSDL != buttonvar, stop else execute.

I gues I would have to put an extra variable line at the top of the original python script called buttonvar and then have the line above (also need to have the pythonfile read it from the SDL file)
I assume this is not to hard is it?

Re: xAgeSDLIntChange / responder

Posted: Thu Apr 04, 2013 4:55 am
by Render
Solved the responder question!
For however is interested, I used the (unused) hint line in the IntChange as a tag and added the following to the IntRespList:
stringTag = ptAttribString(7, 'Button number') at the top of the python just beneath the 6th argument

and:

if (tag != stringTag.value):
return
just after the OnSDLNotify line

In my alcscript I have added an extra type: string with value (buttonnumber) in the IntRespList

This seems to do exactly what i intended, namely only run the IntRespList command on the appropriate button.

Re: xAgeSDLIntChange / responder

Posted: Thu Apr 04, 2013 8:31 am
by D'Lanor
diafero wrote:Is this decrement bug also affecting Uru:CC? If yes, I could easily incorporate the fix into a new version of the Offline KI.
Yes, it is.