Coding help needed please

Help bring our custom Ages to life! Share tips and tricks, as well as code samples with other developers.

Coding help needed please

Postby ekimmai » Thu Jul 16, 2009 3:36 am

My age Vehrehn is nearing release but I am having huge problems trying to go about amending alcscript to cope with saving the state of each animation - of which there are many. One particular example is trying to save the colour of a light which turns green when a region is entered and then remains that colour indefinately. Whenever I link out and then return the light has reverted to white but the other associated animations remain in their latter state. Another example is where an animation (and its reverse) can be triggered from 2 seperate switches and they need to be able to detect the current state of the animation to work inter-dependantly.

I am beginnning to think the best solution might be to reset all states to their original condition.
I have been getting some useful pointers on my original post in builders (viewtopic.php?f=7&t=3110) but I am still struggling to get things to work.

Hence I am pleading for some help from all you coding experts out there - especially anyone who may have some free time to spend pouring over my blender file. I will happily provide a link by PM to the relevant files.

Thanks very much!
ekimmai
 
Posts: 79
Joined: Mon Apr 14, 2008 5:04 am
Location: Winchester, UK

Re: Coding help needed please

Postby ekimmai » Sat Aug 29, 2009 9:32 am

PLEASE - can anyone tell me how I can fix my age to reset all animations and colours when a person enters it?? I have for the time being accepted defeat in trying to code all the saved states - and otherwise will just have to release the age "unfinished".

Thanks in advance!!!!! :P
ekimmai
 
Posts: 79
Joined: Mon Apr 14, 2008 5:04 am
Location: Winchester, UK

Re: Coding help needed please

Postby D'Lanor » Sat Aug 29, 2009 11:05 am

I am willing to help but there are several others I promised to help so you'd have to get in line. I should probably be able to free up some time in two or three weeks.

Just to have this clear: Do you really want to reset all of the animations or save their current states? There is a relatively easy way to reset animations but that would make the age totally multiplayer incompatible. A person linking in would always see defaults states even if people who are already there have changed the states.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Coding help needed please

Postby ekimmai » Sun Aug 30, 2009 9:42 am

Hi D'L,

Thanks for answering my pleas (again!!). Not sure where I'd be without your frequent advice and assistance!

Given the sheer number of animations I figured resetting the age might be the sensible option and to be honest the age is not designed to be multiplayer (would be too easy to solve!) so no problem with that drawback. I am okay with joining the queue for your help but if there's an easy way to reset then perhaps I could go with that as a short term solution instead :P

Ekimmai
ekimmai
 
Posts: 79
Joined: Mon Apr 14, 2008 5:04 am
Location: Winchester, UK

Re: Coding help needed please

Postby D'Lanor » Sun Aug 30, 2009 1:13 pm

The quick and dirty solution is to exclude the persistent states for animations. To every object that has an animation you have to add this Alcscript:

Code: Select all
<animated object>:
    synchflags:
      - excludepersistentstate
    synchstates:
      - AGMaster


Note that this will not have any effect the first time you link to the age (unless you have deleted its sav file). Synch states are saved or wiped as you leave an age. So they will only reset from the second visit onwards.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Coding help needed please

Postby ekimmai » Sun Aug 30, 2009 1:57 pm

Fantastic, thankyou so much. I will give that a try over this next week.

:D
ekimmai
 
Posts: 79
Joined: Mon Apr 14, 2008 5:04 am
Location: Winchester, UK


Return to Scripting

Who is online

Users browsing this forum: No registered users and 0 guests

cron