Announcement: Why not try our official idea generator for inspiration when making puzzles?


Caravel Forum : DROD Boards : Architecture : Scripting additions to Default Character
New Topic New Poll Post Reply
Poster Message
larrymurk
Level: Smitemaster
Avatar
Rank Points: 1917
Registered: 12-09-2004
IP: Logged
icon Scripting additions to Default Character (0)  
Suppose I'm making a special scripted character that says a number then says "bye".

I would like to make a special character named NumberGuy with a default script that says "bye".

Then, I'd like to be able to place many characters, select NumberGuy for each, and add the command speech with their unique numbers.

The problem is, it seems that if I add any commands when I place a character then it ignores the default script for that character type.

Is there a reason for this?
Any guess for the best work around?

I could of course simply copy the entire script to every character i place and just alter the number.
06-26-2013 at 11:23 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Someone Else
Level: Smitemaster
Avatar
Rank Points: 2338
Registered: 06-14-2005
IP: Logged
icon Re: Scripting additions to Default Character (+1)  
As far as I know, the last line is the best thing to be doing, and there's no other way. However, if the script is that simple, you could simply have them read from a variable and then increment it; movement order will do the rest for you.

EDIT:
Actually, thinking about it, that works for more complex scripts as long as the characters never die (and have a character that moves first that resets the number). Or you could have special incrementing characters that make it so that it still works if some of the characters die...

[Last edited by Someone Else at 06-26-2013 11:37 PM]
06-26-2013 at 11:35 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
larrymurk
Level: Smitemaster
Avatar
Rank Points: 1917
Registered: 12-09-2004
IP: Logged
icon Re: Scripting additions to Default Character (0)  
Well, first of all, the script is much more complex than my example.

More accurately, I want each character to wait a different number of turns before doing something.

The thing is I'd like to place a character and be able to simply add the command wait (20) and then place another character and have it say wait (131) and each character should then continue their default character script after their wait command.
06-27-2013 at 12:11 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Someone Else
Level: Smitemaster
Avatar
Rank Points: 2338
Registered: 06-14-2005
IP: Logged
icon Re: Scripting additions to Default Character (0)  
Yeah, unfortunately, I don't know of a better way of doing that.
06-27-2013 at 01:41 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5120
Registered: 02-04-2003
IP: Logged
icon Re: Scripting additions to Default Character (0)  
Mmm, yeah, the point of the default script is that providing an instance-specific script will override it. The default script is supposed to function more or less identically in general.

I'm thinking of some hacks like: instances of the default script could use their initial placement position in the room to calculate their respective wait value.

With local var support: a generator script could set a variable, then create an instance of the entity with the default script. The default script can run and store the current value of the variable into a local var. Next turn, the generator script can create another instance with another value for the variable, and so on.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.

[Last edited by mrimer at 06-27-2013 01:55 AM]
06-27-2013 at 01:54 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Architecture : Scripting additions to Default Character
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.