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 - Stranga

#81
It most probably is better. This may be the case where I may just have to do that.
#82
Oh I understood that. Sorry I didn't reply sooner, I got it working with some tinkering. I did notice that the state changes are a little slow with the ghost character, this possibly could be caused by the animations if they are blocking the code somewhere(I think?). I'm using the built in FollowCharacter code so that may be the case? It also seems to travel to the players last known co-ordinates if the player stops moving rather than a continuous chase or to the players updated position. Is this something to do with AGS's path finding or something else? I did however find a few modules about following characters so I may have to use one of those.   
#83
Thanks for your reply CW. As all the logic makes sense to me the implementation does not. Not too familiar with AGS scripting, still getting the hang of it compared to GMS.

I'm getting an error stating:
Code: ags
EnemyScript.asc(8): Error (line 8): CharStates is not an array


Not sure what this is referring to be honest.
#84
Hello everyone.

I'm trying to experiment with my latest game. I want it to play out as if it were a normal adventure game but with a ghost that randomly appears every now and then and chases you if you get too close.

What I'm trying to achieve is changing the state of the ghost (or even create a state machine if I can). So far I have it set down to say if the player is 30 pixels away from the ghost, the ghost chases the player. If the player is >30 pixels, it stops chasing you and returns to it's random movement.

Code: ags

function repeatedly_execute() 
{

 //CHOST CHASE PLAYER 
 if (player.x - cGhost.x < 30 && player.y - cGhost.y < 30)
  {
    EnemyChase = true;//Set state
    cGhost.SetWalkSpeed(-1, -1);
    cGhost.FollowCharacter(player, 0, 0);
  }
  else  //GHOST RANDOM MOVEMENT
  {
    EnemyChase = false;//Set state
    cGhost.SetWalkSpeed(-3, -3);
    int walkx = Random(System.ViewportWidth + cGhost.x);
    int walky = Random(System.ViewportHeight + cGhost.y);
    if (GetWalkableAreaAt (walkx, walky) == 1) 
      {
        cGhost.Walk(walkx + 73, walky - 73, eNoBlock, eWalkableAreas);
      } 
  }


I'm not exactly sure how this sorta thing works with AGS, but any help would be greatly appreciated! :)
#85
Sorry about that, I should have worded it better. By store points I meant storing a position (x and y) in the room in a single int not a function. I'm trying out your method first as I see it as a cleaner/ faster way to do this.  :)

#86
Thanks for your reply @ eri0o! :-D

I'll give this a try. I also found in the manual a function called AddWaypoint (Formerly known as MoveCharacterPath). Which is exactly what I'm after but I would like to simplify it as you suggested into a one line function.

Currently it would look like this:

Example:
Code: ags

cSomeguy.Walk(160, 100);
cSomeguy.AddWaypoint(50, 150);
cSomeguy.AddWaypoint(50, 50);


So I think your solution may be better, unless I could find a way to store way points in a function?

#87
Hello everyone!

I'm not sure if this belongs in the beginner or advanced forums, but I can't figure out a way to implement it (if it's even possible). Basically, what I want to do is have one function that can set a path for a character to replace AGS's path finding system. Because I work with top down games mostly, the path finding looks a little janky and I want to avoid having to type [ character.Walk(x,y,ect) ] 10+ times. So I thought of this idea where I could have a function that I could add as many coordinates in it as I want!(Or maybe just a limit of 5-10).

So for example:

Code: ags


player.WalkPath(eBlock, eWalkableAreas, point x, point y, point x, point y, point x, point y);

//The player would walk to each point in a sequence until there are no more coordinates

//or even

player.WalkPath(eBlock, eWalkableAreas, pos1, pos2, pos3, pos4, pos5);


I'm not sure if this is achievable in this state, but even so, I thought throwing the idea out there may be interesting.

Thanks for any help or input in advance!
#88
thanks Slasher, that did the trick! :)
#89
Is there a way to check how far cEnemy may be to the player?
#90
If cEnemy collides with player, cEnemy animates player loses health, then cEnemy can't move for a few seconds (giving the player a chance to move) then chases the player again.

I apologize if this was confusing.
#91
Hello everyone,

I'm in a bit of a pickle. I want to make the enemy attack the player but then pause for a few seconds then follow/attack again (sorta like invincible frames)

Code: ags

function repeatedly_execute() 
{
  cEnemy.FollowCharacter(player, 1, 100);
  
  if (cEnemy.IsCollidingWithChar(player))
  {
//Enemy Attacks!
      player.Tint(100, 0, 0, 100, 90);
      PlayerHealth -= 3; //Player takes damage
      cEnemy.Animate(0, 9, eOnce, eBlock, eForwards);  
      cEnemy.UnlockView(eKeepMoving);
      player.RemoveTint();
      tickspassed = 0;
  }
}


This is what I have so far(trying to keep things simple...if I can)
Any help will be greatly appreciated :)
#92
That's actually not a bad idea @Cassiebsg! I'll give that a try :-D
#93
@Khris I am using a keyboard module but I think the problem lies within the room editor's WalksToPoint before the hotspot triggers. I don't necessarily need it, but it's just nice to position the player without having to add the WalksToPoint in the room's script. But to get it to work without the pixel jump up/down it has to be exactly on the y.position of the player. This becomes tedious, especially on levels with a tall room.

@eri0o Thanks for sharing some ideas. I do like the rellax module! Trying the demo now.
#94
Hello everyone,

I would like to know if there is a better way of implimenting a side-scrolling adventure game. I am currently developing one and I've noticed the system I'm using is a little jarring. The character walks left and right fine, but when inspecting a hotspot/region/object he lift/drops a pixel or two above or below the ground rather than stay on the ground (if it is making sense)

Screen: Here is how the game looks.
Spoiler

[imgzoom]https://i.imgur.com/sXCpNQu.png[/imgzoom]

Here is how I'm currently making the walking method.
[imgzoom]https://i.imgur.com/SMjupWg.png[/imgzoom]
[close]

I'm also using keyboard controls only, since I want to port my games to consoles in the near future.

Any help will be greatly appreciated, thank you all!
#95
Hello there,

I know this is an old topic, but I just want to find out if this plugin will work with AGS 3.5.0? I have tried to implement it the same way as in v 3.4.1, but it doesn't seem to unlock anything. I've also tried both AGSteam and AGS2 plugins. My guess is that the plugin is out of date? I could be wrong but just taking a stab in the dark.

P.S sorry if I broke any rules, just really need help with this.


Edit: I forgot to add all the .dll files to my compiled folder. So it does work with 3.5.0. My bad everyone!
#96
Thanks, Khris! I never would have thought it would be in the manual and I usually check there first! Working perfectly!
#97
Hello everyone,

I was wondering if there is a way to select dialogue options by using the arrow keys then enter on the keyboard rather than using numbers? I guess I would have to write up a custom script/GUI for such a thing? But that may require me to make up my own dialogue system, I'd rather use the built in one AGS has to offer.

Thanks again in advance!
#98
Hello everyone,

I've tried contacting a few people about this problem but to no avail. I've made games in 3.4.1 and the achievements worked fine, but my latest is made in 3.5.0 because I love the new feature. I've tried monkey0506's Steam plugins (both) and they done't seem to be working at all. There are no errors just nothing is unlocking. I've followed all the documentation and added the achievements accordingly, but I just can't wrap my head around this, I was also going to wait until the game was released to test out the achievements but apparently you can unlock them without having to release your game. So, in my conclusion I believe it may be the version of AGS but I am still unsure.

Any help would be greatly appreciated.

P.S I have tried contacting monkey0506, but seeing that he has not been logged in for a while now I'm not sure if he will return my messages.

Thanks everyone in advanced!

EDIT: I made an oppsie! I didn't add all the .dll files to my compiled folder. Hope this helps other's who come across this problem.
#99
Ah, yes! Exactly! Thank you CW!
#100
Hello there!

Not sure if this has been suggested before or if it could be done, but I would like to suggest a scroll-able mouse option for the room editor. For example: if you click and hold the scroll button on your mouse you can drag and scroll the view of the room around in the editor rather than having to click the scroll bars on the side. I know the middle click is to copy room coordinates, but could implement another key such as the space bar or such to do the job.

This would speed up production time for me, and could aide other too.

Sorry if I come off sounding nit picky.  :)
SMF spam blocked by CleanTalk