Ambrosia Garden Archive
    • Dee-type questions: How does this work?


      I've got a game mechanics question based on spells and how they work.

      1. Which is triggered first: the cast event located in the Event Links tab, or the values within the Statistic Modifiers tab? Ie, if I set a global in the cast event that stores the value of an item that is changed within the statistic modifiers tab, will it store the original value or the altered value? Which gets done first?

      2. How does the Statistic Modifiers work? Do they change the value of the attribute they effect, or merely add something like a linked list next to the attribute telling the code to treat it differently? Ie, if a person's strength is 18 and a stat modifier reduces it by 2, does the code change the strength to 16 and when the event is removed it changes it back to 18, OR does the strength attribute remain at 18 with a (-2) placed next to it in the code for evaluation purposes, and when the event is removed so is the (-2) link? The documentation states that they apply the value directly to the player's attributes, so I suspec the former method, but I'd like some confirmation if possible.

      Thanks

      ------------------
      "Usenet is like a herd of performing elephants with diarrhea --
      massive, difficult to redirect, awe-inspiring, entertaining, and a
      source of mind-boggling amounts of excrement when you least expect
      it." -- Gene Spafford, 1992

    • Quote

      Originally posted by Stark Bledfast:
      **

      1. Which is triggered first: the cast event located in the Event Links tab, or the values within the Statistic Modifiers tab? Ie, if I set a global in the cast event that stores the value of an item that is changed within the statistic modifiers tab, will it store the original value or the altered value? Which gets done first?
        **

      I don't have the source code nearby but I'm pretty sure that it should store the original value since I think the cast event is executed before the spell is cast.

      Quote

      **
      2) How does the Statistic Modifiers work? Do they change the value of the attribute they effect, or merely add something like a linked list next to the attribute telling the code to treat it differently? Ie, if a person's strength is 18 and a stat modifier reduces it by 2, does the code change the strength to 16 and when the event is removed it changes it back to 18, OR does the strength attribute remain at 18 with a (-2) placed next to it in the code for evaluation purposes, and when the event is removed so is the (-2) link? The documentation states that they apply the value directly to the player's attributes, so I suspec the former method, but I'd like some confirmation if possible.
      **

      I'm not sure what your question is but I'll try to answer. The stat modifs only last for the duration of the spell. If you try to access the stats with a tag value or something, it should give you the new, modified, stat (16 in this case).

      I hope this helps you!

      ------------------
      Dee Brown
      Beenox inc. - (url="http://"http://www.beenox.com")www.beenox.com(/url) (check our new web site!)
      (url="http://"http://www.AmbrosiaSW.com/games/coldstone/")Coldstone Game Engine(/url) / (url="http://"http://www.AmbrosiaSW.com/games/pog/")Pillars of Garendall(/url) developers

    • Quote

      Originally posted by Dee:
      I don't have the source code nearby but I'm pretty sure that it should store the original value since I think the cast event is executed before the spell is cast.

      Thanks.

      Quote

      I'm not sure what your question is but I'll try to answer. The stat modifs only last for the duration of the spell. If you try to access the stats with a tag value or something, it should give you the new, modified, stat (16 in this case).

      Alrighty, thanks for the info. That is what I am looking for.

      Reason I'm asking on this second question is I'm trying to figure out a way to have spell effects either last through a saved / reloaded game, or be able to remove the effects upon loading a new game. So if I boost a person's strength by 5 temporarily and they save their game and then reload it, I don't want that +5 strength to become permaneant. Or in the case of the Ranger potions in PoG, to have their new character picture to become permaneant.

      So my original thought was if I saved the original value I could check it against their current value to see if they have been reset or not. However that will not work because there are ways to improve your stats and I wouldn't want to take that away from a player.

      So my thinking now is to set a global with the increase, as well as a global that the spell "trips," ie, a global that says whether or not the spell has been cast. When the spell wears off I'll have the "Remove Event" event reset that global to 0 so that the game realizes the spell is no longer active.

      Then, if the player loads a game, my thinking is that I can check the list of globals to see which spells are "active" and then remove the effects manually and reset their globals, since to my knowledge the duration events do not save(at least, not to my understanding).

      Doable?

      ------------------
      "Usenet is like a herd of performing elephants with diarrhea --
      massive, difficult to redirect, awe-inspiring, entertaining, and a
      source of mind-boggling amounts of excrement when you least expect
      it." -- Gene Spafford, 1992