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 - Trent R

#481
Easy rule of thumb is just to always put brackets, even if you just have one command to call.


~Trent
#482
Just a thought, perhaps you could install 3.1.2 on a few computers rather than 20-30. Then, any of your students that want to go the extra mile and have the newest version at home (or even those that need one of the bug fixes) can use those computers.

Unless you have your classroom set up differently, such as each student uses a specific computer.


~Trent
#483
Nope, which is why you are always warned when you open up an older project with a newer version.

However, it's only been recently that new versions have been whipping out. (CJ said at one point that he had a large break, but that it would be ending). Obviously he'll have the final word, but I don't think there will be many new releases soon. Just as long as none of your kids install the beta versions...

[Edit]: Actually backwards compatibility is a huge issue for CJ. He works very hard to make sure that installing and updating to new versions won't break functionality from previous. And when he does, it's with good reason (interaction editor, for example)

~Trent
PS-Dang, I wish my school had a programming class. The teacher that taught the only one retired the year before I got into highschool.
#484
The Rumpus Room / Re: Happy Birthday Thread!
Wed 18/02/2009 07:20:54
Happy birthday to Revan too.

~Trent
#485
I stand corrected. In that case, I'll ask again, have you tried using breakpoints or Display checks to see where your script stops working?

~Trent
PS-I missed the Timer code due to strange tabbing. The following code is exactly the same, but with cleaner tabbing.
Code: ags

function room_RepExec()
{
  cCliche.Transparency = 100;
  if (IsTimerExpired(8)){
    cCharacter.Say("Oh no! he is comming!");
    SetViewport(600, 112);
    oMetalBar1.SetView(7, 0);
    oMetalBar1.Animate(0, 5, eOnce, eBlock, eForwards);
    oMetalBar2.SetView(7, 0);
    oMetalBar2.Animate(0, 5, eOnce, eBlock, eForwards);
    oMetalBar3.SetView(7, 0);
    oMetalBar3.Animate(0, 5, eOnce, eBlock, eForwards);
    SetBackgroundFrame(2);
    Wait(80);
    cCliche.Transparency = 0;
    SetBackgroundFrame(2);
    cCliche.Say("Ha! Now i will take this intruder and teach him a lesson!");
    cCliche.Move(629, 152);
    Wait(40);
    cCliche.Move(627, 173);
    cCliche.FaceLocation(527, 188);
    int PlayerX = cCharacter.x;
    int PlayerY = cCharacter.y;
    cCliche.Walk(PlayerX, PlayerY);
    ReleaseViewport();
  }
  if (SecSystem == false){
    SetBackgroundFrame(0);
  }
  else {
    SetBackgroundFrame(1);
    oMetalBar1.Visible = true;
    oMetalBar2.Visible = true;
    oMetalBar3.Visible = true;
    oDoorLeft.Visible = true;
    oDoorRight.Visible = true;
  }
}


function hHotspot1_Interact()
{
  int RandomInteract=Random(2);
  if (RandomInteract==0){
    dRandomInteract1.Start();
  }
  if (RandomInteract==1){ 
    dRandomInteract2.Start();
  }
  else {
    dRandomInteract3.Start();
  }
}
#486
But by ignoring the DirectDraw problem, you're limiting the number of people that can play your game. I assume you don't want that, no?

If a computer or graphics card is too old for D3D, then they need to switch over to DirectDraw.


~Trent
PS-And for the last time, it's called anti-aliasing! :D
#487
Have you tried using breakpoints or Display catches to find out where it doesn't work? What color depth is your game? Do any of the sprites used for cCliche have an alpha channel?

I started to write a long post, then I realized that this is your rep_exec script. You can't put walk under repeatedly_execute because it will try to make the character move there every singe frame, and end up not moving at all. Also, you can't put Wait() commands in there either (I don't think so at least).

Put your script in another function, then call it once.

~Trent
#488
Why not use GUI.GetAtScreenXY?

Modified the code from the manual:
Code: ags

GUI *theGui = GUI.GetAtScreenXY(mouse.x, mouse.y);
if (theGui == gAction) {
  TC=0;
}
else {
  TC=1;
}



As for your if-statement, I'm not sure you can use x<y<z. I think you have to break those up with &&.


~Trent
#489
The Rumpus Room / Re: Happy Birthday Thread!
Tue 17/02/2009 07:31:22
Happy Birthday Darth! Truly, the forums would be crowded with useless threads without you.


~Trent
#490
Lyaer's code sounds like it should work. But I personally would change this Character* to something like Character *CharAtRegion. This is because 'this' is used for extender functions, and it would bother me to see player.BehindWall pop up on the Autocomplete.

But that is purely a personal opinion. Nothing wrong with the code itself.

~Trent
#491
Not to mention that your problem occurred due to strange tabbing and dirty code.

I don't want to sound vain, but I (and many other AGSers and scripters) would write your code like so:
Code: ags
function hGuard_Talk() {
  if (myCounter1 == 0) {
    dGuard.Start();
  }
  else if (myCounter1 >= 1) {
    dGuardc.Start();
  }
}
OR
Code: ags
function hGuard_Talk() 
{
  if (myCounter1 == 0) 
  {
    dGuard.Start();
  }
  else if (myCounter1 >= 1) 
  {
    dGuardc.Start();
  }
}
OR
Code: ags
function hGuard_Talk() 
{
  if (myCounter1 == 0)   dGuard.Start();
  else if (myCounter1 >= 1)   dGuardc.Start();
}

So that you can clearly see the beginning and end of each function, if, while, etc. Related: You can press Ctrl-B when next to a bracket or parenthesis, and it will highlight its pair.



~Trent
#492
You can change it in the General Settings, under 'Room transition style'.
If you want to change it in the script, use SetScreenTransition and SetNextScreenTransition.


~Trent
#493
1) Right click to make a new Gui, but select 'New Text Window GUI'. Then go to General Options and 'Custom text-window GUI' to the number of the Gui you just made. [Edit2]: Check out 'Customized Text Windows' in the manual for more details.
2) You'd have to make your own, but I'd suggest looking at the Restart Gui that's included in the default template. Then, use the QuitGame(0)  (just so you know, passing a 1 pops up the Gui that you want to change, whereas a 0 just quits automatically)
3) Nope. if and else is all you got. There's requests for switch statements, but you wouldn't know what those are anyways.
4) Multiple ways to do this, but you'll want to check out 'GUIControl.GetAtScreenXY' in the manual.

[Edit]: Couple of extra things:
-I may come back and post some code for #4, but I kinda wanna make you try it out and then post for help (if needed)
-Did you know that you can use player.Say("blah") instead of cEgo.Say("blah") (assuming that cEgo is set as the player character)


~Trent
#494
Those trees in the back look like they're sprouting from nothing.

And I think the lopsided tree looks fine. I'd tie a tire swing to that baby IRL! :D

~Trent
#495
I'd suggest reading through the sticky in this forum about making RPGs. It's answered in there, along with lots of other goodies and ideas. Warning though, much of it has old code, until the last few pages. Doesn't mean there's good information there though!

On the last page (12), KhrisMUC helps out someone with a similar problem. Read through it, and you can easily adapt it to your use.



~Trent
#496
From the manual:
Character.FollowCharacter(Character* chartofollow, optional int dist, optional int eagerness)

Code: ags

cGirlfriend.FollowCharacter(player, 10, 50)
Will make the girlfriend follow the player, about 10 pixels away, and a little bit before deciding to follow again. Just tweak those two values until you like what you get (read the manual first to see what they each do)


~Trent
#497
Well, can you post the related script? And what are you doing when the error pops up?


~Trent
#498
I think you're gonna need to cut it up in to pieces. Otherwise, you won't be able to send clicks to hotspots, characters, etc in the room. But if you set it as non-clickable (which will send them to previously mentioned) you won't be able to click any of the buttons on the GUI.

As for your new question, I believe you're just gonna have to redo and reimport your backgrounds.


~Trent
#499
I haven't played any new AGS games in a long time.... But I decided to DL this and a few others today.

I must say, I loved it. Absolutely polished, music, graphics, scripting, everything. And the perfect length for what the story was. If it was a longer game, it would've felt dragged out, but you got it just right.


However, I did notice one 'bug'. After deactivating the left (or both) Assassinbot, he'll still reply when you threaten to use the hammer or him.


Thanks for the great game Ben.
~Trent
#500
Hints & Tips / Re: A Tale Of Two Kingdoms
Mon 16/02/2009 08:38:26
He's not trying to get into the village, but rather fight with the leader at the end.

Light:
Super vague hint
Spoiler
You're good at swordfighting, but not that good. You're gonna need something to help.
[close]

Push in the right direction
Spoiler
The 'lesser' way to do can be found in a book in the monastery. The better way is with Fairy magic.
[close]

Blatant answer
Spoiler
If the Dark Sidhe has granted you a boon, you'll have the onyx stone to use on the goblin leader. Otherwise, fill your cloth bag with sand and throw that at the leader.
[close]
SMF spam blocked by CleanTalk