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 - CB..

#61
ok many thanks!
am studying it;  breaking the timer trigger into cascading sections sounds about right

be nice if there was a

SetTimerEx

for a simple repeat option

yu got me thinking many thanks...(i was worried i was mising somthing simple in the reference manual on repeating scripts)

i got to take the settimer out of the repeatedly execute or give it extra triggers to prevent it running every cycle..and place the set timer in the room start then have an extra trigger for it (have i got that right)
brain wave!! perhaps if i set the characters idle animation to set the timer then it might be self contained?
ill go and have an experiment...all good stuff many thanks for the inspiration..!!
got to say that  AGS is a great hobby in it self!
many thanks !



OK got it!!!!


in repeatedly execute;



if (IsTimerExpired(1)==1)
{int ran=Random(7);
if (ran==0) MoveCharacter(GDTWO,character[GDTWO].x-36,character[GDTWO].y);
else if (ran==1) MoveCharacter(GDTWO,character[GDTWO].x+34,character[GDTWO].y);
else if (ran==2) MoveCharacter(GDTWO,character[GDTWO].x,character[GDTWO].y-36);
else if (ran==3) MoveCharacter(GD,character[GD].x+34,character[GD].y);
else if (ran==4) MoveCharacter(GD,character[GD].x,character[GD].y-36);
else if (ran==5)MoveCharacter(GD,character[GD].x,character[GD].y+36);
else MoveCharacter(GDTWO,character[GDTWO].x,character[GDTWO].y+36);
SetTimer(1,200);
}  




then this in enters room after fade in



SetTimer(1,200);




nice one!!!
#62
use the
if inventory item number was used
then
go to room options  on the character or hot spot etc
#63
not sue what yu are doing wrong ,,
but try this when the player interacts with the hot spot

run script

then click edit script and put this in there under the green header


if (game.score > 39)
NewRoomEx(2,86,178);
else if (game.score < 39)
DisplayMessage(527);


then create a global message in slot 527 or change the number to reference yur message

this will move yu to room 4 at the co-ords if yur score is greater than 39 (ie 40)
and display the message if yur score is less than 39
#64
i have a move character script which i want to repeat every five seconds ,
but if i place it in the repeatedly execute section it trys to execute the script every nano second ,not gving the character time to exexcute the movement before it restarts the timer...if i use wait so it completes the movement before it restarts ,then the player gets stuck in wait mode (because the script is in repeatedly execute etc)
im stuck in a bit of a catch twenty two loop here im afraid!

this would be wonderfull for populating towns with randomly moving characters that actually have a life of their own...

this is the script

SetTimer(1,200);
if (IsTimerExpired(1)==1)
{int ran=Random(7);
if (ran==0) MoveCharacter(GDTWO,character[GDTWO].x-36,character[GDTWO].y);
else if (ran==1) MoveCharacter(GDTWO,character[GDTWO].x+34,character[GDTWO].y);
else if (ran==2) MoveCharacter(GDTWO,character[GDTWO].x,character[GDTWO].y-36);
else if (ran==3) MoveCharacter(GD,character[GD].x+34,character[GD].y);
else if (ran==4) MoveCharacter(GD,character[GD].x,character[GD].y-36);
else if (ran==5)MoveCharacter(GD,character[GD].x,character[GD].y+36);
else MoveCharacter(GDTWO,character[GDTWO].x,character[GDTWO].y+36);
}

i can set it with a lot of regions and have it run as a walk on walk of region run script appraoch but this just isnt satisfying enough and very untidy..with a repeat/loop command it would simply take care of itself

(for example im using it in the escape from colditz game for two gaurds searching for the player as he trys to escape across some fields..)

if there is an easy way to ad a simple loop command to the scripting of movements etc then with all the possible
if
else if's available in the editor some sort of developing AI behaviuor could develop...for instance if a player has an inventory item this can be added into the else ifs and change the behaviuor of the characters  and so on...please tell me its just a matter of adding asome sort of loop command at the end of it!!  
#65
oh sorry like this

SetTimer(1,200);
if (IsTimerExpired(1)==1)
{int ran=Random(7);
if (ran==0) MoveCharacter(GDTWO,character[GDTWO].x-36,character[GDTWO].y);
else if (ran==1) MoveCharacter(GDTWO,character[GDTWO].x+34,character[GDTWO].y);
else if (ran==2) MoveCharacter(GDTWO,character[GDTWO].x,character[GDTWO].y-36);
else if (ran==3) MoveCharacter(GD,character[GD].x+34,character[GD].y);
else if (ran==4) MoveCharacter(GD,character[GD].x,character[GD].y-36);
else if (ran==5)MoveCharacter(GD,character[GD].x,character[GD].y+36);
else MoveCharacter(GDTWO,character[GDTWO].x,character[GDTWO].y+36);
Wait(200);
}



this worked exactly as i was hoping except of course that the player couldnt continue playing the game as he was pernamanetly in wait mode..
the NPC's behaved exactly as i was hoping..ie;they randomly moved round the screen every five seconds/

i have to find a way to make the script repeat every five seconds without putting the player in wait mode..
#66
hi again,
could yu advise me over using a timer to repeat a script ?

ive been experimenting with this

SetTimer(1,200);
if (IsTimerExpired(1)==1)
{int ran=Random(7);
if (ran==0) MoveCharacter(GDTWO,character[GDTWO].x-36,character[GDTWO].y);
else if (ran==1) MoveCharacter(GDTWO,character[GDTWO].x+34,character[GDTWO].y);
else if (ran==2) MoveCharacter(GDTWO,character[GDTWO].x,character[GDTWO].y-36);
else if (ran==3) MoveCharacter(GD,character[GD].x+34,character[GD].y);
else if (ran==4) MoveCharacter(GD,character[GD].x,character[GD].y-36);
else if (ran==5)MoveCharacter(GD,character[GD].x,character[GD].y+36);
else MoveCharacter(GDTWO,character[GDTWO].x,character[GDTWO].y+36);
}


i put it in the repeatedly execute section with a wait command
every five seconds the characters moved randonmly according to the script which was really usefull ..
but with the wait it disables the player interaction etc making the game unplayable;
is there an approach that does the same thing

would a counter do the same job but not pause the players control?
#67
i worked out (im sure it's been done before of course) a very straight forward bog standard battle system just using the score to guage the out come


http://www.agsforums.com/yabb/index.php?board=6;action=display;threadid=9088
 

have a read and see if it fits the bill at all

ive been using it a lot and it seems very reliable and very random in the out come..(no real skill involved of course but it could be added with a little imagination i think?)
#68
sorry for not having told yu how i got on with the areas on off script ,yu got me thinking and i have gottten distracted by using a dice throw for movement ,which simulates a board game type approach which is in the area of what i was doing with the walkable areas ;so it has me wondering which way to go on the script ..

this is a nice approach i think..

RestoreWalkableArea(11);

follwed by

int ran=Random(3);
if (ran==0) MoveCharacter(EGO,character[EGO].x,character[EGO].y+6);
else if (ran==1) MoveCharacter(EGO,character[EGO].x,character[EGO].y-6);
else if (ran==2) MoveCharacter(EGO,character[EGO].x+6,character[EGO].y);
else MoveCharacter(EGO,character[EGO].x-6,character[EGO].y);  

or to ignore walkable areas

int ran=Random(3);
if (ran==0) MoveCharacterDirect(EGO,character[EGO].x-6,character[EGO].y);
else if (ran==1) MoveCharacterDirect(EGO,character[EGO].x-12,character[EGO].y);
else if (ran==2) MoveCharacterDirect(EGO,character[EGO].x-18,character[EGO].y);
else MoveCharacterDirect(EGO,character[EGO].x-24,character[EGO].y);  

then

RemoveWalkableArea(11);



im' useing this sort of thing a lot  

if (AreCharactersColliding(EGO,GDOFF)==1){
int ran=Random(2);
if (ran==0) GiveScore(-10);
else if (ran==1) GiveScore(-0);
else GiveScore(-0);
}      

coupled with the random movemnet dice roll it can give me the sort of board game effect i was hankering after, so yu pointed at the problem form a different angle and really helped nice one!
#69
many thanks i'll try them out and see how i go on

plenty of food for thought there!

#70
is it possible to tell a character to go to a specific walkable area
im using quite a lot of switchable walkable areas and bringing in chracters to be randomly placed like this

character[GDTHREE].x=Random(320);
character[GDTHREE].y=Random(200);
MoveToWalkableArea(GDTHREE);

before fade in as i enter the rooms

it would be extremely handy if i could somtimes specify which walkable area the character
randomly appeared on..ie number 4 or 2 etc...

ive been getting round this by disable-ing certain areas then re-enabling them after the character has appeared..but it's messy stuff to write

allso is there by any chance a way to disable/enable ALL walkable areas (or regions ,hot spots etc) in one script

im using this approach at the moment

int ran=Random(5);
if (ran==0) GiveScore(-150) && SetObjectFrame(0,7,0,0);
else if (ran==1) RestoreWalkableArea(11) && RemoveWalkableArea(12) && RemoveWalkableArea(13) && RemoveWalkableArea(14) && RemoveWalkableArea(15) && SetObjectFrame(0,7,0,1);
else if (ran==2) RestoreWalkableArea(12) && RemoveWalkableArea(11) && RemoveWalkableArea(13) && RemoveWalkableArea(14) && RemoveWalkableArea(15) && SetObjectFrame(0,7,0,2);
else if (ran==3) RestoreWalkableArea(13) && RemoveWalkableArea(12) && RemoveWalkableArea(11) && RemoveWalkableArea(14) && RemoveWalkableArea(15) && SetObjectFrame(0,7,0,3);
else if (ran==4) RestoreWalkableArea(14) && RemoveWalkableArea(12) && RemoveWalkableArea(13) && RemoveWalkableArea(11) && RemoveWalkableArea(15) && SetObjectFrame(0,7,0,4);
else RestoreWalkableArea(15)&& RemoveWalkableArea(12) && RemoveWalkableArea(13) && RemoveWalkableArea(14) && RemoveWalkableArea(11) && SetObjectFrame(0,7,0,5);  


and it ain't pretty at all (excuse the word wrap)

would be so nice to be able to just script


RemoveWalkableArea(s)

and remove them all at one go..same with enable again etc.


or

RemoveWalkableArea(s)(2)(3)(4);  

to remove sets of areas etc

rather than naming them all one at a time?


#71
on the skills thing, im pretty much in the same boat (i haven't gotten to grips with the scripts enough to start writting global variables yet) so im simulating these things as best i can untill i do understand that it is i need to do..that way i can continue to script the game , learning a little more as i go along , then when i do (eventually) grasp the nessecary technique i can redo certain parts of the game to suit..

for the skills thing yu can give the player an inventory item which will then allow him to complete the task  (as an compromise)

or add a region round that tree or areas where yu want him to attempt the task

and use the interaction option



when player walks onto region

run script

if (game.score > 55)
AddInventory(3);





so if the players score is greater than (in this case) 55 he will be given inventory item 3

yu can alter the 55 to any number yu want to suit the game and the same with the inventory number  and the > means greater than ( < would mean less than etc)


this is the sort of thing im using untill i learn better ways of doing things

in my case im writing an escape from colditz game and the player can't succesfully escape untill he has a score greater than 300, (not quite as simple as that but thats the basic mechanics of it )    
#72
AGS Games in Production / Re:mini colditz demo
Wed 22/10/2003 23:41:04
he! he!! i was being slightly ironic ;D
TK said it was interesting and therefore was downloading it, i was waiting to see if anyone had an opion after they had  dowloaded/played it  lol!
i hadn't posted it in the critics area (deliberately as it's a demo) so i shouldn't be expecting any response nessecarily , but given the amount of traffic here in this section of the forum, (which seems a very good thing), silence can be a very loud noise indeed !
it's not important really i guess,  as it's not really an adventure game as such,
#73
AGS Games in Production / Re:mini colditz demo
Wed 22/10/2003 20:30:05
 :o Yikes is it really that bad?  ;D
#74
im using some very narrow walkable areas, they can occasionaly cause the character view to glitch slightly..this might depend on wether the walkable area is a straight line ;ie all the pixels line up, if it looks like a flight of stairs, because it's going diagonaly across the screen then that would make certain parts of the area even less than one pixel across , and cause problems ?
#75
many thanks

yup that works a treat !
#76
the reference manual gives the code for scripting a random script as

int ran=Random(2);
if (ran==0) NewRoom(1);
else if (ran==1) NewRoom(2);
else NewRoom(3);



but implys that more than three "ifs /else/else ifs" can be added

but im not sure how to add the extra randomisations
how would i script more than these three in the same script?

i want to script a random response on the basis of a dice throw , so i need six options in the same randomisation

and more if i can have them (for perhaps a full deck of cards)
#77
AGS Games in Production / mini colditz demo
Mon 20/10/2003 19:40:07
[glow=color,glow width, #characters wide]a little escape from colditz demo game...with some randomisation involved...
the trick is to raise yur escape points either to 500 or use the items and interactions to open up escape routes and new rooms...(now four in the demo)
[/glow]




[glow=color,glow width, #characters wide]UP-DATED[/glow]

COLDITZ DEMO
#78
Quote from: foz on Wed 15/10/2003 23:21:18
It could be the type of sound file.....wav are normally good but if they are wav(mpg extensions) they cause an error after exiting the game.

can any one reccomend a free sound editor programme that saves wavs in the right format to avoid this....as yu can tell im having the same problem (i had thought it was to do with an animated background but im working on a game without any animated backgrounds and i get the "explorer has caused an error in "unknown"  message when i exit the game..all the sounds work perfectly while the game is running ..and there's no trubble when testing the game from the editor the error only occurs when running the game as a standalone exe..)

if it's the specific type of wav extstension im using then i need to find some way of saving them in the right format..bit curious this wish i knew what the "unknown" was


EDIT:

it wasn't the sound format i had used a graphic for the gui and not imported it correctly , i re imported it with use game palette selected and it seems ok now.

which means that GOLDWAVE (an excellent freeware sound file editor) is compatible with AGS
#79
or perhaps if only the currently selected region was displayed on the editor screen so yu could cycle thru the regions
then add a view all user regions check box to see them all at the same time ?
might just about do the same job and be easier to implement..?
any good?  
#80
Ok Puma'
i'll try that out, thanks for the pointer !,
SMF spam blocked by CleanTalk