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

#1
that helped but now only walking left works.... any idea why???


Code: ags

if (keycode==372) { // up arrow
    character[EGO].WalkStraight(player.x, player.y-200,eNoBlock);    
		while ((IsKeyPressed(375)>0) && (character[EGO].Moving)) Wait(1);
    character[EGO].StopMoving();
}
if (keycode==375) { // left arrow
    character[EGO].WalkStraight(player.x-200, player.y,eNoBlock);
    while ((IsKeyPressed(375)>0) && (character[EGO].Moving)) Wait(1);
    character[EGO].StopMoving();
}
if (keycode==377) { // right arrow
    character[EGO].WalkStraight(player.x+200, player.y,eNoBlock);
    while ((IsKeyPressed(375)>0) && (character[EGO].Moving)) Wait(1);
    character[EGO].StopMoving();
}
if (keycode==380) { // down arrow
    character[EGO].WalkStraight(player.x, player.y+200,eNoBlock);
    while ((IsKeyPressed(375)>0) && (character[EGO].Moving)) Wait(1);
    character[EGO].StopMoving();
}
#2
this is what i have now and it still giving me an error '(' expected, and i have no idea what is wrong... someone please help :)


Code: ags

if (keycode==372) { // up arrow
    character[EGO].WalkStraight(player.x, player.y-200);    
		while ((IsKeyPressed(375)>0) && (character[EGO].Moving)) Wait(1);
    character[EGO].StopMoving;
}
if (keycode==375) { // left arrow
    character[EGO].WalkStraight(player.x, player.x-200, player.y);
    while ((IsKeyPressed(375)>0) && (character[EGO].Moving)) Wait(1);
    character[EGO].StopMoving;
}
if (keycode==377) { // right arrow
    character[EGO].WalkStraight(player.x, player.x+200, player.y);
    while ((IsKeyPressed(375)>0) && (character[EGO].Moving)) Wait(1);
    character[EGO].StopMoving;
}
if (keycode==380) { // down arrow
    character[EGO].WalkStraight(player.x, player.x, player.y+200);
    while ((IsKeyPressed(375)>0) && (character[EGO].Moving)) Wait(1);
    character[EGO].StopMoving;
}
#3
i found code for arcade style (arrow keys) movement and i think it was from an old version

i had to rework some of the code i found and i got some help from the help file, but it still giving me a "(" error and ive checked all the counting of ( and {

i hope its not some dumb fix so I don't feel stupid but if anyone could help me out would be great

btw its in the function on_key_press(int keycode) in the global script

Code: ags

if (keycode==372) { // up arrow
    character[EGO].WalkStraight(player.x, player.y-200);    
		while ((IsKeyPressed(372)>0) && (character[EGO].WalkStraight)) Wait(1); 
    StopMoving(EGO);
}
if (keycode==375) { // left arrow
    character[EGO].WalkStraight(player.x, player.x-200, player.y);
    while ((IsKeyPressed(375)>0) && (character[EGO].WalkStraight)) Wait(1);
    StopMoving(EGO);
}
if (keycode==377) { // right arrow
    character[EGO].WalkStraight(player.x, player.x+200, player.y);
    while ((IsKeyPressed(377)>0) && (character[EGO].WalkStraight)) Wait(1);
    StopMoving(EGO);
}
if (keycode==380) { // down arrow
    character[EGO].WalkStraight(player.x, player.x, player.y+200);
    while ((IsKeyPressed(380)>0) && (character[EGO].WalkStraight)) Wait(1);
    StopMoving(EGO);
}


thanks alot guys/gals in advance :)
#4
ok i fixed everything and my timer is actually the timer on a bomb.... everything works fine exactly how i want it to except

when my character walks in front of the timer i want it to be behind him, and right now it shows up on his body, so it ticks through his body.

anyone know anything I can do to fix it?
#5
How do i make it so that it only comes up with the GUI when you click a certain object in a certain room


right now it is popping up no matter what room I am in, and sending me to my death room(as planned) but right away :(

help please :)
#6
I checked around the help files for some help with my issue and i kinda think i need a global variable but am not so sure how to do it...


I have a character who when you talk to him will need to say/do different things depending on a hotspot in the room he is located in.

Code: ags

function character17_a() {
  // script for Character 17 (Sad Tree): Talk to character

if (fixarm == false) {
cSadtree.Say ("One of the bushes in crazy town stole my brother's arm.");
cSadtree.Say ("Go find his arm and give it back to him and I will give you this egg I found.");
}
else {
cSadtree.Say ("Thanks for helping my brother.");
cSadtree.Say ("Here is your reward as I promised.");
object[0].Visible = false;
PlaySound(2);
cEgo.AddInventory(iEasterEggTv);
}  
}



his brother is a hotspot in the same room that he is in.
and here is his code

Code: ags

// room script file
bool fixarm = false;

#sectionstart hotspot1_a  // DO NOT EDIT OR REMOVE THIS LINE
function hotspot1_a() {
  // script for Hotspot 1 (Sad Tree): Use inventory on hotspot
  
if (cEgo.ActiveInventory == iBranch) {
Display ("You throw the branch to the tree and he puts it on himself.");
object[1].Visible = true;
cEgo.LoseInventory(iBranch);
fixarm = true;
} 
}
#sectionend hotspot1_a  // DO NOT EDIT OR REMOVE THIS LINE



My assumption is that the fixarm wont work on the character because it is only defined in the room code, even though the character is in the same room, so I'm kinda stuck on what to do here...


any help is greatly appreciated. Thanks guys.
#7
ok and how about play sound???

Is there a list of all dialog commandS???

nervermind found it in the help file... thanks... kinda dumb you can only do so few things :(
#8




basically my first dialog has a person where you can guess their favorite color and if you get it right i wanted to give the player an inventory item



ive tried so many of the add inventory ways and it gives an error for all of them.

Please help me soon, this is driving me nuts!!!
#9
Code: ags

  // script for Character 9 (Tv): Interact character
int ran = Random(1) + 1; // loop/sound 1, or 2
PlaySound(ran + 3);
cTv.Animate(ran, cTv.AnimationSpeed, eBlock);
cTv.Animate(0, cTv.AnimationSpeed, eRepeat, eNoBlock);


now with this code, the tv just keeps doing the animation over and over again, and does not stop (even thought i took out erepeat)
I'm not sure why any help please?? :X


FIGURED IT OUT
NEEDED THAT 0

cTv.Animate(ran, cTv.AnimationSpeed, 0, eBlock);

TY EVERYONE FOR ALL THE HELP :)
#10
Code: ags

int ran = Random(2) + 1; // loop/sound 1, 2, or 3
cTv.Animate(ran, cTv.AnimationSpeed, eRepeat, eNoBlock);
PlaySound(ran);


i did that code but with an extra line because after it plays the one clip, i want it to go back to the blank screen (tv off), so i tried

Code: ags

int ran = Random(2) + 1; // loop/sound 1, 2, or 3
cTv.Animate(ran, cTv.AnimationSpeed, eRepeat, eNoBlock);
PlaySound(ran);
cTv.Animate(0, cTv.AnimationSpeed, eRepeat, eNoBlock);


but with that code it never ran the first animation just played the sound and the screen was blank
please someone help me :(
#11
problem is i need it to play the right sound with it so if i did


cTV.Animate(Random(2) + 1, cTV.AnimationSpeed, eRepeat, eNoBlock);
playsound(Random(2) +1);              would it still do the same random number on this line.. or a new one (does the rand work off the CPU clock)
#12
I have a TV character who looks like a tv but his second (number 1) loop is a newscast and i did it in the interaction editor and it works fine and dandy, looks neat too...




but i wanted to add maybe a few more short clips on a random basis... so i figured ide try to move it to one script action, in the interaction editor

at the bottom where it says "text script equivalent code" it isnt coming up with anything for those two lines.

sound obviously just would be Playsound(4); but I am not sure how to set it up with a few scenes random or in order...

thanks alot guys...

#13
yeh ashen has helped me so much... ashen fell free to post your code here so that It can help anyone else who has a similar idea like mine :)
#14
ok ashen here is my new idea, because i think I can handle the code of it, but I just have one more question with it so I added some pictures

Ok so my new idea is that say you got a tv from a minigame and you walk into your room and select the tv ( so a script runs for the tv cursor{if mouse.Mode == eModeUseinv} where it makes the possible spots to put it be visible(outlines) and when you click in one it is placed there)
So i want the tv to be a character and depending on which outline you click inside it to move to... can you help me out with that code?




my map will have more furniture but I figured for each item you get I can just make a certain ammount of places with object.visible, but I dont want to have double that amount with the actual tv, so ide make it a character like you said. I hope you can understand me... does that make sense??

thanks man for any code or help
#15
Ok i think im getting it a bit now... thanks for that module link

so this goes into my room script

Code: ags
function on_mouse_click(MouseButton button) {
  if (button == eMouseLeft && mouse.Mode == eModeUseinv) {
    character[player.ActiveInventory.ID].ChangeRoom(player.Room, mouse.x, mouse.y);
    player.LoseInventory(player.ActiveInventory);
    ClaimEvent();
  }
}


and then below that I can put all of the functions for calling the different objects (say for example tv) or does that code automatically work if i make iTV a name of a character (since character[player.ActiveInventory.ID] will be character[iTV] ), setting the view the same sprite as my inventory one??

sorry if I am kinda slow at getting this but, I am just trying to grasp this whole concept so I dont just use your code but understand it aswell, so I can learn from it.


OH and also will I have to make the whole room walkable so that iTV can get to the location or will the changeroom command take care of that?

Can't thank you enough ashen :)
#16
I am still kind of confused ashen with this whole claimevent thing and I read the page you pointed me to, what does that whole spacebar thing mean?

And also how can I make it so that when you click on an object(character) that you placed down(tv) a GUI pops up that says "Do you want to pick this item up?, yes, no"

^^can you do that with an input box type code (visual basic, if i remember correctly)??^^

sorry im a pretty awful coder/new to this
#17
ok awesome ashen... im not sure how many as im still working on the plot and I kinda think of stuff as I go along, but ill guess ill just use characters... i never thought of that... could you help me out on the gui code though, this is my first game and I have no idea how after placing the item down it would work when i try to pick them up.


ALso how exactly would my code go, Ok so I have a tv in my inventory and I walk into my bedroom and select it, place it down, and then I make the whole room a hotspot and where ever they click the character (tv) moves and becomes visible???

thanks man already I appreciate your help and fast reply
#18
Hey I was wondering if there is a way to have a room in which when you gain inventory items you can put them anywhere.

Ill explain a lot better for you all... my game is an adventure where you solve puzzles and mini games and each time you get an object like a tv or another item from your bedroom that was stolen from you and *scattered* among the lands...


I know that I could probably have a bunch of not visible versions in the room and hotspots and depending on which one they clicked it would place it there, but I really want them to be able to put them anywhere in the room and that would require me to make tons of those.  I also wanted to make it that they can pick them up by clicking them with the finger icon, which would bring up a gui asking if you want to move it (with yes/no buttons)....

my whole plan is at the end of the game for a screenshot to be taken so everyone has pictures of their different room layouts, because I think that would be neat.

So basically can anyone tell me if this is possible please. Thanks a ton in advance for any suggestions/code/help. :)
#19
thnaks
#20
I have the basic kings quest interface in my game, but the grey bar here to get the (icon bar) to show up when you mouse over it is too tall... so I changed it from 13 to a lower number and that worked well(with showing more of my maps) but when you scroll it still reads as 13 tall (as to when to switch over to the icon bar)

So basically my question is how do I switch it from 13 rollover to show up to a lesser number??

Thanks in advance :)

SMF spam blocked by CleanTalk