• Welcome to SC4 Devotion Forum Archives.

Xannepans creations

Started by xannepan, October 05, 2007, 06:52:11 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Should the weather plugin include a version with destructive effects (e.g. associated with tornados and lightning)?

Yes
41 (57.7%)
No
30 (42.3%)

Total Members Voted: 71

Voting closed: January 26, 2013, 06:50:01 AM

xannepan

Ah.. I need to clarify my earlier post. I want to achieve two things here.
One is to have the effect appear in a position that is not dependent of a lot position. Second is to create timing properties for the effect to appear (snow during winter, moonrise during nightfall etc.). The latter is propably possible thorgh an effect exemplar, and putting the effect on a lot. So for that reason a single 1x1 tile lot will do fine, and in principle I don't mind using a lot at all. But that doesn't solve the position problem. So in fact I am looking for an other way beyond lot to solve both timing and position problem. And perhaps for that reason a LUA script could be used...

noahclem

awesome work with the moon  :o  Wow. Keep it up  :thumbsup:

vortext

This is just incredible, the moon, the rain and cloud effects . .and a rainbow too. Just  :o  &apls

For those reading along and curious about the medieval models; Alex sent them to me a while ago. At that moment RL was busy for me but things have calmed down since and I'll start lotting asap.
time flies like a bird
fruit flies like a banana

NCGAIO

#1063
Quote from: xannepan on January 03, 2013, 10:50:52 PM

I am looking for a way to trigger an effect without having to plop a lot. If I trigger the effect via the cheat mode (ctrl+x, typing Effect <effectname>) it turns out the effect is placed centrally on the map. Almost exactly what I want.

I am looking for something similar.

I have looked a bit into the LUA scripts, but I don't understand yet how they work. Does anybody know if what I want to achieve would be possible?

Side question: does anyone know what starts the fireworks during game start?



This can help you ...


The green stuff will return!


"CsiTrigger" is the condition for Lua scripts.

note: I sent e-mail about animations ... Tks for the download link.   :thumbsup:

xannepan

#1064
Thx NCGAIO, but the info is a little to sparse for me  &mmm
What I learned is how to trigger time dependent advice messages by LUA scripts.

It doesn't tell me yet how to trigger an effect...

Never mind... I have found some effect trigger LUA scripts in simcity1.dat. I'll explore them a little further now...

xannepan

So I am really stuck again this time.
In simcity1.dat I find the following in LUA with TGI   CA63E2A3     4A5E8EF6     FFA79144     

-------------New Years fireworks----
a = create_advice_fluff ('aacbd9bb')
a.trigger  = "game.g_month == 1 and game.g_day < 8 and game.reward_instance_count('031F0000')== 1"
a.title   = [[text@aacbf7b8 Happy New Year!]]
a.priority  = tuning_constants.ADVICE_PRIORITY_MEDIUM
a.mood = advice_moods.FLUFF
a.news_only = 1
a.effects = effects.NEW_YEARS_FIREWORKS
a.timeout = 15
a.persist = 1


Looking for the definition of the constant in bold above i get to LUA with TGI CA63E2A3     4A5E8EF6     FF048A3E     
---------------------------------------------------------------------------
-- Global effect flags (for conditional props and effects)
--
effects = {}
   
   effects.POOR_FIRE_COVERAGE = hex2dec('aa3753d2')
   effects.UNHAPPY_SIMS = hex2dec('aa3754c5')

   effects.FIRE_STRIKE = hex2dec('2a5f6e60')
   effects.POLICE_STRIKE = hex2dec('2a5f6e61')
   effects.HEALTH_STRIKE = hex2dec('2a5f6e62')
   effects.EDUCATION_STRIKE = hex2dec('2a5f6e63')
   effects.TRANSIT_STRIKE = hex2dec('2a5f6e64')
   effects.TV_CREW_AVAILABLE = hex2dec('0a89dfd4')
   effects.MISSILE_BUNKERS = hex2dec('eaad9fc4')
   effects.MISSILE_LAUNCH = hex2dec('2aaec104')
   effects.LLAMA_SPIT = hex2dec('4aaec141')
   effects.LIGHTNING_BALL = hex2dec('4aaec3ca')
   effects.BALLOON_LAUNCH = hex2dec('8ab1ad6f')
   effects.NEW_YEARS_FIREWORKS = hex2dec('cacbdfc6')
   
make_table_const(effects)

Instance 'cacbdfc6' is unfortunately NOT defined in any simcity#.dat file....
I was hoping it would lead to an exemplar for the effect... but that seems not to be the case.
The question is what will happen if I put in a reference to an exemplar I created.... but I am not so hopefull... let's see..





EUREKA? Well not really....

NCGAIO

#1066

Quote
This article contains a list of all the relations of the SimCity 4 file types


Effect Dir
ea5118b1 - Effect Resource Tree
           Children
              FSH, ResourceKey, In section 1 the effect may call itself a texture by instance.
              S3D, ResourceKeys, In section 1 a list of resource keys may call random S3D files.
              FSH, Resourcekey, In Section 2 terrain dependent FSH file.
              Exemplar, ResourceKey, In section 5 terrain brush exemplar.
              LUA, String, Section 6 string links to a representative string in LUA generators/attractors/repulsors by var.
              EXE, CID, Section 7 U4 property almost certainly links to the exe by classid.
              TRK, ResourceKey, Section 9 resource Key links to a track def for sounds.
              EXE, String, Section 10 strings almost certainly link to the EXE for train variables.
              EXE, CID, U4 in section 12 probably links to the exe by classid.

          Parent
              EXE, CID, the exe may call an effect in 13,14,15 by instance or CID.
              EXE, String, the exe may call a string in the effdir directories 13,14,15 by name.
              Exemplar, property, 0x4a08c700 property calls an effect name for use by exemplars (often disasters).
              Exemplar, property, 0xc98204b8 property calls an effect name for use in an effect exemplar by string.
              Exemplar, property, 0xc98204b9 property calls an effect name for use in an effect exemplar by string.
              Exemplar, property, in absence of the 0xc98204b8/9 property Exemplar name of gid 0xc977c536 calls an effect by string.
              S3D, name, the effect name in the REGP section of an S3D may spawn an effect by directory name in the EFFDIR.
              LUA, , fx, the fx command allows to reference an effect inside the effect dir from an LUA.
http://www.wiki.sc4devotion.com/index.php?title=Relations

"$Deal"$ - Animated Props Solved

xannepan

I am affraid it's not going to work. There are several ways to start effects from the effect dir, but non of them allow me to do it scripted AND without attaching it to a lot.

1) I can create a property exemplar for the effect, with timing triggers etc. This property can then be put on a lot, and the effect will occur depending on the defined timing property. This is what I have used sofar, and probably I am stuck with it.

2) via the advisor lua scripts I can trigger an effect, however, as far as I can tell only a predefined number of effects (see my. previous post). the effect is refered to by an ID that is not defined in the games .dat files. I have not been succesful to create a reference to my custom made effects.

3) via automata lua scripts I can "attach" an effect to an automata (e.g. the steam to a steam train) referenced to by string name in the effect dir.

4) Finally there is a section in the effect dir that refereres to lua scripts. However, these scripts not trigger the effect itself. Instead they trigger lua scripts that run simultaneous with the effect when it occurs (e.g. Fauna getting out of the way of a tornado)

I am open to suggestions off course, but they'll have to be very explicit... Otherwise I'll end up spending another few days on this, which is not what I wan to do anymore...






Andreas

Well, if there isn't any other way than attaching those effects to a lot, it's probably not a bad idea to make "useful" lots, such as an observatory for the moon effect, some skiing-related lot for the snow effect etc. For creating seasonal flora, we have to plant the trees at a specific time, so it's not that bothersome to have some workaround for getting these effects, I'd say.
Andreas

xannepan

I will see what I can do Andreas. What bothers me most is that some effects require the lot to be place exactly at the center of the city (moonrise/set, sunrise/set etc). Fortunately that is not the case for most weather effects. I will now go for the approach using lots. There is always room for improvement for a second version should I ever find out if there is a effect dir property that enables central map placement.

By the way, today i started splitting my files into two dat file, a weather controller, and a celestial controller.

The good thing about this all is that I am still learning. I am sure my. Learnings from the weather and celestial controller will help fixing the last bugs in the air traffic controller, as well as help improving the (new) animals I still have in store.

NCGAIO

#1070

I said before that I admire your perseverance on the job but I think the search for a perfect thing sometimes only serves to complicate because will always find that could be better, do not you think?


Despite big visual impact of weather mods personally think that other implementations are much more interesting and less prone to problems (performance)


In SC4 always there are some complex solutions to accomplish what we want but invariably they also then become complex problems to solve.


As someone who is already involved in the community for  many years you've probably seen several projects that disappear due to RL and particularly I'm rooting for this project continue forever.


If the lot is the way safely and less prone to errors and interferences then  make it (I guarantee that there will be also a lot less complaints about the functioning.)


note:PM

whatevermind

Truly amazing work, your videos are just mindblowing.  &apls

One idea on triggering effects, and I have no idea if this is feasible, but I haven't seen it mentioned here yet so let's see if it's any good. Terrain brushes use and can trigger effects. There are two properties related to the brush cursor itself (i.e. the green circles), but there is also a property, Comp1IDOfEffectToPlace, that tells the brush what effect to trigger. The three fauna brushes use this property, as does the rain tool. The property names a GID and IID for an effect, which match up with an effect listed in Section 14 of the EFFDIR.

That's as much as I know about it, it was something I noticed during my research on brushes, but haven't looked any further into. It's usefulness, I think, would be in that you could create a new brush, and "paint" the effect into action, letting effect scripting handle the rest as to when/what appears.

xannepan

Interesting lead about the terrain effects! I'll have a look at it.

I'll keep exploring for simplification and optimization of the celestial and weather effects.
NCGAIO; I hear you :) but keep in mind that the work I am doing is to make it all actually work... 
No worries though about editing the existing effect dir. That is not what I am doing... I am just adding new effects. The existing effect dir should not be modded. Also I am more and more comfortable about performance impact. These effects should not have much more impact then when using the waterstream and waterdrop effects. Not 100% sure though, just hopeful.

Meanwhile...

M4346

It's the dawning of a new era for SC4  :D $%Grinno$% ::)

&apls
New Horizons Productions
Berethor ♦ beskhu3epnm ♦ blade2k5 ♦ dedgren ♦ dmscopio ♦ Ennedi
emilin ♦ Heblem ♦ jplumbley ♦ moganite ♦ M4346 ♦ papab2000
Shadow Assassin ♦ Tarkus ♦ wouanagaine

xannepan

I have decided to release soon as a beta version, otherwise I am affraid RL will become too busy and I won't release at all.
Also I need feedback from a broader audience.

A new teaser video.
http://www.youtube.com/watch?v=yz_gtp82i0A&feature=youtu.be

gn_leugim

 :o :o :o :o :o &apls &apls &apls &apls wonderful! just... Wonderful!

art128

I'll take a quiet life... A handshake of carbon monoxide.

Props & Texture Catalog

M4346

New Horizons Productions
Berethor ♦ beskhu3epnm ♦ blade2k5 ♦ dedgren ♦ dmscopio ♦ Ennedi
emilin ♦ Heblem ♦ jplumbley ♦ moganite ♦ M4346 ♦ papab2000
Shadow Assassin ♦ Tarkus ♦ wouanagaine

Bipin

Jeeze, that's crazy. I can't wait to try this out!

jmdude1

wow.... now 'that' is how to create a teaser. great work.