Hi, so I'm not sure what section this goes in, but what art program should I use for backgrounds? I tried to follow the background tutorial on the main ags site, but artgem isn't available anymore.
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 if (UsedAction(eGA_LookAt)) {
Quote from: Khris on Thu 02/01/2014 01:28:29
So the function gets called. Are you actually looking at the items? As opposed to pushing or opening them?
And what do you mean by "nothing I put there"? Where? In Unhandled()?
Quote from: Khris on Wed 01/01/2014 16:23:41
Weird, works fine for me.
One thing you could do (and should, anyway) is to addCode: ags else Unhandled();
at the end, in order to avoid the game doing nothing upon certain actions.
You can also put a Display("Function is called."); at the start of the function to try and isolate the problem.
else Unhandled();
else Unhandled();
Quote from: Khris on Wed 01/01/2014 04:47:18
Did you copy-paste those functions into the script?
Because you need to link them to the event.
AGS isn't going to even look for those functions unless they are entered in the events pane.
function iBook_AnyClick()
{
if (UsedAction(eGA_LookAt)) {
dBook.Start();
}
}
function iSheet_AnyClick()
{
if (UsedAction(eGA_LookAt)) {
cRachel.Say("It's my bedsheet.");
}
if (UsedAction(eGA_UseInv)) {
if (cRachel.ActiveInventory == iPants) {
cRachel.AddInventory(iSPTT);
cRachel.LoseInventory(iSheet);
cRachel.LoseInventory(iPants);
cRachel.Say("I tied my pants and sheet together. It looks like a rope now.");
}
}
}
function iPants_AnyClick()
{
if (UsedAction(eGA_LookAt)) {
cRachel.Say("It's my pants.");
}
if (UsedAction(eGA_UseInv)) {
if (cRachel.ActiveInventory == iSheet) {
cRachel.AddInventory(iSPTT);
cRachel.LoseInventory(iSheet);
cRachel.LoseInventory(iPants);
cRachel.Say("I tied my pants and sheet together. It looks like a rope now.");
}
}
}
Quote from: Atelier on Tue 24/12/2013 17:44:11
The Hobbit was way too unrealistic for me. Yeah I know "but it's a fantasy!" yet even fantasies shouldn't exceed the framework of the world it's set in. Eg everything in Lord of the Rings or GoT is believable if you accept the basic rules of the fantasy world. But I'm pretty sure the hobbit and dwarves wouldn't survive a 10 million foot drop inside the goblin kingdom, and that chase scene was way too action movie-ey, and there was a genuine WTF moment when I saw that messenger on the string that the goblin with the deformed ball sack on his head speaks to. I also hated the whole White Orc subplot, not withstanding the CGI for it just looked so out of place for some reason. And in the trailer for Desolation of Smaug I saw Thorin jump about 10 feet into the air off a cliff, that would never happen.
I was hoping to see something in the same vein as the LotR but it turned out to be a dumb children's movie (the scene where that hedgehog called Sebastian dies actually made me angry). At least PJ stayed faithful to the text as it's essentially a children's book anyway. As a massive LotR fan I still hated it though.
Quote from: Khris on Mon 30/12/2013 23:24:14
You can use standard script commands in dialogs by indenting them by at least one space.
Just useCode: ags aSound.Play();
Quote from: Khris on Mon 30/12/2013 23:31:12
Here's the thing: the way the 9-verb GUI was written, when it comes to inventory items, it actually uses the look at event, not the other click event.
The simple solution, as explained in the PDF that comes with the template:QuoteFor inventory items, it's a little bit different, because there is no any_click event in the room editor. So you first start
with "other click on inventory item", which creates the function iCup_OtherClick (in case you have an item, called
iCup).
Now copy this function name and paste it at other events, like Interact, look, talk and so on. In the end, you only have
one function name in all five events. You can also take a look at the sample items.
function iBook_OtherClick()
{
if (UsedAction(eGA_LookAt)) {
dBook.Start();
}
else Unhandled();
}
function on_mouse_click(MouseButton button) {
if (!is_gui_disabled()) {
int mrx=mouse.x+GetViewportX();
int mry=mouse.y+GetViewportY();
int x=mouse.x;
int y=mouse.y;
// get location under mouse cursor
GSloctype=GetLocationType(x, y);
GSlocname=Game.GetLocationName(x, y);
GSagsusedmode=Mouse.Mode;
used_action=global_action;
InventoryItem*ii = InventoryItem.GetAtScreenXY(x, y);
if (GSloctype==eLocationHotspot) {
Hotspot*h=Hotspot.GetAtScreenXY(x, y);
GSlocid=h.ID;
}
else if (GSloctype==eLocationCharacter) {
Character*c=Character.GetAtScreenXY(x, y);
GSlocid=c.ID;
}
else if (GSloctype==eLocationObject) {
Object*o=Object.GetAtScreenXY(x, y);
GSlocid=o.ID;
}
else if (ii!=null) GSlocid=ii.ID;
if (IsGamePaused()) {
// Game is paused, so do nothing (ie. don't allow mouse click)
}
// Mousebutton Left
else if (button==eMouseLeft)
{
if (GlobalCondition(2) || GlobalCondition(3) || GlobalCondition(4)) {
// Do nothing, if:
// the mode is useinv and the mouse is over the active inv (like "use knife on knife")
// or the mode is talk, or "Give", and the mouse isnt over a character
// or its GIVE and the mouse isnt over a inv.item
}
else if (ExtensionEx(1, GSlocname)=='e') {
UpdateActionBar();
ActionLine.TextColor=ActionLabelColorHighlighted;
WalkOffScreen();
}
// walk to
else if (GSagsusedmode==eModeUsermode2) {
ActionLine.TextColor=ActionLabelColorHighlighted;
if (IsInteractionAvailable(x, y, GSagsusedmode)) ProcessClick (x, y, GSagsusedmode);
else ProcessClick(x, y, eModeWalkto);
}
// talkto
else if (GSagsusedmode==eModeTalkto && IsInteractionAvailable(x, y, GSagsusedmode) && GSloctype==eLocationCharacter) {
ActionLine.TextColor=ActionLabelColorHighlighted;
if (GoToCharacter(character[GSlocid], eDir_None, NPC_facing_player, 1)) character[GSlocid].RunInteraction(GSagsusedmode);
SetAction(eMA_Default);
}
// Giveto
else if ((GSagsusedmode == eModeUseinv) && GSloctype==eLocationCharacter && isAction(eGA_GiveTo)) {
ActionLine.TextColor=ActionLabelColorHighlighted;
ItemGiven=player.ActiveInventory;
if (GoToCharacter(character[GSlocid], eDir_None, NPC_facing_player, 2)) {
if (IsInteractionAvailable (mrx - GetViewportX (), mry - GetViewportY (), eModeUseinv) == 1) {
character[GSlocid].RunInteraction(eModeUseinv);
}
}
SetAction (eMA_Default);
}
else {
UpdateActionBar();
ActionLine.TextColor=ActionLabelColorHighlighted;
ProcessClick(x, y, GSagsusedmode);
SetAction(eMA_Default);
ItemGiven=null;
}
}
// Mousebutton Right
else if (button==eMouseRight) {
if (alternative_action==eMA_Default) {
SetAction(eMA_Default);
ActionLine.TextColor=ActionLabelColorHighlighted;
if (Mouse.Mode==eModeUsermode2) {
if (ExtensionEx(1, GSlocname)=='e') {
UpdateActionBar();
ActionLine.TextColor=ActionLabelColorHighlighted;
WalkOffScreen();
}
else ProcessClick(x, y, eModeWalkto);
}
else ProcessClick(x, y, Mouse.Mode);
}
else
{
SetAction(alternative_action);
used_action=global_action;
UpdateActionBar();
ActionLine.TextColor=ActionLabelColorHighlighted;
GSagsusedmode=Mouse.Mode;
if (GSagsusedmode==eModeTalkto && IsInteractionAvailable(x, y, GSagsusedmode) && GSloctype==eLocationCharacter) { //(GetCharacterAt (mouse.x, mouse.y) < 7))
if (GoToCharacter(character[GSlocid], eDir_None, NPC_facing_player,2 )) character[GSlocid].RunInteraction(GSagsusedmode);
}
else ProcessClick(x, y, GSagsusedmode);
SetAction(eMA_Default);
}
}
//left click in inventory
else if (button==eMouseLeftInv) {
if (!isAction(eGA_GiveTo))ItemGiven= null;
if (GlobalCondition (1)) {
// if the mouse is in the inventory and modes Walk or pickup are selected
SetAction (eGA_Use);
location=GSinvloc;
if (Extension()=='u' && ii.IsInteractionAvailable(eModeInteract)) {
// use it immediately (not with anything else)
used_action=global_action;
ii.RunInteraction(eModeInteract);
SetAction(eMA_Default);
}
else {
if (oldschool_inv_clicks) {
SetAction (eGA_LookAt);
used_action=global_action;
ii.RunInteraction(eModeLookat);
SetAction(eMA_Default);
}
else player.ActiveInventory=ii;
}
}
else if (GlobalCondition (2) == 1) {
// if the mode is useinv and the mouse is over the active inv (like "use knife on knife")
// so do nothing again
}
else {
used_action=global_action;
if (Mouse.Mode==eModeInteract) {
if (isAction(eGA_Use) && ii.IsInteractionAvailable(eModeInteract)) {
ActionLine.TextColor=ActionLabelColorHighlighted;
ii.RunInteraction(eModeInteract);
SetAction(eMA_Default);
}
else player.ActiveInventory=ii;
}
else {
if ( (Mouse.Mode >0 && Mouse.Mode <10 )&& ii != null) {
GSagsusedmode=Mouse.Mode;
ActionLine.TextColor=ActionLabelColorHighlighted;
ii.RunInteraction(Mouse.Mode);
SetAction(eMA_Default);
}
}
}
}
//right click in inventory
else if (button==eMouseRightInv) {
if (alternative_action==eMA_Default) {
SetAction(eMA_Default);
}
else {
SetAction(alternative_action);
used_action=global_action;
GSagsusedmode=Mouse.Mode;
if (Mouse.Mode==eModeInteract) {
if (isAction(eGA_Use) && ii.IsInteractionAvailable(eModeInteract)) {
UpdateActionBar();
ActionLine.TextColor=ActionLabelColorHighlighted;
ii.RunInteraction(eModeInteract);
SetAction(eMA_Default);
}
else player.ActiveInventory=ii;
}
else {
UpdateActionBar();
ActionLine.TextColor=ActionLabelColorHighlighted;
SetAction(eMA_Default);
}
}
}
}
}
function repeatedly_execute_always() {
// Doubleclick Timer
if (!IsGamePaused() && !is_gui_disabled()) {
if (timer_run == true)
{
timer_click++;
if (timer_click >= dc_speed){
timer_click = 0;
timer_run = false;
}
}
}
}
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.039 seconds with 15 queries.