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

#1
Thank you! Works like a charm on game_start :D
#2
I am trying to make my idle view animted. I used the following code:

Code: ags
  cEgo.SetIdleView(2, 0);


In the view itself it works perfectly when I click on "Animate", but when I run the game, the idle view is stuck on the first frame.
#3
Quote from: ClickClickClick on Sun 22/10/2017 16:47:23
It would help if you told us what kind of game this is for.

I updated the description :)
#4
This is my repeatedly execute function now:

Code: ags
// Also works when game is blocked
function repeatedly_execute_always() 
{
  cmbHumanHotspot_OnClick(GUIControl *control, MouseButton button);
  uiMainInventory_OnClick(GUIControl *control, MouseButton button);
  uiCombatTest_OnClick(GUIControl *control, MouseButton button);
  uiConsoleEntry_OnActivate(GUIControl *control); 
  uiEmergency_OnClick(GUIControl *control, MouseButton button);
   
  keyLinearBlock();
  keyCodes();
  
  uiECS.Text = String.Format("%d", ecs);
}


And I get this error (the error is thrown for line 4 in the example) :

Code: ags
GlobalScript.asc(19): Error (line 19): Parse error in expr near 'MouseButton'

#5
I made theme music for the main menu of my game Drained. It's a distopian RPG about a young woman (20) that lives in a world that has run out of oil and where other resources are under a great threat of running out. She is the daughter of a high ranked government offical and has never seen anything else than the safety of the bunker they live in. As the government seizes the remaining resources from civilians, a war between the people and the government breaks out. The bunker gets overrun by rebels and the family of the protagonist has to flee. On their way to a safer location, they get attacked by another group. The protagonist is rendered unconciousness and is taken by the rebels. When she wakes up, she finds herself at an unknown location, here parents are nowhere to be seen and she has no clue how she got there. That is where the player starts the game.

My intention with this theme is to induce a feeling of fear and loneliness, as the protagonist will be wandering through a desolate world alone. The people she'll meet are scary to her and she needs to find a way to adapt to this world by overcoming her feelings. It's either getting by or going insane.

Concept Drained Main Theme - Soundcloud

All feedback is welcome.

#6
Works like a charm! Thank you very much :D One final question though. The last script if have has a reference to another function and I get the error Undefined token 'cmbHandler'. Do you know how I can fix that?

Code: ags
function cmbHumanHotspot_OnClick(GUIControl *control, MouseButton button)
{
 if (mouse.Mode == eModeUseinv) {
   cmbHandler();
   } 
}
#7
Thanks, that already helps me :) So here is what the code looks like in the script. It still throws a nested error, because of the functions in there. How would you handle that?

Code: ags
function keyLinearBlock (){

////////////////////// DISABLE LINEAR MOVEMENT //////////////////////

int old_mx, old_my;
    void handleInput() {
      int mx = IsKeyPressed(eKeyD) - IsKeyPressed(eKeyA);  // only A => -1, A & D => 0, only D => 1
      int my = IsKeyPressed(eKeyS) - IsKeyPressed(eKeyW);
      if (mx * my != 0) return; // only allow either A/D or W/S
      // rotate by 45°, stretch to 2:1
      int tmx = (mx + my) * 2;
      int tmy = -mx + my;
      // player is still holding down same key as last frame, check for end of walkable area / do nothing
      if (mx == old_mx && my == old_my) {
        int a = GetWalkableAreaAt(player.x + player.WalkSpeedX * tmx / 2, player.y + player.WalkSpeedX * tmy / 4);
        if (a == 0) {
          player.StopMoving();
          player.PlaceOnWalkableArea();
        }
        return;
      }
      // player picked new direction or released movement key
      player.StopMoving();
      player.Walk(player.x + tmx * 1000, player.y + tmy * 1000, eNoBlock, eAnywhere);
      old_mx = mx;
      old_my = my;
    }
    
        function abs(int a) {
      if (a>=0) return a;
      return -a;
    }
     
    function sgn(int a) {
      if (a>0) return 1;
      if (a<0) return -1;
      return 0;
    }
    
    
}
#8
Sorry if I didn't explain properly what I want to do. I want to keep Global Script clean and store the functions currently there in seperate scripts. For example, the function that blocks linear movement is about 30 lines and it's all in my Global Script. I want to store that function elsewhere to keep my Global Script clean and readable. I have made scripts for these functions in the folder hierarchy, so I now have the script containing said function placed at Scripts > Main > Functions > keyLinearBlock. I want to import that script into my Global Script as the function originally is placed there and needs be used in the repeatedly_execute_always() function.

If I understand it correctly, this would not work as of now because the script contains a function, right? So my question then would be: how do others order their Global Script and keep it all clean and readable?
#9
Hey people!

I am trying to organize my scripts and find Import/Export very useful functions to do this. However, since nesting is not allowed in AGS, I am a bit lost on how to import script without making them functions themselves.

This is what I have now to export code:

Code: ags
function variableChecker() {
  export variableChecker;


but because I have this function in that script:

Code: ags
function uiMainInventory_OnClick(GUIControl *control, MouseButton button)
{


AGS does not allow me to import it. How do you guys handle this and what are best practices when it comes to organizing scripts in AGS?

Thanks in advance :)
#10
Quote from: eri0o on Wed 18/10/2017 01:12:33
Wyz! The d-pad (POV) in my wired Xbox360 joystick doesn't work. Do you have any idea why?

Is there any possibility of releasing the joystick plugin source? I would like to play with maybe porting it to Linux.

The tutorial doesn't even recognize my Xbox 360 controller at all. So I can't test it at all as of now.
#11
Works like a charm ;-D:-D Thanks Khris!
#12
Hey people!

I am looking for a way to use an inventory item on a GUI element. The goal is to make the user select an inventory object and use it as a weapon against enemies. Any ideas?

#13
Thank you Khris! You once again saved my day :) I might not be the best in explaining what I want in English, as it isn't my first language. The RunAGSGame command does seem to do the job for what I want to do with my testing.
#14
Well, I basically want to load files / scripts during runtime. I guess that's not possible then. It would be great if we could have a plugins module so we can store content seperately at will and choose during runtime what we want to load.
#15
Hey people!

I am trying to create a modular resource system to easily implement resources through seperate files. Is there a way to code an “include” function of sort so that the game will read stored data from the specified file. A bit like how you construct classes. Any ideas on how I can approach this?

Thanks in advance.
#16
Thank you so much Khris! Your code works perfectly. My C# knowledge is a bit rusty, but I'm seeing the bigger picture again after getting back into it this morning.
#17
Hey people!

I'm trying to use pure isometric movement for my characters. So I basically want to get rid of everything that is not moving diagonally. I tried the code below while disabling eModeWalkto, but that doesn't seem to work. Any ideas on how I can do this?

Thanks in advance.

Code: ags
  if (keycode == eKeyS && keycode == eKeyS && player.Moving) player.Loop = 4;
  if (keycode == eKeyW && keycode == eKeyD && player.Moving) player.Loop = 5;
  if (keycode == eKeyS && keycode == eKeyA && player.Moving) player.Loop = 6;
  if (keycode == eKeyW && keycode == eKeyA && player.Moving) player.Loop = 7;


#18
Critics' Lounge / Re: World map art
Mon 10/07/2017 14:26:26
Quote from: ClickClickClick on Mon 10/07/2017 14:21:14
Quote from: Mandle on Mon 10/07/2017 14:18:26
Looks awesome, but a little bare. Maybe add some forests etc. like in the classic Lord Of The Rings maps Tolkien drew for his books?
This, more or less. Needs rivers. And maybe hints that the landscape isn't completely flat.

The darker grey lines going into the sea are rivers. Maybe I should use a different color(tint)?
#19
Critics' Lounge / World map art
Mon 10/07/2017 14:12:44


I am wondering what you guys think of the world map that I created for my game. Does is look okay? It's suppose to look medievalish and weathered. I am also still struggling with the color palette. Any tips for improvement?
SMF spam blocked by CleanTalk