Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Feature request (https://forums.graalonline.com/forums/forumdisplay.php?f=194)
-   -   Projectiles should ignore fences (https://forums.graalonline.com/forums/showthread.php?t=134257263)

DustyPorViva 12-11-2009 11:05 PM

Projectiles should ignore fences
 
Projectiles that are shot like classic arrows(flat and horizontal) should also ignore fences like default arrows.

cbk1994 12-12-2009 02:02 AM

It's possible to script by designating a certain tile type as a wall using a custom movement system (since then projectiles will still think it's not a wall), though I guess that's not a lot of help.

Crow 12-12-2009 11:14 AM

Quote:

Originally Posted by cbk1994 (Post 1543807)
It's possible to script by designating a certain tile type as a wall using a custom movement system (since then projectiles will still think it's not a wall)

:p

Tigairius 12-12-2009 12:04 PM

This is a crazy work-around, and I'm not sure if there is a better way, but you could probably do something like this:
PHP Code:

//#CLIENTSIDE
function onCreated() {
  
onTimeout();
}

function 
onTimeout() {
  for (
temp.pprojectiles) {
    if (
tiles[temp.p.vecx(temp.p.params[0]),
        
temp.p.vecy(temp.p.params[0])] == 3271) {
        
tiles[temp.p.vecx(temp.p.params[0]),
        
temp.p.vecy(temp.p.params[0])] = 0;
        
updateboard(temp.p.xtemp.p.y22);
    }
    
    if (
tiles[temp.p.vecx((temp.p.params[0] + 2) [PERCENT4),
        
temp.p.vecy((temp.p.params[0] + 2) [PERCENT4)] == 0) {
        
tiles[temp.p.vecx((temp.p.params[0] + 2) [PERCENT4),
        
temp.p.vecy((temp.p.params[0] + 2) [PERCENT4)] = 3271;
        
updateboard(temp.p.xtemp.p.y22);
    }
  }
  
setTimer(0.05);


But it's probably pretty intensive, could probably be optimized.
All that's doing is finding projectiles in the level and if they are about to hit tile "3271", replace it with tile "0", and then if they just passed tile "0" replace it with "3271".

If you wanted to use this technique, of course, you'd have to apply a small flag to the projectile somehow or something to make sure you're not replacing a correctly placed tile 0 with 3271 on accident.

Note: 3271 is just a random tile. This also requires that your shootparams[0] are set to the direction the player was facing when he fired the projectile.

12171217 12-15-2009 07:34 PM

Why don't you move the projectile up a bit on the Z axis instead of removing the fence? :0

Assuming, of course, that you can move projectiles clientside, which I see no reason why not, considering they are entirely clientside.

Crow 12-15-2009 07:54 PM

Quote:

Originally Posted by 12171217 (Post 1544534)
Why don't you move the projectile up a bit on the Z axis instead of removing the fence? :0

Assuming, of course, that you can move projectiles clientside, which I see no reason why not, considering they are entirely clientside.

Because then they wouldn't crash into any other walls. I suggest doing what Chris said until there's another solution. I did it on Era with tiletypes 9 and 10 if I recall correctly. Some lava stuff. More than enough tiles for the shoot-through-tables-idea I had. I can deliver some functions to assist you if you wish.

12171217 12-16-2009 12:32 AM

I meant move the projectiles up on the Z axis in a timeout loop when they're about to hit a wall tile-type that's excluded, then move it back down when it passes.

Alternatively, one could start the projectile with a Z value, then snap it to the floor when it hits a wall, unless that wall tile-type is excluded.

This is all assuming that you can even interact with projectiles after they're spawned. Otherwise, you could write your own projectile handler.

DustyPorViva 12-16-2009 12:38 AM

I don't think you can really edit projectile vars.


All times are GMT +2. The time now is 11:30 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.