Author Topic: Multiple (possible) effects from the same trigger?  (Read 307 times)

Legacy_Loathesome Pickle

  • Newbie
  • *
  • Posts: 24
  • Karma: +0/-0
Multiple (possible) effects from the same trigger?
« on: June 28, 2011, 12:31:37 am »


               Hewwo. . . Tired of me yet?  ':?' 

 I've been working on my Shadowrun module for a while now and I've kind of come into a situation where I think simplicity maybe truly the best course but I'm not sure if I want to go that route. . . What I'm /trying/ to do is set it up so a person can customize the appearance of their utilities whilst in the game's 'hacking' world. So say we might have 3 versions of a defensive program (like shield) that would essentially do the exact same thing yet look different.

 So without getting into a ton of code, I'd like someone's thoughts on this as to how it could be done. I was thinking an include file that'd contain the various possible visual effects and store the selected 'theme' on the character's token. (as I said, the practical effects are going to be the same no matter what, it's immutable. The presentation, however, will change based on what the PC set up)

 However I think that in so doing, I might be generating a ton of extra work for the CPU and myself. I imagine each time this script for the utility is called it'll have to check what a certain variable is and then go down a bunch of case/if statements to find the way it should look. . . That seems kind of silly. ':unsure:'

 Anyway, does anyone have any thoughts they could toss this fermented cucumber? It'd be greatly appriciated. 

 
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Multiple (possible) effects from the same trigger?
« Reply #1 on: June 28, 2011, 12:46:31 am »


               Short answer yes. Though I would need a bit more specific information to help you. When you say trigger do you mean a literal trigger on the ground? Are you talking about an activated item?
And you kinda answered your own question. You would check something like an integer variable on the player or something the player possesses(like the activated item itself) or a database and that would determine which effect you would use. Depending on the specifics it could be simple or it could get complicated.
               
               

               


                     Modifié par GhostOfGod, 27 juin 2011 - 11:47 .
                     
                  


            

Legacy_Loathesome Pickle

  • Newbie
  • *
  • Posts: 24
  • Karma: +0/-0
Multiple (possible) effects from the same trigger?
« Reply #2 on: June 28, 2011, 01:40:29 am »


               Ah, sure, sure.

The script would be called via an item or feat (or possibly spell hooking. . . I'm still not one hundred percent how we're going to set this up. . . But I think it'll be an activated item)

See, I thought so too but I'm just wondering if that's the most efficient way it can be done. I just want to alter the way these effects look, not how they actually function so we could potentially allow a person to develop combinations of 1 or 2 effects to serve a purpose.

I'm thinking 1 effect would be adequate. Whether that's something like a visual effect or some such, whereby an 'attack program' can look like uh. . . color spray or scintilating sphere (as examples).

Okay, so what's the most efficent way to do it? A case statement for each possible 'theme?'

EX:

Color theme (set as a variable)
   - Color Spray (set as a sub-variable?)
   - Prismatic Spray
   - Daze VFX

Sorry, work's been kind of frazzled today so I may not be making much sense.
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Multiple (possible) effects from the same trigger?
« Reply #3 on: June 28, 2011, 11:19:28 am »


               Well if a particular visual effect would be used for a particular class or feat you could also just store that visual effect constant on the player or an item of the players or database for player, etc..And then when the player does whatever to make the effects it just grabs the VFX constant from the player. So you can use a universal type script and keep it short and simple.
               
               

               
            

Legacy_the.gray.fox

  • Full Member
  • ***
  • Posts: 214
  • Karma: +0/-0
Multiple (possible) effects from the same trigger?
« Reply #4 on: June 30, 2011, 12:19:08 am »


               It is possible I am not understanding what you ask for.
You talk difficult for this little fox :-)

But perhaps you could write a custom 2DA?
To each 2DA line a Theme (to use your words).

In game, on your players, you would just save an integer variable.
That integer would be the ID of the 2DA line to read.
The 2DA line in turn would contain whatever params you need to define the Theme pointed to.

In other words, the "integer" would act as "pointer" to the "theme".
So you read the integer, then go read the 2DA line with ID equal to that integer, then you collect all params from that 2DA line, and process them into the Theme you are after.

Performance should be O(log n) whether you have 1 or 10000 themes defined. Theoretically, at least.
But no rule forbids you to split your theme datasets onto multiple 2DAs, so helping the game to access your data even faster.
There is plenty of ways to optimize for speed. The more details you share the better we can help.


-fox