-
Posts
61 -
Joined
-
Last visited
Phoenix4646's Achievements
Discens (2/14)
1
Reputation
-
Thing is, I did create a GetClipSize() function, otherwise the stuff I added to the ''ATTACKING'' state wouldn't work which is why this confuses me. It doesn't throw any errors there and works fine, but everytime it's in the Init function it would just give errors.
-
Alright, now I get another error. var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); this.clipSize = cmpAttack.GetClipSize("Ranged"); this.actualclip = this.clipSize.clipsize; warn("this was just run!");I've added this to UnitAI.prototype.Init (the warning was only for me to see when the code is run). I'm getting no problems when I am trying to control one unit (but the ''warn''-print doesn't appear), but as soon as I try to control multiple units, my commands aren't issued and I get this error: ERROR: Script message handler OnCreate failedERROR: JavaScript error: simulation/components/UnitAI.js line 3193 TypeError: cmpAttack.GetClipSize is not a function UnitAI.prototype.Init@simulation/components/UnitAI.js:3193:2 GetFormationUnitAIs@simulation/helpers/Commands.js:1402:8 commands.walk@simulation/helpers/Commands.js:116:3 ProcessCommand@simulation/helpers/Commands.js:37:3ERROR: Failed to call ProcessCommand() global script functionWhen I remove all my additions except the warning, the warning appears whenever I create a new group by selecting multiple units and issuing a command (but only on the first command issued). EDIT:: and what is done here? var cmpTimer = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer); this.lastAttacked = cmpTimer.GetTime() - msg.lateness;What is msg.lateness? How can I modify the repeat time to be different under certain circumstances in the "Timer" part?
-
That is exactly what I've done The problem I have is with implementing the variable actualclip, e.g. the variable that defines how much ammo is left in the clip. ClipSize only defines the maximum ammo that the clip will have. Now I have no idea how I can create such a variable in the code. Or should I just do another entry for that in the Ranged Attack component? Can you even modify values in those components on the fly without it accidently acting like a tech or something like that?
-
Alright then! I got almost everything set up in UnitAI.js, I'm only having one problem. I do not know where to put the variable this.actualclip; when putting it at the start of the file (after "function UnitAI() {}" of course) the game tells me that there's a "missing variable name" and if I don't put it anywhere the variable is ''undefined'' (which makes sense of course). As a tinkerer, this is where my little coding knowledge is already at a loss.
-
Derp... my bad. I tried to write ''Integer'' with a capital letter at the beginning. Thank you. And one more thing, about particle effects. Right now when I use a particle effect it needs to fade in first which is fine, but I need the effect to fade in faster than it usually does. Is there any way to manipulate that yet?
-
Back with another thing I wanted to implement clips for (ranged) units and took a look at attack.js. Now, what I wanted to do was add two other things (excuse my untechnical gibberish - maybe someone could educate me ) called ClipSize and ReloadTime, contained in the same block where RepeatTime is defined. Then, when the unit is created, another variable called actualclip (or whatever you want to call it) will be set equal to ClipSize. After that, whenever the unit fires, it subtracts 1 from actualclip until it is 0. When that happens, the unit uses ReloadTime instead of RepeatTime once and sets actualclip equal to ClipSize again. However, the only thing concerning RepeatTime I found was "Attack.prototype.GetTimers", which applies the Repeat- and PrepareTimes. GetTimers is used nowhere in the whole file though. Is this one of those things that is mainly done in the engine? EDIT:: Oh yeah, and I looked at the datatypes available for schemas. So there's only positiveInteger and nonNegativeInteger. So is there no way to use a value of -1 anyway, or would I need to use ''text''?
-
@niektb: No, I couldn't find these links. Thanks for the almost instant reply And sorry for my late one, I already saw your post 10 minutes after but I thought I'd post again once questions regarding the process come up ... and stuff looked complicated so I thought I'd get to animating later. And then I forgot to atleast say thanks @LordGood: Yeah, I'm familiar with how the audio system in 0 AD works, that was not the problem. The problem is that attack sounds aren't played if there isn't an animation specified for attacking (you can even use an idle animation for it, it's just about having an animation *at all*). The question was if there was some workaround to get the sound to play without specifying an animation (towers and fortresses (structures) play the attack sound nonetheless while balistas and catapults (units) without an animation don't comply (for that, either check the old alphas where they didn't have attack animations or remove the attack animations from the actors for testing)), and if there's no way of doing that, then I'd need to know how to make animations for 0 AD and if they need to be in the weird .psa format (which already got answered above ). But thanks for the answer
-
So I've made some placeholder models and I've been trying to implement them into 0 AD which worked fine so far. The only problem I have is with the attack sound. As everyone knows, the attack sound of a unit won't be played if the actor has no attack animation set. Now my first question would be is it still possible to somehow get the game to play the sound? And how do I export .psa animations in blender that work in 0 AD? The .psa addons in blender are for the Unreal Engine model formats and I couldn't find anything about animations in 0 AD.
-
Ah, got it. Alright then!
-
Works like a charm, thanks a lot! While talking about civic centres, are Or-requirements for templates similar to technology requirements possible yet? I'd like to be able to build only one civic centre when I got none and as many as I want once I reach the third phase. Also I'm looking for the file where the standard playercolors are set because I'd like to adjust some of them and I've been searching through a lot of files but found nothing.Where are they located at? And what about unit limits? How can I set up a units' / buildings' limit so it can only be created x times at the same time? I've only seen the BuildRestrictions and TrainingRestrictions stuff which included setting a category, but I'd be thankful if someone could explain how this works.
-
Yes, right now I'm trying to do that in specific scenarios. Although sometime later on I'd also like to implement a ''starting age'' setting into the match setup, but not right now So, any ideas?
-
So I've been making some scenarios again and now I wondered if it is possible to have some technologies already researched when the game starts, e.g. already being in Town Phase. I was thinking about if that could be implemented in the maps' script?
-
Oh well, I was going to name my Mod ''Ancient Empires''... but seems like I wasn't fast enough
-
I haven't implemented anything related to converting yet, I've only been messing around with the convert cheat for testing stuff and then I noticed the experience bar thing. But if I ever plan on adding conversion I think it'd be useful if some stuff already worked I didn't even know about that mod. For how long has that one been around?
-
Yeah, I'm aware that it's only a temporary workaround. I was talking about a workaround for the GUI problem only (the experience bar that expands endlessly when RequiredXP is 0). I just felt like saying what I've done because I thought it might help others for the time being, you never know I cannot get the promotion bug to happen again though. Once a converted unit kills anything (= gains some XP) he gets promoted. Maybe when I took the screenshot I converted a slinger that already had gotten XP prior to converting. Or were you unable to get them promoted afterwards? I'm absolutely sure that I haven't changed anything since I'm testing that without mods (except the mod that adds the promotion tech back in the game so I could test it). And sorry about the duplicate.