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

#2121
I think he is refering that such images have large one-color areas resulting in increasing game size (comparing with original images of course).
#2122
Quote"force alternate screen resolution" isnt an option - just the three resolution modes.
...but it enables standart resolutions instead like 320x240 or 640x480 which may work.

QuoteThe exact error message is "resolution not supported" if that provides a hint.
how about your video drivers? Is there a chance you upgraded them?

-Cheers
#2123
QuoteOkey, I don't see why not.
Thanks, Cj.

QuoteA workaround is of course to record in a GlobalInt whenever you change the Anti-Glide Mode setting, and work it out from that.
Yep, that is how it works for now. I have function get called on game start event which overrides anti-glide setting. Thereby I know it's state. But I just want to know it's initial state (in the editor). What I do is a movecharacter() function but it should work differently depending on anti-glide mode setting (whether it would work relying on character[].animspeed value when updating the char's position or not etc.)

thanks again

-Cheers
#2124
Sorry for bothering you CJ, but when I was looking for such a function like GetGameOption() I could'n find one. What I really need is to know whether the anti-glide mode is turned on, then execute depending on the result. Is there a chance you'll implement one? :P

-Cheers
#2126
Remembering the speed tests we had carried out not so long ago, some people had a low (or limited) fps rate. That's strange as they have a fast enough CPUs and AGS doesn't use any video hardware acceleration.
#2127
Well, if you suppose to use flashlight plugin all you need is to check out whether the centre of flashlight circle have been directed right on the box. Then show a message.

-Cheers
#2128
Having a special function to place the character may help to organize the code:


//Global script:
ChangeRoom(int CharId, int NewRoom, int X, int Y) {
 if (CharId == GetPlayerCharacter()) {
    NewRoomEx(NewRoom, X, Y);
 }
 else {
    StopMoving(CharID);
    character[CharID].room = NewRoom;
    character[CharID].x = X;
    character[CharID].y = Y;
 }
}


//Script header:
import function ChangeRoom(int CharId, int NewRoom, int X, int Y);



Now you can use the function this way (for example):
Inside some interaction event:
ChangeRoom(EGO, 4, 100, 160);
ChangeRoom(MAN, 5, 110, 200);

etc.

-Cheers
#2129
Quote
QuoteFirst, I love the snow rain plugin... very nice looking. Question: When you distribute a finished game (and include the dlls with it,) do you have to specify to the user to put the dlls in his windows folder?


No, the DLLs just need to be in the game folder.
Yep, the rule is simple enough: just keep both dlls in the same folder where the game .exe is.


QuoteDoes this only work with high color games, or 256 color also?
Well, it works for 256 colors game as well. However you wouldn't be able to use transparency effects.

-Cheers
#2130
Happy birthday! :)
#2131
Woohoo... ;D You released the docbook Rick! Can't wait to test it! :P
I hadn't i-net for about two weeks because of my provider (.........!). Now I have one but the connection speed......is slow so I am afraid I can't download it right now.  :-\ When I'll do I post the full feedback to the thread.

PS Great work! ;)

Cheers,
Scorp
#2132
QuoteSetCharacterView (EGO,3);
SetCharacterView (JACKO,6);
AnimateCharacter (EGO,5,0,0);
while (character[EGO].frame < 4) Wait(1);
AnimateCharacterEX (JACKO,5,0,0,0,1);
ReleaseCharacterView (EGO);
Yep, you need Wait(1), as Gilbert pointed out.


QuoteAlso I don't really know what i'm gonna do for the inventory. I want a stats gui that you can click on, then it brings up a stat screen where you can load ammo and equip the guns.
Do you have something done already? You can use GUI buttons to reload the gun etc. Actually I don't fully understand about the exact view/style of that GUI.

-Cheers
#2133
You can use the next method:

int text_id =-1; //stores text overlay id (-1 means none)

function StartDisplaySpeeching(...) {

SetCharacterView(CHARID,talkview);
AnimateCharacter(CHARID,loop,speed,???);
text_id = DisplaySpeechBackground(CHARID,text); //get text overlay_id

}

then inside repeatedly_execute of the room:

function room_*() {
 if (text_id > -1 && IsOverlayValid(text_id)==0) {
       ReleaseCharacterView(CHARID); //stop animation
       text_id =-1; //reset text_id
 }

}

Hope it helps ;)

-Cheers
#2134
Quote* Added GetGameParameter, IsInventoryInteractionAvailable text script functions.
* Added plugin API functions GetSpriteWidth, GetSpriteHeight, GetTextExtent, PrintDebugConsole, PlaySoundChannel, IsChannelPlaying
* SetButtonPic now updates the button size to the size of the new graphic, when changing the Normal graphic.
* Mirrored view frames now work with objects.
* Fixed spurious engine crash "no such function in script" when nesting scripts inside interactions.
* Allow FileOpen to open files in sub-directories if FILE_READ.
Cool changes CJ :D Special thanks for GetGameParameter() function! :)

-Cheers
#2135
QuoteHey... in my game I've got it where when you click the gun in the inventory on another character it runs an animation of the main character shooting. How do i make it so you can equip the gun and have it say a message like "the gun is equiped". then you would be able to press a single key, like control or spacebar to shoot the gun?
It depends on how you want to organize it. Do you have a custom inventory GUI? Can you provide a bit more information on how you suppose to equipe it? You can choose bullets inv item and click it on gun for example or ...?

QuoteQuestion 2: I have animations of the other characters dieing for when they get shot, but i dont know how to run them like halfway through the shooting animation. Can anyone please help me out?
You can try this:

AnimateCharacter(KILLER, ......);
while (character[KILLER].frame < 7) Wait(1);
AnimateCharacterEx(VICTIM, ......, blocking=1);


The script starts the second animation just after KILLER's frame is 7.

-Cheers
#2136
Quote from: BlackBaron on Mon 21/04/2003 18:10:16
Quote from: Scorpiorus on Mon 21/04/2003 11:31:33function repeatedly_execute() {
 if(IsGamePaused()) {
   Display("inside repeatedly");
 }
}

As I said in my first post, I already tried that (and if (IsInterfaceEnabled()==0)) and it didn't work (at least it didn't when the game was paused because DisplaySpeech was used).

Thanks a lot anyway.
BlackBaron: I think it's because the game was blocked (wait mode). But the pausing only doesn't block the repeatedly_execute(). ;)

QuoteYep, that's a clever trick. The problem is that it won't be used when the engine automatically blocks the game, eg. inside MoveCharacterBlocking.
CJ: Yep, that is. The solution would be to write special variant of each blocking function, for example:

//main script

function repeatedly_execute() {
......................
... some code here ...
......................
}

function MoveCharacterBlocking2(int CharID, int x, int y, int direct) {
 if (direct) MoveCharacterDirect(CharID, x, y);
 else        MoveCharacter(CharID, x, y);
 while(character[CharID].walking) { //block the script...
   repeatedly_execute(); //...except repeatedly_execute()
   Wait(1);
 }
}

//script header:
import function MoveCharacterBlocking2(int, int, int, int);



... and replace MoveCharacterBlocking() with MoveCharacterBlocking2() where needed.

-Cheers
#2137
Actually if the game is paused (not blocked) the repeatedly_execute() function is still being called:

function repeatedly_execute() {
 if(IsGamePaused()) {
   Display("inside repeatedly");
 }
}

If you pop up upper menu the game is paused but you see display message as well.

If you need special wait function which blocks the script but still calls repeatedlty_execute I suppose you may use the next one:


//main script:
function SpecialWait(int time) {
 int i=0;
 while (i<time) {
   repeatedly_execute();
   Wait(1);
   i++;
 }
}

//script header:
import function repeatedly_execute();
import function SpecialWait(int);

-Cheers
#2138
Ok, let me clarify that music playing thingy:

Suppose you have a number of MP3 files:
song.mp3
rock.mp3
music0.mp3
music1.mp3

and want them to be played from AGS game.
There is a couple of function you can use:
PlayMusic (int music_number)
PlayMP3File (string filename)


PlayMusic (int music_number)

Changes the currently playing background music to MUSICx.OGG, MUSICx.MP3, MUSICx.MID, MUSICx.MOD or MUSICx.XM (where X is MUSIC_NUMBER). The game will search for the files in that order until it finds one to play.
Example:

PlayMusic(2);

will play music2.

You see a music number is passed to that function. What is it? When you call PlayMusic() function (by the way this function works as Play music option in the interaction editor) it searches for music.vox located in the \COMPILED folder. The music.vox file is the archive file containing all music files.
How to build this music.vox file?
First rename all the mp3 files (also OGG or midi if you want them to be played too) to
music0.mp3
music1.mp3
music2.mp3
music3.mid
music4.ogg
etc.

and place them !into your \GAME folder! (NOT to \Compiled one).
Ok. you done it. but that is not enough. To make music.vox file you have to choose from the editor's main menu: Rebuild vox files. So AGS will look for all musicX.mp3, musicX.mid, musicX.ogg, etc. files located in the \GAME folder and build one music.vox file and place it into the game\compiled folder. Now when you distribute your game you don't need any of musicX.* files but only the music.vox one. Some people mistakenly deliver musicX.* files and music.vox file together which results in doubling the size of the music files.




PlayMP3File (string filename)

Changes the currently playing background music to FILENAME, which must be an MP3 or OGG file.
Since normally MP3 files are built into the MUSIC.VOX file, there may be occasions where you want one MP3 (for example, the intro music) to be distributed with your main game rather than the music pack. So, this function allows you to play any named MP3 or OGG file. However, you will have to bundle the file seperately in your game distribution (it is not automatically compiled into the EXE).

Example:

PlayMP3File ("chesney.mp3");

will play "chesney.mp3" as the background music.

This function doesn't use music.vox file at all. Instead it searches for particular .mp3 file in the \compiled folder. For example if you have file called song.mp3 you have two different ways to include it into the AGS game:

1st. You can rename it to music3.mp3 for example then place into \game folder and rebuild vox files. As result it will be included into music.vox archive and you can play it with PlayMusic(3) function.

2nd. You can just place this file (without renaming) directly into the game\compiled folder. If you rebuild vox files this (song.mp3) file will NOT be included into music.vox archive because of it's name. To play such a file you can use PlayMP3File("song.mp3") function.



Some obstacles:

1. When renaming the files check it's extension because it may be something like music4.mp3.mp3 instead of music4.mp3 because such file as music4.mp3.mp3 will never be included into music.vox archive.

2. If you decided to use PlayMP3File() function and placed all appropriate songs.mp3 files into game\compiled folder be sure you didn't copy it as music6.mp3 into \game folder as in this case if you rebuild vox files you will get 2 different copies of them in the final game pack: one as song.mp3 file and another as a part of music.vox file.

If you have any questions just ask ;)

-Cheers
#2139
I would like to suggest a number of AGS script functions: :)

GetFrameSpd(int view, int loop, int frame)
returns the speed value specified for this frame in the editor.

GetNumFrames(int view, int loop)
returns the number of frames for this loop.

GetNumLoops(int view)
returns the number of loops for this view.

IsRunNextLoopAfterThisChecked(int view, int loop)
returns the state of this option in the editor.

The reason I am asking it is I make a couple of functions which need to know that info. The first is MoveCharacterGlobal(CharId, x, y) (globalmove.txt) which moves the character at the any room. It's complete but when anti-glide mode is turned on I need to recalculate the speed of the character depending on that frame_spd value.
The second is AnimateCharacterGlobal(..) (globalanim.txt) doing the room-independent animation. I still need here GetFrameSpd() as well as GetNumFrames(), GetNumLoops() and IsRunNextLoopAfterThisChecked() functions.

btw I think it would be useful in general to get such info that was set in the editor at design time.

what do you think?

-Cheers
#2140
I find it pretty useful for doing imagesize-related stuff. I could use plugin API but implementing the function into AGS directly would help to keep the things portable. That's always handy to have one more Get*thingy* function. :P

-Cheers
SMF spam blocked by CleanTalk