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

#101
I have a character that needs to change his looks during walking.
When walking through a pool the characters trousers must become dirty during walking.

In other words, I want to change views without interrupting the action.

I have several views for the character, all identical, but with different "clothes".

Is there an easy way to switch between the views? Or do I need to do a lot of coding, checking for the actual loop, spritenr and take it from there in the new interaction?

Any suggestions?
#102
Quote from: Candle on Mon 21/11/2005 11:51:10
Why not make a char with the hat on and change to that view and the other view when he takes it off?

Because actually I have a vehicle with soem wiring that can be turned on and off. i have 10 wires => many many combinations. It would mean to draw loads and loads of sprites..
#103
No offset is available in follow character.
That's why.

It is not really complicated:

all I need to do is figure out the cMain position (cMain.x, cMain.y) and place the active characters at the corresponding coordinates.
This can be done is a small loop.

Clicking the character will rsult in it turning trnasparent, clicking again will undo the transparency.

Quite simple I would think, but the small AGS typic problems prevent it from working correctly right now :-(
#104
I have a vehicle which can be steered by dahusting the wiring during driving./

Therefore I need a set of characters (I have too many for objects to be used, > 20) to move IN FRONT (drawn on top) of the vehicle.
These characters must move exctly along with the vehicle. E.g. the headlights must move along.

The trick with cCharacter.x = cMain.x + offset works quite ok, except that the cCharacter moves just after the main character.
It is drawn behind the main caharacter.

Any suggestions on how to do this would be greatly appreciated.

martijn
#105
thnx,

now another strage eeror:

function PlaatsDraden(int DraadID, int xcoord, int ycoord) {
if ( character[DraadID].Moving )  character[DraadID].StopMoving;
  character[DraadID].x = xcoord;
  character[DraadID].y = ycoord;
}

in the second line an ( is expected. Why???
Any suggestions?

Martin
#106
In my game I have a set of caharcaters that should move in sync with the main character, but with an oofset.

FOLLOW_EXACTLY does not help here, sinde it does not provide the option of an offset.

I intend to make a small loop:

while (i <MaxChars)
  Char.x = cMainChar.x + Char.xoffset;
  Char.y = cMainChar.y + CHar.yoffset;
  i++;
}

Can thsi be done?? I am a bit confused by the obsoletness of a number of Charprperties.

Martin
#107
I want to set some characters at a start position when entering a  room.
(a hat on a main character). From there I intend to make the hat stay on the characters' head with FolloCharacterExactly.

I think I need to set everything in place before player enters room. I made a funtion

Initialize(string name, int xcoord, int ycoord){
if (character[Name].moving) StopMoving(Name);
Character[name].x = xcoord;
Character[name].y = ycoord;
}

But the code does not work (character[name].moving seems to be obsolete)
Does anyone know what to replace it by?

thanks in advance,
Martin
#108
great idea I guess. Our contributions just crossed, as I asked in my previous post about this ;-)

I can make character invisible, yet clickable by setting transparency to 100% I found out in http://www.adventuregamestudio.co.uk/yabb/index.php?topic=22558.0

great!
#109
Yep, I read the thread.

So no other option than another approach...
Too bad, but I was afraid so.

One more option may be to use less objects but mirror them somehow. Would that be possible in any way?

the left-sideÃ,  and right-side view are symetric.

Another idea: could I use multiple characters? each wire is a character and the characters move along with the vehicle. Disappearing when clikced and reappearing when clicked again. Some transparency option maybe? Like turn the characters into 'ghosts" when the wires are removed (metaphorically spoken)


For those of you interested in the exact puzzle:

To be exact:
I have a puzzle with a caterpillar vehicle. The engine for left and right side can be connected to a battery.
When headlights are connected (flashlight plugin will be used here), voltage over theÃ,  engine parrallel to the headlight drops and the vehicle starts turning. (when right headlight is connected, right engine slows down, vehicle turns right. You have to shut of the light to turn back, but then you cannot see the whole anymore)
This way I want to follow a track in the dark. The player has to connect battery and headlights in a sensible way to finish the track.

Learning goal is to get used to the non-local effects of connecting an element in a circuit.
I hope the puzzle is challenging enough for the student to keep going and effective enough to remember the essential message hidden in it...

The caterpillar vehicle is drawn in three views: straight, left-side and right side.
Once you get of the road you loose, you have to avoid wholes in the road and you have to keep up to speed (connect two batteries in series)

#110
sprites are about 50 pixels height and width (sometimes I have wites, long and narrow, sometimes lightbulbs: round)
Typical size is  1 to 2 times the size of the standard blue cup.

The game is 640*480 resolution, 16 bit color.

Alpha channel???


#111
Thnaks, it works great but slow...


here is my code:
Code: ags

//#################################################################KOOPS FUNCTION SHOW_WIRING #####################################
function DrawComponents(){
Ã,  int i;
Ã,  RawRestoreScreen();
Ã,  i=0;
Ã,  while(i < MAXHOTSPOTS){
Ã,  Ã,  if (ownhotspot[i].active == 1){
Ã,  Ã,  Ã, if (ownhotspot[i].spriteslot != -1) { //check if a sprite must be drawn, if not, no sprite should be defined
Ã,  Ã,  Ã,  Ã, RawDrawImage(cBike.x + ownhotspot[i].x -ownhotspot[i].sprite_width, cBike.y + ownhotspot[i].y - ownhotspot[i].sprite_height,ownhotspot[i].spriteslot);
Ã,  Ã,  Ã, }
Ã,  Ã,  }
Ã,  i++;
Ã,  }
}


Thios code is placed in the repeatedly_execute_always loop.

Obviously it is too much and slows down the game too much.

I do need the 30 'objects' (actually it is only 10 but since I have 3 sets of views for different perspective (right_side view of the bike, backside_view of the bike and left-side view of the bike) it adds up to 30.

Can this be solved in another way? Or am I forced to simplify the puzzle? :-(

Suggestions?
#112
thnaks for the fast reply !

I have put it in the a function int he global script and it is called in the room script in the repeatedly_execute.

I cannot find a repeatedly alwya section. can i create it myself?
#113
I have a problem with rawdraw functions, and character movement.

I want to draw certain sprites at coordinates that are relevant to a characters position.


This works fine, exept for the fact that the rawdraw functions are called, only when the character stops moving.

So: lets say i have the hat of my main character defined as sprite 160. And the relative coordinates of the head of my character (where the hat must be placed) are hatcoord.x, and hatcoord.y

I Draw the hat as follows:

RawDrawImage(cCharacter.x + Hatcoord.x , cCharacter.y + hatcoord.y  , spriteslot);

The problem that occurs is that the hat is draw in the correct place, but ONLY after the character has stopped moving?
How can I make the hat (sprite) move along weith the charcater?
In other words, how can I rawdraw during mcharacter movement?

It probably has to do something with nonblocking, wait ?? I cannot figure it out.

P.S. I need to workthis way because I have over 30 "hats".

any suggestions?

Martijn
#114
Thanks for the clear explanation, really helpful!
I am learning so much about programminglanguage just by AGS ;-)

KlikPlek means something like KlickPlatz :-P

Initially I thought about naming my struct "hotspot", but since that is an AGS name I figured that it might bring me trouble, that's why I chose this Dutch word, well not really Dutch, I built this word myself, just like KlickPlatz is not really german I guess.

Cheers,
Martijn
#115
In my global script I define a struct and build an arry from it.
I get an error message;

Unexpected KlikPlek


I am not a very experienced programmer so I cannot see what I am doing wrong. Any ideas??

Here is my code:


struct klikplek {
   int nr;
   int x;
   int y;
   int view_nr;
   int x_width;
   int y_width;
  };


KlikPlek klikplek[30];
#116
Thanks for the vast amount of fast reactions.

Using the gui seems to be very elegant way, but can I use collision detection with a gui?

I think that moving objects in sync is the easiest way if I understand it correctly. If presumed that it is the same thing as creating a bounding box, but apparently it is not.

Is this a new feature to move objects in sync? What is it called??

Thanks again,
martijn
#117
is that the only way to do it?
#118
Hi,

I'm back. After more than a year I found some time to continue my game based learning project.
And in doing so new questions arise :-)

Is there a way to create a hotspot on an object?

In my game I have a caterpillar vehicle driving along the road (like the slot machine bike game in the demo game).
When the right engine current is disconnected it turns left and vice versa.
To diconnect the current the player must cut a wire on board the moving vehicle.

Can I define a hotspot on the object?
is there a simple way to do so?

Extra complicated is that the vehicle chnges perspective (is shape) when turning, so calculating the hotspot-area is also a bit complicated.

Any suggestions?

regards,

Martijn
#119
thanx for the fast replyu.
I worked with sin and cosine before to drive my caterpillar vehicle in helicopterview.
If I understand right you suggest more orless the smae, now a birds-view, looking from the sky under an angle.

Does anyone know about an example of such a game. maybe ven an example of a first person movement.

#120
For my game I plan to make the player drive some vehicle through a dark area.
he needs to turn on lights to see where he is going.

Now I am looking at different representations of the scene.
A helicopterview seems to be the simplest to program. But for the game it would be much nicer if the player can drive and see through the main window of the vehicle, scrolling over the planet.

Any suggestions how to proceed?

I know how to program  a bit in AGS, I have made a caterpillar vehicle to be steered by two levers. it works fine.
SMF spam blocked by CleanTalk