Add "effects" to entity

Things that already exist in the current mod API
BlackSalander
Burner Inserter
Burner Inserter
Posts: 5
Joined: Tue Mar 08, 2016 3:08 am
Contact:

Add "effects" to entity

Post by BlackSalander »

This class would hold a list of the class "effect" with the following template

class Effect{
string EffectName; //The name of this effect
string Type; //Type of effect ( "Postive" | "Negative" | "Neutral" | "Both" | "None" )

float HealthBonusREL; //Relative health bonus (the bonus depends on the entity's max health)
float HealthBonusABS; //Absolute health bonus
float HealthRegBonus; //

float SpeedBonusREL; //Relative speed bonus (the bonus depends on the entity's max speed)
float SpeedBonusABS; //Absolute speed bonus

uint64 TicksToDie; //How many ticks this effect will last(or have left)

float DamagePerTick; //How much damage the entity recieves per tick

//don't know if the ones bellow are doable
IMG* EffectMask; //An image to overlay on the entity as effect
ANM* EffectAnm; //Some kind of animation to overlay on the entity

string pre_effect; //Name of event to be called right before the effect takes place
string pos_effect; //Name of event to be called right after the effect is over
}

The idea is to make entities (enemies, character or vehicles) able to receive effects given by other entities or world it self.

This would give Modders a lot of space to create lots os cools stuff like:
-Temporary max health bonus
-Temporary speed bonus
-Poison spitters (apply damage over time on other entities)
-More possible interactions between player and enemies
-Time Bomb?
Rseding91
Factorio Staff
Factorio Staff
Posts: 14280
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Add "effects" to entity

Post by Rseding91 »

That's what the sticker entity is for. It attaches to an entity and applies some effect over time for some duration.
If you want to get ahold of me I'm almost always on Discord.
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: Add "effects" to entity

Post by aubergine18 »

You can see examples of stickers from vanilla game searching this dump of data.raw: https://raw.githubusercontent.com/auber ... r/data.raw

@Rseding91 do stickers of the same type stack?
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14280
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Add "effects" to entity

Post by Rseding91 »

aubergine18 wrote:You can see examples of stickers from vanilla game searching this dump of data.raw: https://raw.githubusercontent.com/auber ... r/data.raw

@Rseding91 do stickers of the same type stack?
Currently no.
If you want to get ahold of me I'm almost always on Discord.
BlackSalander
Burner Inserter
Burner Inserter
Posts: 5
Joined: Tue Mar 08, 2016 3:08 am
Contact:

Re: Add "effects" to entity

Post by BlackSalander »

aubergine18 wrote:You can see examples of stickers from vanilla game searching this dump of data.raw: https://raw.githubusercontent.com/auber ... r/data.raw

@Rseding91 do stickers of the same type stack?
Thanks, I'll take a look at that
BlackSalander
Burner Inserter
Burner Inserter
Posts: 5
Joined: Tue Mar 08, 2016 3:08 am
Contact:

Re: Add "effects" to entity

Post by BlackSalander »

How do I use that?
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Add "effects" to entity

Post by Mooncat »

@BlackSalander to use a sticker, first you create a sticker entity. Then use "action" to deliver the sticker entity to target. Check "slowdown-capsule" for quick example.

But currently, we only have 2 stickers in the game: "fire-sticker" and "slowdown-sticker". They show limited properties.
Besides damage_per_tick, fire_spread related thingy, and target_movement_modifier, may I know are there any other properties we can use?
And what will happen if two different stickers with different values on target_movement_modifier are applied to the same entity? :)
Post Reply

Return to “Already exists”