Reputation, Random Scripts, and 3D Editors

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/pied-piper.ermarian.net/includes/common.inc).
AuthorTopic: Reputation, Random Scripts, and 3D Editors
Guardian
Member # 6670
Profile Homepage #0
Oh my!

The following is an e-mail I received from jockmo42. I place it here in case my ideas are wrong (which is possible), my ideas aren't the most optimal (which is likely), or my ideas aren't clearly expressed (which is highly likely).
quote:
I'm sure there are already many reputation scripts out there, do you think
you could tell me where to find one that is easily adaptable to multiple
factions?

Also, do you think I can get a randomizer script? It would be a script that,
when triggered, picks randomly from a set of pre-defined scripts and runs
one.

Lastly, have you seen the 3D editor? I find that it would be much easier to
use than the original and I can avoid the Line of Sight Problem.
- I don't think it's possible for there to be a 'reputation' script. What I'd recommend you do is have an SDF (Stuff Done Flag, or just 'Flag') for each faction, containing the party's reputation with that faction. Whenever the party does something that will increase its reputation, increase the SDF (for instance, if the party does a minor quest for a faction, insert the following code to increase the reputation by one) :inc_flag(X, Y, 1);Whenever the party does something that will decrease its reputation, decrease the SDF (for instance, if the party kills a faction member, insert the following code to decrease the reputation by 5) :inc_flag(X, Y, -5);Finally, it's impossible for an SDF to have a value less than zero, and all SDFs start at zero. If you want to have the possibility for a party's reputation to decrease, you'll need to set them at a positive number at the beginning of the scenario (to start the party's reputation at 10, insert the following code in INIT_STATE in the scenario script) :set_flag(X, Y, 10);There's also a recent thread regarding complicated reputation counters. You can find it here.

- I don't think it's possible for an item to have a list of scripts to choose from. What you CAN do is the following. Say you have a Wand of Unusual Effects. In the state that is run when the item is used (say State 10), you'll have the following code (I think, though I could be wrong, that states for effects done by items are put in the scenario script) :
beginstate 10;
set_state_continue( get_ran(1, A, B) );
// A is the minimum random number returned. In this case, it's the lowest state number.
// B is the maximum random number returned. In this case, it's the highest state number.
Also note that in some cases you may want to use set_state instead of set_state_continue. Another thing I noticed is the run_scenario_script and the run_town_script calls. Bottom line: read the documentation.

- The 3D Editor is da bomb. Get it. If you don't like the view, there's a button you can press which reverts the view to 2D.

That's about all the advice I can give you. I can probably give more if you give more specific specifications.

--------------------
IF I EVER BECOME AN EVIL OVERLORD:
If I have children and subsequently grandchildren, I will keep my three-year-old granddaughter near me at all times. When the hero enters to kill me, I will ask him to first explain to her why it is necessary to kill her beloved grandpa. When the hero launches into an explanation of morality way over her head, that will be her cue to pull the lever and send him into the pit of crocodiles. After all, small children like crocodiles almost as much as Evil Overlords and it's important to spend quality time with the grandkids.

[ Sunday, June 18, 2006 14:36: Message edited by: Dintiradan ]
Posts: 1509 | Registered: Tuesday, January 10 2006 08:00
BANNED
Member # 4
Profile Homepage #1
Yeah, that's basically it.

As for the scripts: A warning, but you'll have to make them all one after another. For instance, if you want to have one of three possible things happen and the scripts would have to be in order-- 10, 11 and 12; 21, 22, 23, 24 and 25; etc. (Or you could just assign a variable the random number value and "reassign" it with a series of checks, but that's a bit more work than is preferable.)

--------------------
*
Posts: 6936 | Registered: Tuesday, September 18 2001 07:00