Repository navigation
Conversation
|
Hi, @Solessfir !
I'm sorry, but it generally wrong: engine has to execute based on spell/effect descriptors such as |
9b07d32 to
da9aea8
Compare
|
Good point, thanks! Switched it to the spell id. In vanilla G1 this one is hardcoded too: the engine moves the item for spell id 10 ( Same approach as the existing |
ffe8103 to
c83dac1
Compare
|
@Solessfir thank you for this PR, a spell long missing in OpenGothic! I have tested it using the statuette in orc city. When the caster looks into the general direction of an item with Telekinesis spell wielding, it takes items into focus automatically and at a much larger range than usual, even if it is out of the screen on top, item still focused, item name still visible.
Fair if missing, I thing OpenGothic spells can as of now only track NPCs as target (see
This is is in playercontrol the item is raised to head height but then moves to side only, never lower.
@Try Do you think this is an engine gap? Items up to 3000 units away ( Details``` template bool WorldObjects::testObj(T &src, const Npc &pl, const WorldObjects::SearchOpt &opt,float& rlen){ const float qmax = opt.rangeMax*opt.rangeMax; const float qmin = opt.rangeMin*opt.rangeMin; const float plAng = pl.rotationRad(); const float ang = float(std::cos(double(opt.azi)*M_PI/180.0));auto& npc=deref(src); if(!checkFlag(npc,opt.flags)) float l = pl.qDistTo(npc); auto pos = npc.position(); if(std::cos(plAng-angle)<ang && !bool(opt.flags&SearchFlg::NoAngle)) l = std::sqrt(l); |
c83dac1 to
6a15e11
Compare
|
@Abendlied thanks for testing! I compared everything with the original Gothic 1 and reworked the PR.
I rechecked the movement and updated the PR. Holding the cast lifts the item and draws it toward the hero. The pull stops about a meter away while the item keeps rising. Left and Right steer it sideways, and releasing the cast drops it for normal pickup.
The original doesn't cast without an item in focus, the hero just shrugs. The PR now does that too, so no mana is spent on nothing.
Agreed, spell effects can only bind to an NPC target right now, so this needs an item target first. I'd do it as a follow-up.
The range comes from |
6a15e11 to
5e15445
Compare
5e15445 to
6e06d84
Compare
6e06d84 to
1990502
Compare
Implement item movement for Gothic I Telekinesis (#661, item 3). The Gothic I script handles mana investment, and the engine moves the focused item.
Built OpenGothic and Spacer. In Gothic I, tested three consecutive casts, including brief casts, and verified the hero lowers his hands after the final scroll. Quicksaving during a lift consumed one scroll both when continuing and after loading the save.