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

#641
Thankyou all, a simple solution was there as I knew :P
It turned out to be painless adding a hotspot (previous tried and failed code doing this exact thing has led me astray from it), though more complex than the 1% opacity colour :)
#642
Hi
I've been trying to select objects, but if they're quite small, I can't do it. Take for example a key, whose spine is very thin; I can only select with the mouse pixel-perfect, and it takes ages. I've thought of a solution to this (compare mouse cursor to a range), but can't figure out how to implement it. Also I've though of surrounding the graphic with a colour one shade above transparent (very difficult, always comes out white, no idea how to use transparency), and attach a small 10x10 pixel object the mouse x,y, and check whether it's colliding with anything (also no idea how to do this, having a general object in Global mode).

Can anyone help? Has anyone had this pesky problem before? I imagine so but can't find any solutions to it.
#644
Hi there,
Been playing with animation. I want to have a background character:
1. choose a random number
2. choose animation based on number
3. play the animation, NO blocking; so it plays in the background
4. while it's animating, don't allow the routine to choose another animation.

Code for this is:
Code: ags

function room_RepExec()
{
	if (cPig.Animating==false) {
		PigRandAnim=Random(2);
		if (PigRandAnim==1) {	//idle
			cPig.LockView(53);
			cPig.Animate(1, 1, eOnce, eNoBlock);
			cPig.UnlockView();
			Display("finished normal view");
		} else if (PigRandAnim==2) {	//drinking
			cPig.LockView(5);
			cPig.Animate(1, 1, eOnce, eNoBlock);
			cPig.UnlockView();
			Display("finished drinking view");
		}
	}
}


But this doesn't work - I just get constant reminders that "finished <something> view", the animation doesn't actually occur.

If I do eBlocking, everything works fine; but I can't do anything since this isn't happening in the background, and stops everything else.

IdleView and NormalView are set. I've tried with MovementLinkedToAnimation as true and false, no dice.

I feel like this has something to do with NormalView showing only frame 0 if not moving (character never moves); but I can't get my head around it. Maybe you can help?

#645
"Too many overlays" error, I couldn't remember so I said segfault.
#646
Hi,

I recently discovered Overlays for writing text on screen. However, they only go for a few secnods, and cause a runtime error. So:

for (...) {
    set an overlay
}

Presumably this writes it every frame and then overflows; but how can be done any other way? If I want to display a timer, or a variable, do I always have to add "if (value has changed) { draw an overlay }" ?
#647
Or is there only one inventory?

I'm trying to do something in the game where the player character's inventory is has no items - it gets stolen - and then returned.

Should I use another character's inventory?
How do I display it in gInventory.Visible?
Should I do this, or just make another identical gInventory GUI without the inventory "window" (invCustomInv) in it?
#648
Where would I find this module?
found it.
#649
I'm just wondering if this property applie to anything other than Characters? How would I artifically/scripting this solution?
#650
Ryan Timoothy, do you still have this script file? Link leads to a domian squatter, download is gone.
Could you run me through what the script does maybe?
#651
Why are they fast separately (AnimationSpeed and Delay), but together very slow? How is -14 slow?
Or should I be using AnimationDelay?
#652
Ah, that's it :))
I'm not using an enumeration as there's no "mid" view, only high and low animations. But I might as well try (first time I've defined a struct).
I need to read Kris's examples more closely.
#653
Not this. I've tried changing it (function and header) to PickUp, pickUp, pickUpObject etc. Don't know how the above happened :p.. but still when I write the function name nothing comes up once compiled, not even if I reset the editor, open and close rooms...

Also no errors when I change function order, as with other functions which generate a "defined twice" error.
#654
Thankyou :)

Only one problem (and I'm sure this is a boneheaded mistake, but nothing makes it go away), the function I created in GlobalScript will not work in the room.

in GlobalScript script:

Code: ags

function PickUp (this Character*, int height, InventoryItem *i, Object *o)
{
  // height: eLow = 0, eHigh = 1
	int loop=0;

	if (height==0) {
		height=50; //low
	} else {
		height=49;	//high
	}

	if (this.x >= o.X) {
		loop=2;	//right
	} else {
		loop=1;	//left
	}
	
  this.LockView(height);
  this.Animate(loop, 0, eOnce, eBlock);
  this.AddInventory(i);
  o.Visible = false;
  this.UnlockView();
}


function PiratesLeaveToBar ()
{
...


in GlobalmScript header:

Code: ags

...
import function PiratesLeaveToBar ();
import function PickUp (this Character*, int height, InventoryItem *i, Object *o);


All compiles; nothing works in 'room16':
Code: ags

        ...
	cJulius.Phylactere("How am I making room for all these objects?");
	pickUp(cJulius, 1, iFishEye, oFishBowl);
}

Undefined Token: 'pickUp'

I've tried:
-recompiling with a different name
-changeing the order in which the function comes in the GlobalScript script
-bashing my head against a brick wall

All compile, no errors; until I use it in a room script.

I've done this with about 20 other custom functions; they import into the game fine, I use them in rooms, nothing happens.

What should I do? I know it's something obvious :/
#655
Please see video: http://redrom.ltd/img/ice_video_20170611-130152.webm

Why is the second part happing, when the main character picks the croissant off the floor?
It's supposed to:
-walk down the screen to a predefine point
-oustretch arm
-croissant is gone

What actually happens
-slides down screen, repeatedly going the outstrething arm animation
-stops, does the animation again
-croissant is gone

I've tried two different walkable areas -- straight down the side, and jagged -- but it still happens.
Here's the code:

Code: ags

function oFishBowl_Interact()
{
	cJulius.Walk(472, 476, eBlock, eWalkableAreas);
	cJulius.Phylactere("How am I making room for all these objects?");
	cJulius.Animate(8, 0, eOnce, eBlock);			//high pickup left
	cJulius.AddInventory(iFishEye, 0);
	oFishBowl.Visible=false;
}

function oFishBowl_Look()
{
  cJulius.Phylactere("A lens which is home to a fish.");
}


function oCroissant_Interact()
{
	cJulius.Walk(315, 719, eBlock, eWalkableAreas);
	cJulius.Animate(8, 0, eOnce, eBlock);			//high pickup left
	cJulius.AddInventory(iCroissant, 0);
	oCroissant.Visible=false;
}

function oCroissant_Look()
{
	cJulius.Phylactere("Delicious.");
}


Both the first (fishbowl) and second part (croissant) are the same; but they have two different results.

It happens sometimes in other situations, but ALL the time in the one shown in this video.

I've moved the location of the main character, but it stil happens.
#656
Nope, tried renaming it, deleting the original function, etc. :/
#657
Ah, okay.
#658
Exactly how does the EXE reference it's own install dir? Should I make it '/sync/' or 'C:/moci/Compile/Windows/sync' or...?
It seems the directory where the TSV files are stored is hard-coded in, so it will only work if the game is in '/programme files (x86)/moci/sync', and nothing else -- which makes it hard for testing.
#659
But if the game searches for sync/ and not Windows/sync/ ?...
Oh well I'll change it.
#660
I am curious - haven't yet tried a comipiled game...
If my sync/ folder is Compiled/; but my actual game is in Compiled/Windows/ - does this mean I include the sync directory in Windows/ too? Is the sync/ files just compiled into the game EXE?
SMF spam blocked by CleanTalk