Jump to content

Adding color pulses/solid glows and changing colors?


Recommended Posts

This question has probably been answered elsewhere, but I'm having a hard time wrapping my head around examples I have seen so far in my research, as they seem to be geared towards automating the process for doing a large amount of items (shield glow in tweaks mod for example).  Are there an examples of the correct syntax to use for changing colors, or adding pulse/solid glows to existing items?  I am hoping there is a simpler way to do this on a per item basis that is easier for me to understand.

So, if I were to start with the below, what would be the simplest way to implement what I am trying to do?:

 

COPY_EXISTING ~shld24.itm~ ~override~        //Reflection Shield +1    
LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 9 target = 1 parameter1 = color_pulse parameter2 = ????? timing = 2 END

 

 

If anyone has any examples of adding a custom hit visual effect to an existing item, I would greatly appreciate that as well!

 

  

Link to comment

For anyone finding this in a search years later, I won't leave you hanging.

The reason it was tricky was because of the parameters used by opcode 9.  Both parameter1 and parameter2 need to store multiple pieces of data.

Parameter1:

Quote

The 'RGB Colour' field is handled as follows:
Second byte = Red (0-255)
Third byte = Green (0-255)
Fourth byte = Blue (0-255)

Parameter2:

Quote

The 'Location' field is handled as follows:
First byte = Location
Third byte = Speed (0-255)

To generate the parameters to supply to a function like ADD_ITEM_EQEFFECT, you need to use bit shifting and add the individual values together.

COPY_EXISTING ~shld24.itm~ ~override~
  SET r = 30
  SET g = 60
  SET b = 90
  SET parameter1 = (b BLSL 24) + (g BLSL 16) + (r BLSL 8)
  
  SET location = 5
  SET cycle_speed = 90
  SET parameter2 = (cycle_speed BLSL 16) + location
  
  LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 9 target = 1 parameter1 parameter2 timing = 2 END

 

Link to comment

Since Mike was so helpful to me with this, I want to add:  for a solid glow, using opcode 8, here is an example of how the syntax differs: (at least, this is how I did it)

COPY_EXISTING ~shld24.itm~ ~override~
  SET r = 30
  SET g = 60
  SET b = 90
  SET parameter1 = (b BLSL 24) + (g BLSL 16) + (r BLSL 8)
   SET parameter2 = 5  
  
  LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 8 target = 1 parameter1 parameter2 probability1 = 100 timing = 2 END

I'm not sure if probability1 is set to 100 by default, but I put it in there anyway :)

 

You could also do it this way, since for a solid glow, parameter2 is for location only, not both location and cycle speed:

 

COPY_EXISTING ~shld24.itm~ ~override~
  SET r = 30
  SET g = 60
  SET b = 90
  LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 8 target = 1 parameter1 = (b BLSL 24) + (g BLSL 16) + (r BLSL 8) parameter2 = 5 probability1 = 100 timing = 2 END

 

Edited by Daeros_Trollkiller
Link to comment

One more example, for adding an "on hit" effect to a weapon (may work for spells too, haven't tried yet)  In this example, we are adding a visual effect on hit, and making it easy, by using LPF CLONE_EFFECT:

 

COPY_EXISTING ~ax1h13.itm~ ~override~	//Frostreaver +3
LPF CLONE_EFFECT INT_VAR match_opcode = 12 match_parameter2 = 131072 opcode = 215 parameter2 = 1 STR_VAR resource = %resource_filename% END 

What this does is create a copy of the existing "on hit" effect of cold type damage on this item, and then modify it into opcode 215 to play the visual effect that we define in the %resource_filename% variable.   

We only need to change the parts of the effect that are needed to get the desired result.   In this case, all I needed to change was the opcode and resource.

Edited by Daeros_Trollkiller
Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...