1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Gandalf (Wizard)

Discussion in 'Civ5 - Unit Graphics' started by Nomad or What, Jun 19, 2014.

  1. Civitar

    Civitar Adventurer

    Joined:
    Mar 23, 2014
    Messages:
    1,507
    Gender:
    Male
    Location:
    Switzerland
    @Pazyryk: I can't help you at all unless you explain what it is you are looking for. It seems from what you and Nutty are saying that you want to be able to have a "light from above" like the red, purple, white, and gold ones used in vanilla triggered on an empty plot by a unit not on that plot? Otherwise, I really don't know what you want. The only effects that to my knowledge can be made to go into another tile are missile and projectile effects such as the archer's arrow, city rocks, laser beams, :crazyeye:...
    But can you please just tell me exactly what it is that you want?
    EDIT: And oh yikes, did you get me wrong there. That pile of events you have are not event codes, which are used in the fxsxml and ftsxml. Event codes are numbers such as 1280, 1000, 2460, etc.
     
  2. Pazyryk

    Pazyryk Chieftain

    Joined:
    Jun 13, 2008
    Messages:
    3,584
    What I want is simply to apply any special effect of my choosing at any time on any plot based on any condition that I determine :).

    No, I didn't get you wrong. Units (and all other graphic objects) are calling on the graphics engine to draw themselves or fire off animations. Many of the Events in that list can also be used to send instructions to the graphics engine. However, this is all "black box" because we don't have access to the graphics engine source code and there is no documentation (seriously, no documentation other than that list). So everything we know about calling the graphics engine (which isn't much) has been learned entirely through trial and error. (Unlike xml table tags or Lua methods or GameEvents, all of which can be understood by looking at the dll source code.)

    So I'm not expecting an answer exactly, but rather probing for clues. Particularly here because I don't know much about art assets.

    But your post above gives me some likely integers to try in several different Events. Just a question though: are the numbers 1280, 1000, 2460 each uniquely associated with a specific animation? Or do these numbers get reused for different animations depending on the fxsxml and ftsxml? (For example, is 2460 only ever used for "blue flash"?)
     
  3. Nomad or What

    Nomad or What Wayfarer Supporter

    Joined:
    Nov 25, 2012
    Messages:
    686
    Location:
    Wherever the winds take me
    Most static effects use 1000. Referring back to the gems effect:

    Spoiler :
    <trigger type="FTimedTriggerEffect" id="1" time="0" duration="10" repeat="0" ec="1000" track="2" tier="0" event="ART_DEF_VEFFECT_GLITTERING_GEMS_01" bone="FX_Sparkle01" />


    ec="1000" represents event code 1000 for the effect in the .ftsxml. This is consistent with most static effects as far as I can tell. The event code defines not only the animation (for which there isn't one with a static effect), but also the sounds, effects, transfers, and actions as necessary. It can be as few as a single "track" (as with the gems effect) or several tracks (like a unit city attack torch projectile which consists of 5 sounds, 1 effect, and 1 transfer). Since gems do not have an animation (i.e., an invisible bone is used) then it is not defined in the .fxsxml file. I believe that event code 1000 is used for "animation-less" effects, since that is the equivalent to the "idle" animation for units.

    Event codes, effects, and .fxsxml/.ftsxml files are explained more clearly in my tutorial (or at least I hope they are...).
     
  4. Pazyryk

    Pazyryk Chieftain

    Joined:
    Jun 13, 2008
    Messages:
    3,584
    So those integers are not exactly unique, they are understood in context of the ftsxml file. In other words, if I knew the ftsxml file name and the EC code, then I would have defined the "effect" (the effect being some simple or complex sequence of animations and/or sounds). It's also very likely that the graphics engine holds some identifier for these that really is unique, although it may be hidden from us.

    The one thing I don't yet understand is whether all "effects" (the combined sound/animation) are always attached to an object (unit, improvment, etc.) or not.

    For example, you can use Events.GameplayFX(hex.x, hex.y, int) to get the combined "lights from above with sound" that you get with unit selection. This seems to be an "effect" just like the Prophet blue flash. But the former is "object free" and the latter is always connected to an object? It's possible that this is the case. But I still think that maybe these are the same kind of thing and we just don't know it. (As I said above, the int argument doesn't seem to matter if you supply some different random integers. But it's often the case in these methods that invalid inputs are converted to a default value. So perhaps that's all I'll ever get with this Event unless I know other valid numbers.)
     
  5. Nomad or What

    Nomad or What Wayfarer Supporter

    Joined:
    Nov 25, 2012
    Messages:
    686
    Location:
    Wherever the winds take me
    Perhaps it may be hidden, but it is consistent. For animations, the event codes correspond thus:

    Spoiler :

    1000 = IdleA
    1020 = IdleA_Trans_IdleB
    2000 = IdleB
    2020 = IdleB_Trans_IdleA
    1040 = FidgetA
    2040 = FidgetB
    1100 = AttackA
    2100 = AttackB
    1120 = Charge_Run
    1140 = Charge_Attack
    1160 = Attack_City
    1180 = Bombardment
    1200 = DeathA
    1220 = DeathA_Idle
    2200 = DeathB
    2220 = DeathB_Idle
    1280 = Bombard_Defense
    1285 = Bombard_Defense_Idle
    1290 = Bombard_Defense_Idle_Trans_IdleA
    1400 = Run
    1440 = Stop_Run
    2440 = Stop_Run_IdleB
    1450 = Shuffle
    1460 = TurnRunRight
    1480 = TurnRunLeft
    1500 = Fortify
    1520 = Fortify_Idle
    1540 = Fortify_Idle_Fidget
    1560 = Fortify_Idle_Trans_Combat_Ready_Idle
    1580 = Fortify_Idle_Trans_IdleA
    1600 = Combat_Ready
    1620 = Combat_Ready_Idle
    1640 = Combat_Ready_Idle_Trans_IdleA
    1700 = Aim_Left
    1705 = Aim_Right
    1710 = Aim_Center
    1800 = Victory


    Animations are defined in the .fxsxml file to correspond to DataGraph events (.dge files) which provide seamless animation sequences (and which is why custom animations always seem choppier - because they often have incomplete animations for CiV DataGraph events). The particulars for each event code are then further defined by tracks in the .ftsxml file (sounds, effects, transfers, actions).

    Static effects use no animations, so they do not have DataGraph events or animations defined in the .fxsxml file (only textures and bone assignments); tracks are defined for them in the .ftsxml file. They use event code 1000 by default because it is the "Idle" event code (since everything can be "idle," I suppose).

    My guess would be yes, but I am not certain. Regardless, I don't see any reason why you couldn't attach everything to an object. It seems like a much simpler process to me - although I am not a very skilled programmer, so what do I know? ;)
     
  6. Pazyryk

    Pazyryk Chieftain

    Joined:
    Jun 13, 2008
    Messages:
    3,584
    OK, but which of those codes correspond to the "blue flash" from a great prophet conversion? (I thought we had determined in post above that this was a unit animation.)

    It's just less of a kludge to do an effect directly. For example, lets say I have a Holy Hand Grenade. No, that's not it. Let's say I have a Holy Land Mind (HHG sounds better but is not as good as HLM for my illustration). When an enemy unit steps on my HLM, I want it to explode in a blue flash and, say, turn the enemy unit into an easter bunny. What I want is a single Lua line to achieve the blue flash. What I'll settle for (reluctantly) is 10 different "dummy" invisible units each with an effect (or perhaps 10 dummy improvements). Then when I want to apply one at a plot, I use 10 lines of Lua code to init the invisible unit (or place then invisible improvement), trigger animation with more Lua code, then add more Lua code to remove that invisible unit or improvement (careful to put back original improvement if there was one).

    I'm not above such kludgery. We use it to allow blight spread in the mod (getting around the fact that terrain and plot types won't update during gameplay).
     
  7. Nomad or What

    Nomad or What Wayfarer Supporter

    Joined:
    Nov 25, 2012
    Messages:
    686
    Location:
    Wherever the winds take me
    Apparently the event code is one that I did not list above.

    From the great_prophet.fxsxml file:

    Spoiler :
    <Animation file="Great_Prophet_Build.gr2" ec="1990"/>


    From the great_prophet.ftsxml file:

    Spoiler :

    <trigger type="FTimedTriggerEffect" id="1" time="1.342595" duration="0" repeat="0" ec="1990" track="2" event="ART_DEF_VEFFECT_RELIGION_ACTIVATE_FLASH" bone="WORLD_center" />


    Is it an animation? Yes and no. Technically it's not an animation - the Great Prophet's build movements are the animation (assigned event code 1990). The blue flash is an effect for that event code. The effect is tied to the GP's animation - but it doesn't need to be. You can apply the blue flash to anything you want.

    For example, you can create an invisible bone and assign the effect to that bone. Then, apply the blue flash event to correspond to event code 1000 (idle). When a unit steps on your Holy Land Mine, trigger the effect. Since "idle" is the only "animation" (not really since it is invisible and not defined), you plop it into the game when you want the effect triggered and it will display. Once complete, you remove it. I don't know Lua so I am not certain how you would go about doing this, but I think you understand my description of how it should work.

    Your completed .ftsxml code should look something like this:

    Spoiler :

    <trigger type="FTimedTriggerEffect" id="1" time="1.342595" duration="0" repeat="0" ec="1000" track="2" event="ART_DEF_VEFFECT_RELIGION_ACTIVATE_FLASH" bone="WORLD_center" />


    Note that the bone assignment is whatever name you decide to assign to the invisible bone. You can define as many effects as you wish to a single event.
     
  8. Civitar

    Civitar Adventurer

    Joined:
    Mar 23, 2014
    Messages:
    1,507
    Gender:
    Male
    Location:
    Switzerland
    That's the thing which I think you didn't get Pazyryk: There is no one event code that corresponds to any effect. You attach an effect to a certain event code, and that can be any event.
    If you want an effect like the HLM you described, you would definitely require some Lua swapping for a dummy rabbit to appear, have the blue flash trigger as he idles, then swap him out with the normal rabbit that looks identical, but does not have the blue flash.
    Kludgy, yes, but it's all I can think of right now.
     
  9. Nutty

    Nutty Chieftain

    Joined:
    Mar 9, 2011
    Messages:
    3,156
    Gender:
    Male
    Location:
    Orange County, California, U.S.A.
    Wait; I thought you wanted these effects for spells. Can't they be builds that don't do anything, giving you a user interface for free? Your wizard will just have several builds, each with different effects (e.g., worker animations use event codes Shovel=1910, Rake=1920, Axe=1930, Pickaxe=1940, Hammer=1950, Railroad=1960).

    EDIT: What connects the build to a given animation event?
    EDIT #2: Is it hardcoded?
    EDIT #3: If so, you could reuse the existing worker builds, then cancel the effect with Lua.
    EDIT #4: But then the icons would be wrong...

    Great People/Archaeologists/Prophets/Missionaries/etc.: Activate = 1990, Build_Activate/Activate_Idle = 1995
     
  10. Nomad or What

    Nomad or What Wayfarer Supporter

    Joined:
    Nov 25, 2012
    Messages:
    686
    Location:
    Wherever the winds take me
    Nope; any event code can be used for any event. You just have to define them in both files for what they are. The ones I listed above are the CiV standard to simplify defining them in both files. But you could use 9999 if you wanted; just define it in the .fxsxml and .ftsxml files to correspond with the animation (if there is one) and the resulting tracks (effects and sounds). I guess the 1900 series are used by CiV for civilian units, but use whatever code you want as long as you define it properly in the files. IMHO, sticking to the CiV standard is easier to remember and better as well if you are borrowing effects from other units.
     
  11. Nutty

    Nutty Chieftain

    Joined:
    Mar 9, 2011
    Messages:
    3,156
    Gender:
    Male
    Location:
    Orange County, California, U.S.A.
    That connects the effect with the animation, but how is the "Build" connected to the animation event code (i.e., can we create a new Build with a new [or old] EC)?
     
  12. Nomad or What

    Nomad or What Wayfarer Supporter

    Joined:
    Nov 25, 2012
    Messages:
    686
    Location:
    Wherever the winds take me
    Ah, I see what you are trying to say. Perhaps there is a connection, but I have no idea. I suppose from a programming perspective there would have to be a connection to tie an event to an animation file apart from a "random" event code. Otherwise, how does it know if it is running or idling? So maybe there is a connection, but once the connection is made you can manipulate the animation and effects in any way you wish.

    I think there is a black void in-between where you are elucidating what you want from a programming perspective and what I am explaining is possible from the animation/effect perspective. There is apparently a gap between the two in which neither of us completely understand at this point.
     
  13. Nutty

    Nutty Chieftain

    Joined:
    Mar 9, 2011
    Messages:
    3,156
    Gender:
    Male
    Location:
    Orange County, California, U.S.A.
    Based on looking through the db, you can reuse an EntityEvent and/or AnimationPath (I'm assuming one of which will have a hardcoded event code). Meaning you should be able to use a Mission or a Build for this...
     
  14. Nomad or What

    Nomad or What Wayfarer Supporter

    Joined:
    Nov 25, 2012
    Messages:
    686
    Location:
    Wherever the winds take me
    Well, the genius of using a dummy (invisible) unit can fortunately suffice until you can "build the perfect beast" so-to-speak. I would recommend using event code 1000 because we are certain that it is already used for CiV static effects. It would likely always remain visible (as static effects like the "sparkle" of gems are) so would have to be inserted and removed with appropriate timing.

    Considering that some things in CiV still haven't been figured out after years of trial and error, it is a boon that we can at least use a workaround if/until the dilemma is solved.

    My brain is full now - back to the mindless unit-conversion factory! :crazyeye:
     
  15. bouncymischa

    bouncymischa Synthetic Genie

    Joined:
    Nov 28, 2012
    Messages:
    1,537
    Location:
    In a bottle
    It is somewhat amusing that, once you get the hang of it, model conversion can be fairly straightforwards and relaxing. At least for me, converting building models into improvements has become easy enough that I finished my four mushroom patch models last night for my Forest of Magic civ.

    Now I just need witchy models~ :p

    (Someday I'll bite the bullet and try converting unit models... but even just doing effects modelling still intimidates me currently...)
     
  16. bouncymischa

    bouncymischa Synthetic Genie

    Joined:
    Nov 28, 2012
    Messages:
    1,537
    Location:
    In a bottle
    Figured that I would give this thread a bump... my Forest of Magic civ appears to be nearing completion, and while I've been using the Gandalf for my Witch unit for the time being, it'd be nice to have a somewhat more feminine-looking version when I publish it. I suspect the usual fantasy modders are quite busy these days, but I was wondering if it would be difficult to remove the beards on the Gandalf model? I'm not entirely sure how to convert the .gr2 to a blender file to edit, and would be worried about messing up something if I tried to do it myself... <.<;
     
  17. Zaelon

    Zaelon Chieftain

    Joined:
    Nov 1, 2010
    Messages:
    103
    Hi !

    I'm currently working on a fantasy reconversion of civ5 and I'd like to use your wizard unit because it looks awesome :) (I am sadly no 3D artist at all).
    I was wondering if there was any chance that there existed a female version of that mage (beardless, busty and using the same kind of animation sets).

    Regards
     
  18. Civitar

    Civitar Adventurer

    Joined:
    Mar 23, 2014
    Messages:
    1,507
    Gender:
    Male
    Location:
    Switzerland
  19. Zaelon

    Zaelon Chieftain

    Joined:
    Nov 1, 2010
    Messages:
    103
    Wow, thank you for the reply :D
     
  20. Zaelon

    Zaelon Chieftain

    Joined:
    Nov 1, 2010
    Messages:
    103
    I am wondering if there is something I missed about how to use these models (the wizard or the sorceress), since neither seem to be firing ranged combat animations when used in my mod. The models display properly otherwise.

    I loaded the art files into vfs and copy-pasted the XML, is there any other step I am missing ?
    Sorry if this is a stupid question :p

    Thanks in advance,
    Regards
     

Share This Page