timed region scripting help

Started by Mr.Trant, Sat 21/06/2003 02:00:16

Previous topic - Next topic

Mr.Trant

im tryin to make a game that has an enemy shoot every so often, how could i make it that he shoots like evey 5 secs???

how could i make it that the bullets could hurt u shoud i make it a char or an object?? ow would i make an nteraction between the char and the bullet?? hotspot or scripting??

miguel

hello trant,
you should use a timer to get your enemy to shoot every 5 seconds, there are colision functions for your second question (object hiting character or the other way around) and yes you have to get into scripting to do both,
read the manual and get all the tutorials avaiable and just try it, It's better than waiting for somebody to show you the script and it could happen that you would not understand it,
scripting takes a bit of your time but will reward you,
happy coding
Working on a RON game!!!!!

Mr.Trant

where would i type the script in at for the timer??

and same thing with the collision script???


have any idea wut either script's would be??

SSH

Miguel is right, you'll need to ahve some idea of scripting, but to get you started. You'll need to say:

SetTimer(1, 5*40) /* 40 ticks a second in AGS */

on your room entry (or whatever starts the guy shooting) interaction, then in your repeatedly_execute script, check for:

if (IsTimerExpier(1)) {
}

then change the gun/shooter pic to show some kind of flash, then set off the bullet. You may also want to restart the timer. Now, if it's a normal gun, and not some slow ballistic thing, then you probably should have the bullet travel "instantly". But maybe you want the bullet to travel slowly to give the hero time to dodge. In which case, I would use a character, becuase AFAIK, there are no background moving functions for objects (anyone?) so:

MoveCharacterDirect (BULLET, player.x, player.y);

and then again in repeatedly execute:

if (AreCharactersColliding(EGO, BULLET)) {
 NewRoom(DeathRoom);
}

or something similar. You may need to turn off the automatic collision avoidance system (can't seem to find script function for this)

Hope that this gets you going
12

Mr.Trant

#4
where would i put the "set timer (1,800);}"???
where would i put the "if (IsTimerExpier(1)) {
}"

and wut is AFAIK???


in the character menu, for character speed, is the lower nmber faster??? or hgher number faster??? wut would be really fast??

SSH

Quote from: Mr.Trant on Mon 23/06/2003 23:40:59
where would i put the "set timer (1,800);}"???

As I said, If the guy starts shooting as soon as you enter a room, put it in the enter-room interaction. If it is something else, put it in the appropriate interaction.
Quote
where would i put the "if (IsTimerExpier(1)) {
}"
Ooops Expired, not Expier (Brighton pier, maybe? :) )

as I said, in the repeatedly_execute script
Quote
and wut is AFAIK???
As Far As I Know

Quote
in the character menu, for character speed, is the lower nmber faster??? or hgher number faster??? wut would be really fast??

Come on, have you even tried reading the manual? I'm not going to write you whole game for you.
12

Pumaman

Mr Trant, people here are going out of their way to help you, the least you could do is at least attempt to do it yourself, then ask for help when you get stuck with a specific problem.

If you are not prepared to read the manual and get the basics mastered, then I don't think you should be attempting to implement timers and shooting just yet.

Mr.Trant

sorry cause im only 15 and im not exactly the best at this so sorry i thought this wa for help, christ, u guys aint gotta be such asses, but i still have no clue... srry..

so i should but the "set timer (1,800);}"under the enter room script, by using the "run script function"

and put the if(IsTimerExpired(1)){
under "epeated executed"

but wut does that do???

Mr.Trant

k i did the bullet thing but theres no way to dodge it, but i have a dodge loop but how would i have a script where it goes...

if (*character animating loop#)
      move npc char to dif room; }

it would be sumthin like that but i kno that isnt rreal scripting but thats the jist of wut i want it to be like

Proskrito

#9
Everyone that starts with ags dont know the functions, its something new to everyone, but there is a manual, where everyone looks for the functions they need. It explains ALL functions you´ll need very clearly, even with examples. If you are going to ask every sigle function in the forums you arent gonna finish a game ever.

For what you want, look in the manual:

- character[]. variables
- NewRoom or NewRoomEx functions

SSH

Quote from: Mr.Trant on Tue 24/06/2003 22:40:13
sorry cause im only 15 and im not exactly the best at this so sorry i thought this wa for help, christ, you guys aint gotta be such asses, but i still have no clue... srry..

Well, considering that some guys on these forums have produced excellent games and are younger than you, youth is no excuse. I was writing in BASIC before I even had a computer, back in 1984 when I was 9. And I was programming in C before I was your age.

And don't call me an ass if you want to get any help from me.  :'(
12

Mr.Trant

#11
n/a

Mr.Trant

u ppl r such dicks, god, wtf srry if i am not a loser that fuckin lives in their moms basement and never seen a naked girl and makes games on their comps and be's a dick to ppl tryin to make their first game, i kno each one of u guys asked as many q's as me so dont be dissin me just cause u think ur better than me cause ur not!!!
just cause u kno more means shit, askin questions is wut the fuckin forum is for u assholes, u cant stop me cause ill just keep comin back it th same q's everyday til i get  an answer!!!!!!!!!  >:( >:( >:( >:(

scotch

#13
Excuse me Mr Trant, everyone has tried to be helpful to you.  You're trying to do things AGS isn't designed for and without trying to be offensive you don't seem to have much experience with these things.

AGS is for making adventure games, you will not be able to make the things you are asking for unless A you do more basic things first and learn slowly or B you ask nicely and clearly for help.

Calling people dicks is not the way to go about it.

I beg you to just make a simpler point and click adventure game which is more suited to your skill level or grow up a bit and ask for help properly, you seem pretty childish for your age at the moment.

Mr.Trant

heres my prob, when i put the...

if (AreCharactersColliding(THEONE, BULLETONE)) {
        SetCharacterview (THEONE,4);
        Animatecharacter(THEONE,14,5,0);
        NewRoom(10);
}
                            .... under repeatedly execute, it automatically sends me to the room w/o even the bullet hitting the character, nor doin the anim, and it goes straight to the room then does the animation from "view 3"??

|Alky|

Dude, I don't think that's the right attitude...
Nor is boasting about programming skills though...

Anyway...
Mr. Trant..
Are you sure you want to make an adventure game?
These are generally designed so as to have as little shooting and action as possible, and to rely more on the  players thinking skills... If you want to make a shooting game, look into modifying Half Life, Unreal Tournament or another FPS...or something called Gamemaker for arcade games....Even if you do want to make an adventure game, I'd try something simpler to start out.

And while it's totally your choice, I think it would be cooler if you tried to make a game based on an original idea.. But other than that, good luck..
Alex 'Alkaline' Cline

We're going back to the tick tock to get the boo-boo. Send for backup. - Baby's Day Out

Proskrito

#16
Quoteu ppl are such dicks
a good start...
Quotesrry if i am not a loser that fuckin lives in their moms basement
not everybody here does. do you?
Quoteand never seen a naked girl
¿how do you know? ??? possibly people here has seen more naked girls than you, as a matter of age. Anyway,do you think that to be something that makes you better/worse? (and hey, everybody here has internet  ;))
Quotemakes games on their comps
Isnt it what you are trying to make?
Quotei kno each one of you guys asked as many q's as me
I think you are wrong. 99% of the people here read the manual when they come up with a problem. You wont find many posts asking how to move a character form a room to another. (im not trying to be rude, thats a fact)
Quoteso dont be dissin me just cause you think your better than me cause your not!!!
Nobody here is better or worse than another, everybody is different. However, there are people that behaves in a more mature way than others.
Quotejust cause you kno more means shit,
No, that means that they have read the help file and you havent.
Quoteaskin questions is what the fuckin forum is for you assholes
Well, read the Forum Rules and think about that.
Quoteyou cant stop me cause ill just keep comin back it th same q's everyday til i get an answer!!!!!!!!!
I think your IP could be banned

So, concluding, please read the manual and the forum rules, and remember that people is more likely to help you if you dont call them "dicks", "losers" and  "assholes".

PS: There is no need for posting a 3 characters reply, and then posting another 1 minute later. You can edit your posts. (again, read the forum rules please)

Pumaman

Quote from: Mr.Trant on Wed 25/06/2003 18:45:29
u ppl are such dicks, god, wtf srry if i am not a loser that fuckin lives in their moms basement and never seen a naked girl and makes games on their comps and be's a dick to ppl tryin to make their first game, i kno each one of you guys asked as many q's as me so dont be dissin me just cause you think your better than me cause your not!!!
just cause you kno more means shit, askin questions is what the fuckin forum is for you assholes, you cant stop me cause ill just keep comin back it th same q's everyday til i get  an answer!!!!!!!!!  >:( >:( >:( >:(

I see.

Nobody thinks they're better than you, but it seems like what you are attempting to do is not really what AGS is designed for. There are other game makers that are probably more appropriate for the style of game that you want to make.

And please don't resort to swearing, name-calling and threats, it's really not going to help your case.

Mr.Trant

Fuck u guys goto ill do wut i want u cant stop me u fuckin flamer ill beat ur ass, wtf then make an adventure game studio u douche!!

TerranRich

Mr.Trant, frankly I've had enough of this. You had better grow up and act your age very soon or you WILL be banned. This is not just another forum where you can swear and flame and do what you like. People here try to act civil and as nice as they can, and what do you do? You respond with anger, hatred, and a whole lotta nothing.

I'd strongly suggest you either keep your "mouth shut" metaphorically speaking and just read the damn manual for a change, or give up altogether, because with an attitude like that, nobody's going to want to help you at all.
Status: Trying to come up with some ideas...

SMF spam blocked by CleanTalk