Missiles take a turn to start moving

If you have a module that you'd like comments on or would like to know how to create your very own module, post here

Moderator: Moderator

Post Reply
Message
Author
Kemsha
Higher
Posts: 58
Joined: Thu Aug 26, 2010 3:46 pm

Missiles take a turn to start moving

#1 Post by Kemsha »

Hi guys,

so, I'm having this problem but have no ideia where to start looking.
I'm using a ranged talent ("T_SHOOT" for instance) but the missile stays in my square. It only moves in the next round, after I do something. I first tought about projectile speed or something but it seems to be working allright, just a turn later

Any help would be appreciated, thx.

HousePet
Perspiring Physicist
Posts: 6188
Joined: Sun Sep 09, 2012 7:43 am

Re: Missiles take a turn to start moving

#2 Post by HousePet »

Context would really help here, especially since this is a forum for discussing Modules make for running in the T4 Engine, not any specific game.
My feedback meter decays into coding. Give me feedback and I make mods.

Cathbald
Uruivellas
Posts: 743
Joined: Wed Jan 22, 2014 1:46 pm

Re: Missiles take a turn to start moving

#3 Post by Cathbald »

this is normal, and the way all projectiles work in ToME.

First, your projectile need to have energy when you create it, otherwise it won't act until it has enough energy.
Second you need to ask it to act() after you're done instanciating it, otherwise even with energy it won't act until the next tick.

The most glaring in vanilla are called shots which say they're instant but are not despite having a huge amount of speed, and coupled with their weird targeting make them miss enemies more often than they hit.
I write guides and make addons too now, apparently

You can go here for a compilation of everything I wrote, plus some other important stuff!

Includes general guides (inscriptions, zone, prodigies), and class guides (Demo, Anorithil, Bulwark, Zerker, Sblade)

Kemsha
Higher
Posts: 58
Joined: Thu Aug 26, 2010 3:46 pm

Re: Missiles take a turn to start moving

#4 Post by Kemsha »

Thanks for the reply

I'm basically copying TOME so I use archeryShoot and all that, I didn't change the talents
Any ideias why it's acting this way? Could it have something to do with the main character himself? This module has several characters and I choose which one goes to the dungeon. Maybe when I switch "main" characters I have to do something to their energy or somesuch

Thanks again

HousePet
Perspiring Physicist
Posts: 6188
Joined: Sun Sep 09, 2012 7:43 am

Re: Missiles take a turn to start moving

#5 Post by HousePet »

Three options.
1: The created projectile does not have enough Energy to move when immediately fired.
2: The T_SHOOT action is not costing Energy.
3: The actor using T_SHOOT has so much Energy that they are getting another action before anything else happens.
My feedback meter decays into coding. Give me feedback and I make mods.

Kemsha
Higher
Posts: 58
Joined: Thu Aug 26, 2010 3:46 pm

Re: Missiles take a turn to start moving

#6 Post by Kemsha »

I finally got around to test it and... it worked!

I didn't quite understood why did I have to explicitely force the projectile to act but it works and that's what matters

Thanks a lot

Post Reply