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

#81
Just awesome! Thank you very much for sharing  :o

A quick link for Calin if you still need it.

LINK
#82
Yeah there's something strange, that's why I suggested to send the whole game file so I can have a closer look at it, I could hopefully figure out what's going wrong without having to flood the forum  :P But I would understand if you don't want to of course.

Edit: The problem was coming from the UP/DOWN loops being just copies of the right and left loops, making the player think he's facing right when he's actually facing up and result in strange behaviour.

Will tweak the code a bit more, because having the character face something is considered as a movement, (Edit) so the trick was to change the character loop to make it look like he's facing without modifying player.Moving variable, so we can detect if player is idle and have him face anything at the same time, also made sure the facing direction is either left or right only.
#83
I've sent a PM, regarding your question I don't think the size matters but I'm gonna run a quick test and will edit my post afterward.
#84
Can you try to remove everything from rep_exec and just put:

Code: ags

 if(!player.Moving)
 {
   player.FaceCharacter(cStrayBee1, eNoBlock);
   Display("I'm facing the bee");
 }


If nothing displays when you stop, the function isn't linked properly, in this case just remove the property text in the room event panel, and then hit the "..." button again to re-link it.

Edit: one more thing, you added "sting = 1;" when the sting is supposed to occur. It should be when the bee lands on the player body, then the sting will occur automatically after 15 sec idling.
#85
In the repeatedly_execute, try replacing the cstraybee1 line with:

Code: ags

cStrayBee1.Walk(walkx, walky, eNoBlock);


This may interfere with the rest of the code if the functions is blocking.
Does it work if you completely remove the random moving part with cstraybee1 from the rep_exec?
Was the Bee1 moving randomly as expected?
#86
Yeah strange, I can walk and have the bee follow me and whenever I stop it forces me to face it. Please post your room code, this is the easiest way to help you.
#87
The magenta flooded mess will be transparent in game, all you need to do is keep the sprites background color like pink or green or anything, the transparent color will always show up as magenta in the editor. Does the sprite appear normally, fully when you run the game?

This should be in beginners technical questions unless there's a real problem about it.
#88
This is working fine with me , I created a room, a hotspot, a bee character, and put this code in the room script, but you need to link it in the room property panel for it to work (room repeatedly execute).

The hotspot must be linked the same way.
Also make sure you actually walk on the hotspot by adding a Display("test");

Btw I edited the code so pls paste it again.
#89
Code: ags


bool under_attack = false;
bool idle = false;
int sting = 0;

function hHotspot1_WalkOn()
{
  under_attack = true;
  cBee.FollowCharacter(player, 10);
}

function room_RepExec()
{
  if(under_attack && sting == 1)
  {
    if(!player.Moving && !idle)
    {
      idle = true;
      SetTimer(1,  GetGameSpeed()*15);
    }
    else if(player.Moving && idle)
    {
      idle = false; 
    }

    if(IsTimerExpired(1) && idle)
    {
    //execute the sting part 
      Display("The bee attacked you!");
      sting = 2; 
      idle = false;
    }
  }
  else if(under_attack && !sting && !player.Moving)
  {
    player.FaceCharacter(cBee, eNoBlock);
    
  }

}




This is what the room script looks like, you would just need to use "sting = 1;" when the bee lands, then it will wait for player to be idle (not moving) for 15 sec and then display "The bee attacked you".

I just realised I had something wrong in the code, you need to use the event tab of the room to link Room_RepExec() properly. I edited the code.

Sorry I'm a bit tired too, hope this work like you expected.
#90
Make sure you have the 3 lines inside the room script but outside any function. It should work.

Code: ags

bool under_attack = false;
bool idle = false;
int sting = 0;


Or can you post the room code?
Also make sure these lines are written before/above the under_attack = true; code.
#91
When the bee goes into FollowCharacter mode, put this line:

Code: ags

under_attack = true;


When the bee lands on player, put this:

Code: ags

sting = 1;


And put any additional code for when the bee stings inside the code where I put:
Code: ags

    //execute the sting part 


Setting under_attack to true is what launches the whole event.
#92
Will you have one room for each close up?

I don't know how the ron template works but the whole process of changing room and then having to split the code inside after_fadein etc is harder than actually creating a gui and a button which takes 3 clicks to accomplish.

I'm just suggesting what I think would be easier, if you get things working that's what counts ;)
#93
Inside Global script this function should already be here. Just add the code inside, and the 3 lines just above:
Code: ags


bool under_attack = false;
bool idle = false;
int sting = 0;

function repeatedly_execute()
{

}



I just tried in AGS without a problem, is there an error? Can you write the error output pls?
I haven't tested but the code is supposed to work the exact same way inside room script I think.

If you use it in room script then all you have to do is copy paste the whole code I wrote previously, since there is no repeatedly_execute inside room script by default.
#94
Critics' Lounge / Re: Knight sprite
Mon 25/04/2011 22:05:24
The two versions are completely different and both look good to me, but I prefer Anian's edit, I like the red pants under the armor. I also like the first armor texture better.

Maybe you could use them both as different characters? Would be a waste to throw one away. Cheers.
#95
Hey,

If you'd like to check if the bee has been on him for a certain amount of time you could use a timer:

Code: ags


bool under_attack = false;
bool idle = false;
int sting = 0;

function repeatedly_execute()
{

  if(under_attack && sting == 1)
  {
    if(!player.Moving && !idle)
    {
      idle = true;
      SetTimer(1,  GetGameSpeed()*15);
    }
    else if(player.Moving && idle)
    {
      idle = false; 
    }

    if(IsTimerExpired(1) && idle)
    {
    //execute the sting part 
      sting = 2; 
      idle = false;
      under_attack = false;
    }
  }
  else if(under_attack && !sting && !player.Moving)
  {
    player.FaceCharacter(cBee, eNoBlock);
  }

}



When the bee attack sequence starts, you set under_attack = true;
When the bee is on the player set sting = 1;
If the bee flies again before it stings, sting = 0; idle = false;
Change the timer from 15 seconds to whatever you want.
And put your code for when it has to sting.

For the bee landing on player I thought moving it over the player would work fine, but maybe you can change the view of the player to have the bee drawn on the sprite instead.

I don't have AGS on this computer atm so tell me if there's any problem.
#96
Hello,

I don't know if there's a reason for using changeroom but I think you could use a gui the size of the screen, and use a button to display the letter or any other close up on it, so you just have something like:

Code: ags

//Global String CloseupDescription 

function CloseUp(int sprite, String desc)
{
  PauseGame();
  CloseupDescription = desc;
  Button.NormalGraphic = sprite;
  CloseupGui.Visible = true;
}

//when a close up occurs

  CloseUp(10, "That letter was really intresting indeed.");

//when a close up is skipped

  UnPauseGame();
  CloseupGui.Visible = false;
  Display(CloseupDescription);
 


This could help if you're using more than one in the game and would simplify the Changeroom process. This is just an idea.
#97
Quote
andI'm still getting the same error

You seem to have an obvious problem with spelling, even when you're writing a post, you're not using capitals and you forget to put spaces sometimes.

There's nothing wrong with your code, every script command needs a space before, when it's inside the dialog, and the command should be written carefully, when you start to write "player.add" it should pop up a quick window to auto complete your code, it will take care of the spelling for you.

Code: ags

// Dialog script file
@S  // Dialog startup entry point
Ghost: Oh my god, you stole Dracule's prized Flower Pot.
Ghost: You Truly are evil
return
@1
Ghost: Of course it does
Ghost: Here it is

 player.AddInventory(iCode);
 Display("The Code is now in your inventory");

stop
#98
Have you used ListBox.FillSaveGameList? If not then the listbox is empty and the index is -1 so the code won't run. It should be used whenever you show the savegame dialog. Otherwise I would advise to read the manual or directly copy the game template code...
#99
I changed the code, should work now, I'm not sure what txtNewSaveName is, but you could replace it with any Label.Text or directly with "PMQSave".
#100
Ah yes, sorry, the SaveGameSlot[] is not a regular ListBox.

Edit: The code will work with a regular listbox if you change "SaveGameSlot" with "Items", like ListBox1.Items[ListBox1.SelectedIndex]

I think SaveGameSlot[] is an array of int (save slots) instead of an array of strings like listboxes. I edited the code in previous post, does it work?
SMF spam blocked by CleanTalk