Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - daniel

#21
hm, yes "room_RepExec()" is linked through the editor. everything seems to be fine.
does it matter where in the script file the "room_RepExec()" is located?
because right now it's at the very bottom...
#22
hey guys,

so i just put in the code and thought i'd report back with the results.

it works fine but for some reason only in "repeatedly_execute_always()"...? when i put it in "room_RepExec()" nothing happened.
i also had to adjust the timer setting. it seems there's some weirdness going on with the tweenImage timing...when it's set to 0.5 it actually takes a second to complete the tween.
maybe the timing is on a "per image" basis? which doesn't really make sense since both images tween at the same time...oh well:D

anyway here's what i'm using now and it looks nice

Code: ags
unction repeatedly_execute_always()
{  
  if (IsTimerExpired(GlitterTimer)){
    glitterFrame = (glitterFrame + 1) % 4;
    oGlitter.TweenImage(oGlitterEmpty, 0.25, 376 + glitterFrame, eEaseLinearTween, eNoBlockTween);
    SetTimer(GlitterTimer, GetGameSpeed()/2);
  }
  if (IsTimerExpired(SmokeTimer)){
    smokeFrame = (smokeFrame + 1) % 7;
    oChimneySmoke.TweenImage(oSmokeEmpty, 0.5, 382 + smokeFrame, eEaseLinearTween, eNoBlockTween);
    SetTimer(SmokeTimer, GetGameSpeed());
  }
}


thanks again for your help!
#23
thanks guys, i think i got it now
i've always been more of a "right hemisphere of the brain" kind of guy:D
#24
thanks snarky!
i'm not 100% sure i understood the maths behind it but at least now i know what it does:)
#25
thanks chris,

i'll give this a try as soon as i get the time...

i hate to be a bother but could you explain to me briefly what the "%" remainder does in the code?
i looked in the AGS help but didn't find anything...
#26
Quote from: Cassiebsg on Wed 17/05/2017 18:29:19
I'm not familiar with the tween module this much, but have you tried to set all tweens but the last to NoBlock? Usually works for normal animations, so maybe it'll work with the tween too?

thanks cassiebsg,

yes i've tried that and it doesn't work unfortunately. i'm a total noob myself but i think the problem is that, if there is no block or some kind of variable that switches the tweens on and off the RepExec just keeps spawning new tweens every frame. so basically you don't see anything happening because none of the tweens (other than the ones with the block set) are ever executed before the next one gets thrown on top.
also the game then crashes because it's exceeding the 64 tweens limit...
#27
hey guys,

i've hit another snag and this question is kind of related so i'll just post it here and hope somebody will find it:D

anyway i have multiple animations in a background that i would like to tween (TweenImage) in order to make them look smoother.
however since these are endless loops i tried placing them in "function room_RepExec()" like this:

Code: ags

  oGlitter.TweenImage(oGlitterEmpty, 0.5, 377, eEaseLinearTween, eBlockTween); 
  oGlitter.TweenImage(oGlitterEmpty, 0.5, 378, eEaseLinearTween, eBlockTween);
  oGlitter.TweenImage(oGlitterEmpty, 0.5, 379, eEaseLinearTween, eBlockTween);
  oGlitter.TweenImage(oGlitterEmpty, 0.5, 376, eEaseLinearTween, eBlockTween);

  oChimneySmoke.TweenImage(oSmokeEmpty, 0.5, 383, eEaseLinearTween, eBlockTween);
  oChimneySmoke.TweenImage(oSmokeEmpty, 0.5, 384, eEaseLinearTween, eBlockTween);
  oChimneySmoke.TweenImage(oSmokeEmpty, 0.5, 385, eEaseLinearTween, eBlockTween);
  oChimneySmoke.TweenImage(oSmokeEmpty, 0.5, 386, eEaseLinearTween, eBlockTween);
  oChimneySmoke.TweenImage(oSmokeEmpty, 0.5, 387, eEaseLinearTween, eBlockTween);
  oChimneySmoke.TweenImage(oSmokeEmpty, 0.5, 388, eEaseLinearTween, eBlockTween);
  oChimneySmoke.TweenImage(oSmokeEmpty, 0.5, 382, eEaseLinearTween, eBlockTween);


which of course doesn't work since one animation is blocking the other and they run in sequence instead of simultaneously.
i tried using "eNoBlockTween" with delays set for each tween and somehow setting a variable to check if a tween is playing but failed completely.
i also tried setting it up outside of "function room_RepExec()" using tween delays and a timer...couldn't get that to work either:(

any ideas?
#28
hehe...thx khris, you're right of course. it all starts making sense now:)
#29
thanks for your help again snarky:)

in the end i just used the viewportX position as the flag:

Code: ags
if ((player.x>300)&&(ViewportX==10)){
      TweenViewportX(2.0, 210, eEaseInOutSineTween, eNoBlockTween);
      ViewportX=210;
  }
  if ((player.x<300)&&(ViewportX==210)){
      TweenViewportX(2.0, 10, eEaseInOutSineTween, eNoBlockTween);
      ViewportX=10;
  }


took me a while to figure out that tweening the viewport to a certain X position doesn't seem to actually "set" the viewport to that position which is why i still kept getting overflows all the time (and when using block the tween would keep blocking forever).
#30
hey guys,

i have a scrolling background with a doorway and i want it to scroll over all the way only when the character walks into/through the doorway.
right now i'm using this:

Code: ags

function room_RepExec()
{
  //Viewport Scroll
  if (player.x > 300) {
    while (ViewportX < 250) {
    ViewportX = (ViewportX) +5;
    SetViewport(ViewportX, 0);
    Wait (1);
    }
  }
  else {
    while (ViewportX > 10) {
    ViewportX = (ViewportX) -5;
    SetViewport(ViewportX, 0);
    Wait (1);
    }
  }


this works totally fine actually but yesterday i discovered the magic that is the tween module and thought some easeInOut is exactly what that scrolling needs.
once i put in the tween though i get the "more than 64 tweens" error and the game crashes. which made me realize that this is probably a bad way to check if the scroll should be executed at all.

setting the check to a specific coordinate like
Code: ags
if (player.x == 300)
doesn't work since that only seems to click if the character stops at exactly 300 X. also if the player would leave the character standing on that coordinate a while the game would crash again i suppose.
is there a way to check if the character started at a certain point < 300 and then stopped at a point > 300 so that the code only gets executed once when needed?
or is there some other smart way of doing this?

thanks!
#31
thanks guys,

@dayowlron
i tried your solution and the result is similar to what i get if i just used "if" statements...the BG fades in and then nothing more happens

@Khris
your solution works, however it's still missing the downward movement for "oLogoExtra" from 0 to 30 along the Y axis...also it seems to me it's very tricky to adjust animation speed for each element using this method?

@abstauber
thanks for the recommendation. i'm gonna take a look at that module...it sounds pretty neat.

EDIT:
got it. thanks for the code snarky.
i just added this to tween the logoExtra along the Y...also had to set the fadeIn to noBlock
Code: ags
oLogoExtra.TweenY(2.5, 30, eEaseInOutSineTween, eNoBlockTween, 1.25);
#32
hi,

i'm trying to animate my 2-part logo on the title screen.

what i'd like to do is:
1. fade in the BG from black. (i'm using a black object and fade it to 100% transparency because i couldn't get the FadeIn and FadeOut to work without the BG flashing on the screen for a second at the start)
2. fade in the main logo
3. once the main logo is at 50% transparency start fading in the second part of the logo while it's moving down into position along Y

when i put this code into function room_RepExec() it just executes one command after the another:

Code: ags
int BlackoutTrans = oBlackout.Transparency;
int LogoTrans = oLogo.Transparency;
int LogoExtraTrans = oLogoExtra.Transparency;

  while (BlackoutTrans < 100){
    BlackoutTrans++;
    oBlackout.Transparency = BlackoutTrans;
    Wait(1);
  }
    
  while ((BlackoutTrans == 100)&&(LogoTrans > 0)){
    LogoTrans--;
    oLogo.Transparency = LogoTrans;
    Wait(1);
  }
  
  while ((LogoTrans < 50)&&(LogoExtraTrans > 0)){
    LogoExtraTrans--;
    oLogoExtra.Transparency = LogoExtraTrans;
    Wait(1);
  }
  
  while ((LogoTrans < 50)&&(oLogoExtra.Y < 30)){
    oLogoExtra.Y++;
    Wait(1);
  }


how can i execute all of these at the same time without them blocking each other?
when i use "if" instead of "when" the script stops after the blackout is at 100% transparency.
so, once again my noob skills have failed me...

cheers
#33
Quote from: Mandle on Fri 12/05/2017 15:41:55
Snarky, your pointer tutorial should go in the manual!

Seriously, I've never really understood them until just now.

i agree...or at least into the BFAQ. i read the pointer section in there a couple of times and didn't get it at all.
#34
awesome, thanks for that detailed explanation!:)

i'm definitely interested in learning so that's very useful to me.
#35
hi,

i'd like to build a custom function to quickly call default interaction animations for my character.
my character has views for interacting "high", "middle" and "low" (i.e. vCharInteractHigh etc.) with corresponding animation loops for facing "up", "down", "left" and "right" (0 - 3).

what i would like to end up with is a function that works something like this:

Code: ags
CharacterInteract (high, down);

or
Code: ags
CharacterInteract (middle, left);

etc.

i'm pretty much clueless how to achieve this. my guess is i'd need to use "pointers" somehow...?
which, unfortunately i still haven't managed to wrap my head around completely what they are or how they work.

any help would be appreciated.

cheers!
#37
ok thanks for the info...:)

btw. is it possible to add an unhandled event for specific inventory items?

i.e. with a knife in the inventory, whenever it's used on an unhandled object i'd like the character to say "I don't want to cut that" instead of a super-generic phrase.
#38
yeah i was afraid it would be something like that, too bad...so no way around it at this point i guess?

if the inventory items could have 29 characters as well i'd be fine...i'm 3 characters short!  :-\ :P
#39
thanks,

i found the source of the first issue. for some weird reason i had set "walk to" coordinates for hotspot 0 in the AGS UI...:D don't ask

as for the second issue...i checked the ActionLine on the gAction UI and everything seems to be fine. i also didn't change the font or mess around with it in any way.
what seems to be happening is that the names of inventory items get cut off after 24 characters. i also tested it in the alley sample room...same thing.

p.s. i noticed that at the end of "function any_click_move" is a "Wait(5);" command...any specific reason why this is there? from what i can tell, all it does is cause the game to block for a fraction of a second every time the character reaches his destination...which felt kind of "glitchy" to me t.b.h.
#40
hi again,

i noticed another peculiar thing that i can't figure out...not sure if it's actually related to the 9-verb template

when i click on a verb (i.e. "use") and then click on an empty spot on the background the PC always walks to, what seems to be, the center of the background...the game also gets blocked until he's there. it doesn't matter where i click (as long as there is no hotspot or anything). he always walks to the same spot. any idea why it's doing that?

also: is there a limit to how many characters can be displayed in the action bar? i have an item that has a pretty long name and i noticed it gets cut off in the action bar even though there's still plenty of room left.

cheers
SMF spam blocked by CleanTalk