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

#1
I meant to post in the 'How to get more participation' thread that I wouldn't mind joining, but can't make a game on my own. And then saw that I wrote just that on page one a few years back...

So, since it's been a while that I did any scripting and I like to brush up on that: does anyone like me to help with (or do) the scripting for their game? I may come up with a puzzle or two as well.

Thanks  :)
#2
What I'll do is set all the flags and inventory I need to test a specific part of the game in a function and call that from game_start.
Plus I change the starting room for the player character in the editor. Or maybe that's also possible in code?
This is an example from the gateway game (it's much longer but you'll get the idea).
For a regular playthrough just comment out the testing function in game_start.
I don't remember if the game_start function used here is part of a template or not.

Code: ags

function testing(){
  ////////////////TESTING///////////////////////
  SphereInRoom = true;
  bSeenPerry = true;
  //bDeepPsych = true;
  iGoldCredit = 150;
    
  cEgo.AddInventory(iGreenBadge);
  cEgo.AddInventory(iMemo);
  cEgo.AddInventory(iBook);
  //cEgo.AddInventory(iMedallion);
  //cEgo.AddInventory(iSalamander);
  sShield = "Nemira 3";
  
  ////////////////TESTING///////////////////////  
}



Code: ags

// Called when the game starts, before the first room is loaded
function game_start() {   
  // Put the code all in a function and then just call the function. 
  // It saves cluttering up places like game_start.
  lblScore.Visible = false;
  lblScoreText.Visible = false;
  btnDataMan.Visible = false;
  bSave.Enabled = false;
  btnInvUp.Visible = false;
  btnInvDown.Visible = false;
  
  Initialize();
  //testing();
}
#3
Hints & Tips / Re: Black Sect Remake
Sun 09/01/2022 23:15:35
Spoiler
I believe you have to use the knife on the rope to establish that it is blunt.
If you also have received the pin from the washer, the farmer should be back at the northern passage (maybe exit and enter again if he's not there).

You can not cross the river at the barren lands.
[close]
#4
Hints & Tips / Re: Black Sect Remake
Sun 09/01/2022 21:29:51
Spoiler
The hint refers to the dwarf. You should cut him loose. Do you have a (sharp) knife?
[close]
Spoiler
If the knife is blunt the farmer can help.
[close]

This has no relation to the chapel though. That will be available a bit later.
#5
Hints & Tips / Re: Black Sect Remake
Wed 05/01/2022 14:23:05
Yes.
Spoiler
The tramp will return later.
[close]
I believe the hint button will give a more specific clue once you got past the farmer, depending on what you've done so far.
#6
Err, it was in on_event. I didn't put it there, so maybe it comes with tumbleweed?
I disabled that line and now it works,

thanks
#7
I used to let the player character walk in the screen by doing for instance player.ChangeRoom(3,-50,150). And then in room 3 walk to some place on the screen.
Now I'm working with AGS 3.5.1. and the tumbleweed template and this doesn't work.
The player is placed visibly in room 3 at x=1.

I noticed that if I do player.Walk(-50, 150, eBlock, eAnywhere), the player does walk off screen.
Why is this not happening with the changeroom (or tumbleweed's EnterRoom), and what can I do to fix this?

thanks
#8
Ok, thanks.
This works mostly. The problem was the setting automatically move player in walk mode was true.
What is still not how I expected, if I do this:

Code: ags

function Tree_AnyClick()
{
if (Verbs.MovePlayer(160, 135)){  
  if (Verbs.UsedAction(eGA_LookAt)) {
    player.FaceLocation(160, 125, eBlock); 
    player.Say("It's a large elm tree.");
  }
}


Then the player walks to the tree while the action labels shows 'look at tree'.
If I then move the cursor to the mountain the label keeps showing 'look at tree', but if I (right)click , the mountain function fires. So the label isn't updated.
Also during walking the 9 verbs are unclickable.

Is there any way to fix that?

thanks
#9
Hi,

It's not clear to me how you can cancel an action in the tumbleweed template.
If I do this:
Code: ags

if(Verbs.UsedAction(eGA_LookAt)) player.Say("I've looked at it.");

The player walks blocking to the hotspot and it is not possible to do anything until the walking is finished and the line said.

If I do:
Code: ags

if(Verbs.UsedAction(eGA_LookAt)){
  if(Verbs.MovePlayer(290,123)) player.Say("I've looked at it.")
}

Then it is possible only to click somewhere else and walk there, but not to choose an action on another hotspot. The 9 verbs are still not available while the walking is happening.

So how do I make it possible for the player to choose a different action?

thanks
#10
Regions are disabled at this point.
The game is so big that it is hard to know for sure nothing is interfering.
It looks like it is something with walkable areas.
walking UP to y=350 she changes WA and stops there. That also happens just walking around the screen.
But walking DOWN does not make her stop. The WA's also have specific views assigned in the editor.

I can work around it bij changing the layout of the WA's a bit, but I'm still puzzled.
#11
Version is 3.3.4.2
Resolution 640x400
#12
I left it for now because in this scene it is not really gamebreaking, but now I'm getting worried.
We have this function that is in the game for years, and suddenly behaves strange.
So I put in two displays.
Code: ags

function enter_screen() {
  if (player.x<0) player.Walk(67, player.y, eBlock, eAnywhere); //enter from left
  else if (player.x>580) player.Walk(567, player.y, eBlock, eAnywhere); //enter from right
  else if (player.y>395){
    Display("walk to 350");
    player.Walk(player.x, 350, eBlock, eAnywhere); //enter from bottom
    Display("player.x = %d. player.y = %d.", player.x, player.y );
  }
  EnableRegions();
}

The result is:
"Walk to 350"
"player.x = 304.player.y = 372"

The function is called in room_AfterFadeIn()
What could be causing this?
Did something get broken?
#13
Yes sorry, it isn't exactly in the game like that.
When you click to the right of the player she walks 10 to the right.
When you click to the left, she walks 10 to the left.
I have safe regions en unsafe regions.
If you are safe and walking to the right makes you stand on an unsafe region, you should be able to click to the left and be back where you where before (safe).

But it turns out that (sometimes) you walk 10 to the right and then less to the left, so you are not back on a safe region.
Does this make sense?

@Morgan, are you saying this is expected behaviour? We are still in v3.3.
#14
Hi,

If I do:
Code: ags

player.Walk(player.x+10, player.y, eNoBlock, eAnywhere);
player.Walk(player.x-10, player.y, eNoBlock, eAnywhere);

The player's end position is not the same.
I checked this with display.

After 1st line: x=224, y=232
After 2nd line: x=218, y=232.

How can I force the player to walk exactly the specified amout of pixels?

Thanks.
#15
OK, ik works with import String death_message[80];
I didn't expect I had to write that 80 there in the import statement.

thanks
#16
In GlobalScript.asc
String death_message[80];// line 57
export death_message;

in GlobalScript.ash
import String death_message[];

The error points at line 57.

When I removed the [] in the import statement, the error is 'death_message is not an array'.
#17
I added the export, but I still get 'Attributes of identifier do not match prototype'.
#18
The cause of death is an enum, so I believe that part of the script is correct. At least it has always worked until I tried to set the message from a room script.
#19
I now have in global script:
String death_message[80]; //this is line 57

in ash:
import String death_message[];

When compiling I get error:
Attributes of identifier do not match prototype (on line 57)

If I change the import statement to import String death_message[80]; I get another error (unresolved import)
#20
Hope I can make this clear.
We have a generic way of showing player deaths.

Code: ags

in global script:
function ShowDeathGui(CauseOfDeath cod) { //makes death gui appear
 //stuff
  DisplayAtY(280, death_message[cod]);

}

function game_start(){
  death_message[eDeathTree] = "test";

}

GlobalScript.ash
enum CauseOfDeath {
  eDeathZombie, 
  eDeathTree, 
};
String death_message[80];
export death_message; //added this but it didn't help

In room scripts:
ShowDeathGui(eDeathTree);


So when the player dies you see the text "test".
This works.

But for the tree I want to have several random messages, so in de room script I added:
Code: ags

void RandomTreeMessage(){
  int r = Random(4);
  r = 0; //testing
  if (r==0) death_message[eDeathTree] = "This is the first random text";
}

And then
RandomTreeMessage()
ShowDeathGui(eDeathTree);

The result is that the text "test" is still shown, instead of "This is the first random text"
I assume this is some kind of import/export thing?
Or should this be a function with parameters?

How do I do this?
Thanks
SMF spam blocked by CleanTalk