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

#161
Simple question: can a function return an array?
And can I collect data from the function like

value.x = MyFunction(inputparamter).xcoordinate;
value.y = MyFunction(inputparamter).ycoordinate;
value.speed = MyFunction(inputparamter).speed;

or can I even state:

value= MyFunction(inputparameter);

Cheers,
Martijn
#162
yes, but I guess that a simpler solution is going to be more complex ;-)

cheers
#163
wires are just sprites. in former versions they were objects, now they are metallic looking bars and resistors as well as light bulbs,

cheers, martijn
#164
In my simulation of electrical circuits I have wires that must change color as a current flows through it.

if the current is low, the wire is normal (gold)
if the current is larger the wire must be dark-red.
if the current is further increaed the wire must turn orange
if the current further increases the wire must become white

because I have 30 elments I cannot create a view with all the different colors and use SetViewFrame. In an earlier demo I did this:
i calculated the curent through the wire, and picked the right viewframe with the current value.

Now I am looking for a scripted solution, where I can influence the color of a single sprite.
is something like this possible? Maybe using color channels or aplha channels ??
I am not familiar with this stuff.
is there anyone who can reflect on my question?

regards,
martijn
#165
Quote from: SteveMcCrea on Fri 09/04/2004 17:39:14
It doesn't look like a floating point plugin...
But then it could just be a big mess.

Note the use of +, - and > which wouldn't work with floating point numbers.

Indeed, I am not aware of the floating point plugin. I just use the calculator plugin to try and calculate these sin and cosine functions. i was already suspecting that I was making a teriible mistake. I am not much of a programmer (yet ? :-)).

Can you help me and explain where the "big mess" starts?

Where can I download the floating point plugin?? It is not on the pluginpage: http://www.adventuregamestudio.co.uk/games.php?category=21

EDIT: I have found a floating point dll: http://www.mccrea.demon.co.uk/step/ags/AGS_Maya.dll

Now I have a question left: How should I implement it? Or is there much better way to proceed in my apporach?

I am not familiar with C++ or a similar language. Should I buy a book about C#, C++, ??

Regards,
Martijn
#166
I have written a small funtion to calculate the positionof a shuttle, steered in a caterpillar kind of way.
You can move left-side or right side or both sides.
I calculate the relative trnaslation, compared to the front of the shuttle, and using the relative translation and the orientation of the shuttle, I want to calculate the abvsolute position.

My function returns values of over 400 though, for an expression like:

Cos(orientation)*-1.
Any ideas?

Here is the code:
function shuttle_position(){

int dxrelx = 0;
int dxrely = 0;
int dyrelx = 0;
int dyrely = 0;

relative_position_change(move_left, move_right);

position.orientation = position.orientation + positionchange.orientation;
 if (position.orientation > 6){
   position.orientation = position.orientation - 6;
 }

dxrely = MultiplyNumbers(GetCos(position.orientation),positionchange.y);
dxrelx = MultiplyNumbers(GetSin(position.orientation),positionchange.x);
dyrelx = MultiplyNumbers(GetCos(position.orientation),positionchange.x);
dyrely = MultiplyNumbers(GetSin(position.orientation),positionchange.y);

Display("dx = %d,%d", dxrelx,dxrely);
Display("dy = %d,%d", dyrelx,dyrely);

position.x = position.x +  dxrely + dxrelx;
position.y = position.y + dyrelx + dyrely;



 return (position);

}
#167
actually that is what did!
The first code still resulted in  an hourglass, by setting this parameter after the animation has been started and checking it in the repeatedly loop, I got the thing working.
If interested in the demo: http://www.xs4all.nl/~koops/ags/spacespy_devel13.zip
cheers
Martijn
#168
Wonderfull comments,
Thank you for taking the time to explain it. I am learning fast and this really helps in structuring my thoughts.
Martijn
#169
Thanks, it did the trick indeed.

Does this mean that the consequence of an animation cannot be in the same instruction part (between the same brackets) or the same function as the animation itself?

Thanks again!
#170
I really appreciate you all thinkingalong with me, but I have not solved my issue.

I get to think my error is too trivial, so I cannot communicate it effectively:

let me refrase: How can I make an animation in such a way that I have control over the rest of the game WHILE the animation is running.

The suggestions you make are really smart, but as long as I cannot influence the start_final_animation parameter, all code that makes use of this parameter won't work either.

regards with excuses for me bothering you so frequently,

martijn

#171
Ok, I understand. leaves me with the problem: I cannot do anything while the animation is running. If there is a timer running, the ANIMATION is still the one blocking my game. I cannot select anything hwile the ANIMATION is running.
Only when the animation has stopped (and the final explosion is shown) I get back control. Then it is too late ......

TYhe bootom thing here is: How can I make an animation run and AT THE SAME TIME be able to select an other object.

Thanks for being so patient with me ;-)

artijn
#172
Thanks for the timer suggestion. it has been quite a while since programmed my latest game in AGS 2.4, so I was not really aware of the power of this feature.

Still, it leaves me with the problem: how can I make anything happen while the timer is ticking?

I want to be able to DO soemthing WHILE the animation is running....
The animation completely being skipped when I select the non=-blocking option is stange, there might be a clue in there; probably something stupid I am afraid :-)
#173
Thanks for replying. i tried it immediately. Unfortunately, now I still cannot do anything when the object is animation. Exactly what problem is with the blocking turned on.

Excuse me for being vague, by "it stops" I mean that is quits in the correct way, no problem here.

Regards,
martijn
#174
I have an object animated with "animateobjectex" command.

if (start_final_animation ==1){
  SetObjectView(0,10);
  AnimateObjectEx(0,1,10,0,0,1);
  Display("Game Over");
  QuitGame(0);
}

Running this code will indeed get me the animation and after it the game stops.

When I do change the last 1 in a 0 (set the animation in the non-blocking mode), the whole animation is skipped.
And the game stops immediately.

Adding the code: while((IsObjectAnimating(10)==1) Wait(1);
results in the whole animation being played, but in a blocking way ....

Any suggestions??
#175
Trying that now. I cannot use "interact with hotspot" as event handler though....
#176
Quote from: Scummbuddy on Fri 19/03/2004 21:45:48
Can you give us a more descriptive idea about whats going on in the scene? Does the object take over the whole hotspot?
\

Yes,


I have created a somewhat crappy script.
I have defined a number of hotspots, coreresponding to electric circuit elements.

To place an element on a hotspot I interact with hotspot and this turns on the object on the hotspot. To remove the element I cannot see the hotspot anymore. For my script it is easiest to use the hotspotnumber again to unselect the object.
Now I have to rewrite the bunch to do an interaction with objects in the "way back".

Maybe a rescript of the whole thing is the best option :-(
#177
Well, I would need to turn off the object before I click the hotspot.
And I want to reach the hotspot itself.
This way I have to turn the object on and off every gamecycle to see if the hotspot was clicked. is that what you mean?
I could test it...
#178
Beginners' Technical Questions / Re:creditz?
Fri 19/03/2004 20:05:48
I figured it out.

The following code was just tested and works fine:

int currentID = 0;
int colour = 12;
int font = 0;
int centered = 0;
int xpos = 10;
int spec_xpos = 50;
int generateoutline = 0;

function addCreditLine(string Text) {
SetCredit(currentID,Text,colour,font,centered,xpos,generateoutline);
}
function addSpecialCreditLine(int image) {

currentID = currentID+1;

// from plugin manual: "SetCreditImage (int ID, int Slot, int center, int xpos, int "pixtonext);
SetCreditImage(currentID,image,1,1,1);
}
function addCreditSpace() {
currentID++;
}

function room_a() {
 // script for room: First time player enters screen

SetEmptyLineHeight(10);

addCreditLine("text 1");
addCreditSpace();
addCreditLine("text 2");



Do you think it has to do with my compiler??

martijn
#179
Beginners' Technical Questions / Re:creditz?
Fri 19/03/2004 19:38:13
Tried it:

SetCredit(currentID++,"Test",colour,font,centered,xpos,generateoutline);


error : parse error expression near "currentID"

regards,

Martijn
#180
Once I have placed an object over a hotspot, I cannot reach the hotspot anymore.

is there a solution for this, or do I have to work my way around using GetLocation(.... etc.

Sorry for being silly, but I plan to ask everything only once ;-)

martijn
SMF spam blocked by CleanTalk