Aller au contenu

Photo

Convert a placeable to a creature?


  • Veuillez vous connecter pour répondre
66 réponses à ce sujet

#26
Loki_999

Loki_999
  • Members
  • 430 messages

Looking good.

 

Not sure why the lack of an OnAttack event is a problem. Depending on how it needs to be designed to work it can use either OnPerception or OnHeartbeat.  If need to store last target, can store it as a var on the creature.  If you meant there is no OnAttacked event, then there is the OnPhysicalAttacked and OnSpellCastAt events.

 

Or am i misunderstanding the problem?



#27
Loki_999

Loki_999
  • Members
  • 430 messages

And there are a couple of options i have in mind for how it can work with PCs.  One option is to use the onconvo event, but that means the PC cannot be in combat, but that is fair enough.  The other it just to let its heartbeat handle things.



#28
4760

4760
  • Members
  • 1 204 messages

Depending on how it needs to be designed to work it can use either OnPerception or OnHeartbeat.

Sure, but if we use OnPerception, then it's the last entering enemy that will become the target. Or only the first if we decide to do nothing more if GetIsInCombat() returns TRUE.

 

The other it just to let its heartbeat handle things.

Yes, I had thought about that as well, but then the rock would be thrown only every 6 s, not each time the catapult attacks (I know there are ways to increase the frequency, but the idea is to just place the catapult in the area and everything works without any other tinkering).
 
Not sure why the lack of an OnAttack event is a problem.
Or am i misunderstanding the problem?

Basically, the "problem" is simple: how to throw a rock from the catapult towards the target?

The answer is sometimes as simple as the question: if it is during a cutscene, or decided by a trigger, all that is required is to set object oTarget = GetEnteringObject() (or the speaker, or GetObjectByTag, etc.)

 

For a stealthy approach that didn't work, the OnPerception event will do fine too I guess.

 

But how do I link the attack animation and the rock throw (simulated by a spell) automatically (i.e. the catapult is on the enemy side, which means the player doesn't select the target)?

GetTarget() and GetAttemptedTarget functions did sound nice, but are set to OBJECT_INVALID before the end of combat round event.

 

There's still an option I didn't try yet: change the combat stance from UNA to THRN, and see how it works.

But first, I'll check if I get better results with bkAcquireTarget (as it normally chooses the same target as the previous round, except if it's dead or gone, that should work for what I'm looking for).



#29
4760

4760
  • Members
  • 1 204 messages

if I get better results with bkAcquireTarget (as it normally chooses the same target as the previous round, except if it's dead or gone, that should work for what I'm looking for).

Almost got it working: when it doesn't crash, it's working fine. I'll rework the special effects and that should do it.



#30
kamal_

kamal_
  • Members
  • 5 240 messages

when it doesn't crash, it's working fine.

I think I have a new line for my sig.


  • rjshae aime ceci

#31
4760

4760
  • Members
  • 1 204 messages

:D Don't forget the copyrights!

 

You probably understood that it means it's a random bug. I hope I'll be able to fix it (it doesn't come from the special effect, as it crashes with a different one - which works normally; and the creature animation also works. But both together and the game crashes  :( )



#32
Loki_999

Loki_999
  • Members
  • 430 messages

Interesting stuff.



#33
4760

4760
  • Members
  • 1 204 messages

Will you believe it? I added all the attachment points, and forgot to re-export the animations (truly, a 10 km race really clears the mind!)

Here's the result:

901-1-1410714822.jpg

 

As you can see, I used the earthquake spell to show the impact of the rock (with the fx_rockslide.sef effect for the dust and sound), but this can easily be changed in the spells.2da.


  • rjshae aime ceci

#34
Loki_999

Loki_999
  • Members
  • 430 messages

Absolutely brilliant. So its in effect (haha, pun intended) its finished?



#35
4760

4760
  • Members
  • 1 204 messages

Not yet, the rock doesn't come from the catapult but from the corner of the map. I need to check the 2da and the gr2 to see where the reason for this is, but it's close to completion.



#36
Loki_999

Loki_999
  • Members
  • 430 messages

Ah, yeah, that would look a little strange. Perhaps there are some super strength gnomes that throw rocks from off the edge of the map!



#37
Dann-J

Dann-J
  • Members
  • 3 161 messages

Not yet, the rock doesn't come from the catapult but from the corner of the map. I need to check the 2da and the gr2 to see where the reason for this is, but it's close to completion.

 

That means the creature lacks the node that the spell is using as an origin point. It happens a lot with the demi-lich, since many spells use the right hand node, yet the demi-lich skeleton has no hands.



#38
4760

4760
  • Members
  • 1 204 messages

That means the creature lacks the node that the spell is using as an origin point. It happens a lot with the demi-lich, since many spells use the right hand node, yet the demi-lich skeleton has no hands.

I checked and re-checked, even merged the ap_right_hand object from a previous creature I made (and which works as expected) to make sure: the catapult does have the origin point in place. The spells.2da refers to rhand as the origin point. As far as I can tell, everything is as it is supposed to be, but the rock still comes from nowhere.



#39
Loki_999

Loki_999
  • Members
  • 430 messages

What about setting a different origin then in spell.2da? Maybe something weird about that node?  eg: monster0, monster1, etc. Those exist on the beholder model done by RWS. Also head or halo are valid according to my version of spells.2da.

 

No idea what i'm talking about really, but always thought as long as the node exists on the model and the 2da matches a valid node then it will work.  But as you mention ap_right_hand referring to rhand in the 2da, i guess that means there is some sort of lookup that exists... or does your model node need to ap_rhand?

 

Maybe ap_right_hand only refers to nodes for hooking equipped items to, not spells?  Have you checked your previous creature to see if they fire spells correctly?



#40
4760

4760
  • Members
  • 1 204 messages

Have you checked your previous creature to see if they fire spells correctly?

Yes, and it fires spells correctly.

Thanks for the advice though: I now know for certain that there is something missing in the catapult nodes (although I copied/pasted the same from the creature that fires spells correctly).



#41
4760

4760
  • Members
  • 1 204 messages

We're progressing:

901-1-1410957201.jpg

 

The final problem to solve now regards synchronisation (sometimes, the rock is not fired). I'm quite sure it's got something to do with the action queue (normal attack vs spell), so I'm now looking at a thrown weapon instead of a spell.


  • rjshae aime ceci

#42
Loki_999

Loki_999
  • Members
  • 430 messages

Hmm... timing might be solved by putting the spell in a DoCommand rather than AssignCommand (or the other way around)?  As i recall, one puts the action to the front of the action queue (ie: execute immediately) and the other puts in the queue.

 

Also, don't thrown weapons have fixed trajectory? ie: straight line?

 

When you say sometimes, can you put a percentage to that?



#43
4760

4760
  • Members
  • 1 204 messages

Hmm... timing might be solved by putting the spell in a DoCommand rather than AssignCommand

Thanks! "Casting the spell" with ActionDoCommand did it (although there's a slight delay between the end of the animation and the start of the throw)

 

 

 

901-1-1410965109.jpg

 

By the way, the latest files are here. I'll upload them on Nexus and the new Vault later (so you could beta test!  ;) )



#44
Loki_999

Loki_999
  • Members
  • 430 messages

Brilliant! Itching to give it a go.



#45
4760

4760
  • Members
  • 1 204 messages

the latest files are here. I'll upload them on Nexus and the new Vault later (so you could beta test!  ;) )

 

Brilliant! Itching to give it a go.

I edited my previous post: the files are already available (see link above), in override version only at this time.

 

What I meant was that I would wait a few days before preparing an official release (with a hak too).

 

By the way, the spell is at line 1505 in spells.2da (in case you're already working with a customs spells.2da), the catapult is at line 2080 in appearances.2da (due to two empty lines + titles + first row numbered 0, you'll find it at line 2084 in any text editor). I also created a projectile in baseitems.2da at line 204, but only the trail is visible (same as for bullets or darts,, but those being very small, it was not an issue - for a catapult projectile, you'd expect to see the rock too!) so it's only a leftover from the tests I made. The good thing is that you can still use it to have the catapult armed or not.



#46
Loki_999

Loki_999
  • Members
  • 430 messages

Great.  Will take a look as soon as i can. May have to wait for the weekend though.



#47
Loki_999

Loki_999
  • Members
  • 430 messages

Gave it a quick test. Highly amusing, made it an NPC and set it to hostile.  Being chased by a catapult is highly amusing.

 

However, while the rock appeared to load in the catapult fine, the spell when it fired did no projectile. Or any effect except the damage.

 

As i undestood, it should also do an earthquake like effect on impact, which also didn't fire.

 

I suspect then it was making a melee attack instead of the ranged spell... i think its the AI choosing this instead of being clever and using the ranged attack.

 

How did you set it up so that the creature used the ranged attack?  Or did you control it yourself like a PC?  IN which case, how did you get the spell to fire?



#48
4760

4760
  • Members
  • 1 204 messages

made it an NPC and set it to hostile.[...]

Did you create it from an existing blueprint, without updating the standard scripts?

 

What you describe is exactly what happens when the catapult uses the usual AI.

 

How did you set it up so that the creature used the ranged attack?

I changed the HeartBeat script (c_catapult_heartbeat) so the attack is overriden by c_catapult_attack.

When it dies, I also replace it by the destroyed catapult placeable, using c_catapult_damaged instead of the usual OnDamaged script.

 

If you did use the blueprint I provided, then it's likely there's another spells.2da in your override taking precedence with the one I made (which would explain why spell ID 1505 doesn't fire: it cannot be found!)



#49
Loki_999

Loki_999
  • Members
  • 430 messages

Used your blueprint, it had the scripts attached, and after it didn't work initially, i imported the scripts into my build module and compiled them there just to see if that would fix it.

 

I can confirm there is no other spells.2da overriding it.

 

Ill take another look, perhaps tomorrow evening if i get the chance. Possible i missed something.



#50
4760

4760
  • Members
  • 1 204 messages

I'm wondering: do you attack it at close range, with a melee weapon? If that is the case, the catapult will probably use its melee attack (same as when throwing the rock, but without any rock!) I'm asking because I just noticed it happen while checking if I forgot to include anything in the rar file.