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

#81
Ok now that i've removed the return keywork and moved the import keyword from my script header to my room script it works great. But why didn't it before, i thought that you should put the import keyword on the script header if you want all your scripts to have access to it, it says so in the manual. I need this variable in all my rooms, does this mean i have to import int hour in every room i've got?

(By the way i've moved my game to AGS 3.0, it's great, the only problem i noticed is that sometimes it doesn't cut/paste a part of your script if you use right click and that i couldn't paste a code i had stored in a text folder like i used to do, anyway)
#82
The thing is that if i don't return the value for hour it doesn't get the change in my roomscript. Altough in my GUI's (which are handled by the global script) it displays that hour = 9, in my room script it used to display hour = 0. That was until it occured to me to use the return keyword ( although i admitt i haven't figured out what's the whole deal with this yet, i mean how are we supposed to use return??). If i don't use return how else do i say to my room script that by the time that the game starts the hour is 9?
#83
I have already completed my first 3 rooms and i have the player character for now, my cursor sprites, my button sprites and a Lot of code for my new RPG. The thing is that my little newborn is already about 240Mb Compiled while the whole game folder is about 1,1GB!! I admitt i have added a lot of features i wanted to see in games but i'm only at the beginning yet. Is this even possible? Are these games supposed to be that big?
#84
Never mind i finally know what it was. As soon as i removed the last two variables: hour, day from my script it worked again, but i don't understand what i did wrong. This is my script if anyone could bother to look into it i'd appreciate it guys. Keep in mind that these two variables hour and day worked smoothly but then the game_start didn't, i don't get it i just went by the book, so here it goes:

Script Header:

int Stealing;
int Lockpicking;
int Speechcraft;
int Intimidation;

import int hour;
import int day;

bool chase;
int Bounty;

int Gold;

struct Things{
int Price;
String Item_description;
int Item_damage;
int Item_defense;
};

struct NPC{
bool dead;
int awareness;
int money;
int enemy_attack;
int enemy_defense;
int enemy_health;
int enemy_weapon;
int enemy_shield;
int enemy_damage;
};

import function lockpicking (int door_defense);

import function stealing (int awareness, int money);

import function hitting (int Item_damage, int enemy_shield, int enemy_defense, int enemy_health);

import function enemy_hitting (int enemy_attack, int enemy_damege, int enemy_weapon);

int foe;

// main global script file
int hour;
int day;

function lockpicking (int door_defense) {
 (my function)
}

NPC person[10];
Things item[10];

function stealing (int awareness, int money) {
  (my function again)
}

function hitting (int Item_damage, int enemy_shield, int enemy_defense, int enemy_health) {
  (another function working fine)
}
function enemy_hitting (int enemy_attack, int enemy_damege, int enemy_weapon) {
  (same here)
}

export hour, day;
#sectionstart game_start  // DO NOT EDIT OR REMOVE THIS LINE
function game_start() {
player.z -= 15;

hour = 9;
SetTimer (1, 2400);
return hour;

mouse.Mode = eModeInteract;

Health = Constitution*4;
Mana = Intelligence*4;
Defense = Nimbleness + 10;

mouse.DisableMode(eModeWalkto);
mouse.DisableMode(eModeLookat);
mouse.DisableMode(eModeTalkto);
mouse.DisableMode(eModeUseinv);

Gold = 40;

(and this is where my structs begin but they too long a list to display here)

  // called when the game starts, before the first room is loaded
}
#sectionend game_start  // DO NOT EDIT OR REMOVE THIS LINE
#85
It didn't display anything before, i just used it as a debugging tool. But it used to define variables. These variables are now changed from everywhere else in my script but not by the game_start function, and the thing is that it used to. Now these variables start with 0 as there is nothing else defined in the script header. I should say that i have declared these variablse in the script header as i wanted all my scripts to use them, and they did, until now that is
#86
Can someone help me out. It looks like my game_start function suddentlly stoped to work, it has been working for the past few months and i haven't changed anythying in that section. Other games can use this function so it can't be a programme malfunction. Do you know what could have caused this. It seems that every line i put in this function is ignored even the simpliest once like Display ("there is no problem"); All i did i think was add a couple of variable declarations above this function, in the place where i had my own functions and an export statement in the end of this. All the other built in functions seem to work, now, has anyone else had this problem? What could i do? Is there an easy way to tranfer most of my game into a new game file without taking the problem with me? Could it be that my ags (editor settings) file has somehow bben corrupted?
#87
It's like the soldiers and activists example but they don't only react to certain clicks, they have a general behaviour f.e.: they take certain actions triggered by some events or by variables that are repeatedly checked, so it would be a real pain in the *** to have to go through such a tight script again. I guess i'll figure of some other smart way to do that
#88
Is it possible to duplicate one of my characters so that the things that he is commanded to do are done by all of them at the same time. I mean i have a character that i have programmed him to complete certain actions but now i want more of his kind, simply by creating anew character with the same view won't do it cause i would have to duplicate his "behaviour" each time. So the question is this, can i have multiple "same" characters in one room? I mean the same character, many times.
#89
My name is Dimitri, i'm 20, i'm from Greece and i currently study Architecture in a small city called Volos. I first occured me that i could me make an adventure game after i took a lesson where i had to built a visul environment, i also knew a little about 3d modeling so i said why not. So, i googled it, tried countless engines and i finally came to understand this one.

I tried a funny adventure which i have not yet uploaded in here, but i made it available in my university's server and got good reviews but i have just now started to get my hands around the code as i'm working on my new RPG game (long time RPG player).

Well... good to be onboard
#90
I'm sorry to have bothered you for this but i am a newb and this is my first game, it took me endless hours to find the mistake, but it turns out that one of the reasons was that i hadn't checked on the "handle inv clicks in script" option in the General Settings, it all works fine now, as i said i'm new to this. Anyway thanks for the input.
#91
I don't mean to tire you with these but it really looks hard to me. I defined a new cursor mode but i still don't seem to be able to get an "Active Inventory" with an inventory click. I run through the post you suggested but i seem to get the same problem as that guy. My code is:

#sectionstart on_mouse_click  // DO NOT EDIT OR REMOVE THIS LINE
function on_mouse_click(MouseButton button) {
  // called when a mouse button is clicked. button is either LEFT or RIGHT
  if (IsGamePaused() == 1) {
    // Game is paused, so do nothing (ie. don't allow mouse click)
  }
  else if (button == eMouseLeft) {
    ProcessClick(mouse.x, mouse.y, mouse.Mode );
  }
  else {   // right-click, so cycle cursor
    mouse.SelectNextMode();
  }

if ((button == eMouseLeftInv) && (Mouse.Mode == eModeTrade)) {
player.ActiveInventory=InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
character[EGO].AddInventory(player.ActiveInventory);
Mouse.Mode=eModeUseinv;
gStock.Visible = false;
Display ("You got new equipment");
}
}
============================================================

But the conditions never seem to come true (the cursor mode is on trademode by the way)
#92
Hi everyone. This is actually my first post here. I have been working on my first game which is a RPG using 3d models. So far i have completed the character creation, the stat board, the skill tests and i'm currently working on buying and selling but i've run into problems, can anyone help?

I created a second inventory GUI for the MERCHANT who i intend to change his wiew and his trades in each room so that it look like he is a different person. I have assigned BUY and SELL buttons and i want, when you click buy having a Merchant's inventiry item selected to give the player that inventory item, but as soon as he picks it i get a message that the item doesn't exist in the player's inventory (thus i cannot hold it). I haven't so far found a way to assign script on an inventory box click. With selling i have made it so that if you click it the Player's inventory box appears in the place of the Merchan't but haven't gone any further than that. any ideas? I have seen some suggestions as to ssign buttons that give the player an inventory item, but that way i wouldn't be able to just have one GUI and only give the Merchant different goods in each room, i would have to design many GUI's and other than that i get that there must be an easier way. Any thoughts?

(After that i'm going to work on the battle system, any thoughts on how to define the rounds, you know... how to have rounds changing)
#93
I don't know who you are man but you are a scripting magician, thank you for getting in the trouble to go through my code. I hadn't completed all the parts,  but i believe i would have if i could get over this bump. I got lost with the "return" keyword, i still haven't figured out exactly how to work with this.

Well it works, smoothly thanks. About randomness, so... i'm not using advanced random? Could i just erase the module (i thought RandomBoundries was an Advanced Random asset), also where did you find the Random function in the first place, i'm pretty sure it's not in the manual as i have gone throught it many times, are you all reading some other tutorial or something?
Anyway thanks
#94
I changed it to this and for some unknown reason it has solved my random numbers problem  but i still don't seem to be able to get the "You go to another room" message as soon as you interact with the open door, it doesn't recognize it as open. I changed it to:

// main global script file 
function lockpicking (short door_defense){
  lockpick_test = Nimbleness + Lockpicking + Random(10);
  if (lockpick_test >= door_defense){
open = true;
Display("You rolled a %d you picked the lock", lockpick_test);
return open;
}
else Display ("You rolled a %d you couldn't pick the lock", lockpick_test);
}

============================================================

(i also changed locked to open everywhere i should so that i don't have to declare "locked =  true " to start with)
#95
O.K. So, i've been building my first RPG and i have been using stats just like DnD but i find difficulties when i try to roll the tests. At this point i try to have my PC lockpick a door, so he uses his lockpicks and rolls: lockpick_test = Nimbleness + Lockpicking + Random(10)
(I'm using the Advanced Randoms Module).

He has Nimbleness:5, Lockpicking:2 and he rolls a d10, the difficulty to beat is 10, but each time he attempts the result is always between 7,8,9.

Now can anyone tell me what is wrong with my code? I've been working on this for a while now and gone through the entire manual. Here it is:

Script Header:

int Nimbleness = 5;
int Lockpicking;
short lockpick_test;
bool locked;
import function lockpicking (short door_defense);

Global Script:

// main global script file 
function lockpicking (short door_defense){
  lockpick_test = Nimbleness + Lockpicking + Random(10);
  if (lockpick_test >= door_defense){
locked = false;
return locked;
Display("You rolled a %d you picked the lock", lockpick_test);
}
else Display ("You rolled a %d you couldn't pick the lock", lockpick_test);
}

Room Script:

// room script file
int dest;
int dest1;                (these are irrelevant, it's just so that you can see the whole script)

#sectionstart hotspot1_a  // DO NOT EDIT OR REMOVE THIS LINE
function hotspot1_a() {
  // script for Hotspot 1 (Hotspot 1): Interact hotspot
if (locked == false){
Display ("You go to another room");
}
else
Display ("The door is locked");
}
#sectionend hotspot1_a  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart hotspot2_a  // DO NOT EDIT OR REMOVE THIS LINE
function hotspot2_a() {
  // script for Hotspot 2 (Hotspot 2): Use inventory on hotspot 
RandomBoundries (1, 10);
lockpicking (10); 
}
#sectionend hotspot2_a  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart room_c  // DO NOT EDIT OR REMOVE THIS LINE
function room_c() {
  // script for Room: First time player enters room 
}
#sectionend room_c  // DO NOT EDIT OR REMOVE THIS LINE
#96
Thanks man... really you are great, it worked perfectly, thanks
#97
I have looked everywhere for this. I'm trying to display values on GUI labels but i get errors. I'm currently using the manual but i've come to understant that it is obsolete at some points. My code is this
==============================================================
String Stre;
String Cons;
String Nimb;
String Inte;
String Char;

 
String.Format (Stre, "%d", Strength);
String.Format (Cons, "%d", Constitution);
String.Format (Nimb, "%d", Nimbleness);
String.Format (Inte, "%d", Intelligence);
String.Format (Char, "%d", Charisma);

lblNumber1.GetText (Stre);
Display("%s", Stre);
//Label.SetText (4, 2, Cons);
//Label.SetText (4, 3, Nimb);
//Label.SetText (4, 4, Inte);
//Label.SetText (4, 5, Char);

===========================================================

It returns the message: Error (line26): Undefined token "lblNumber1"

-What is wrong with my code, could i make it simplier, it doesn't seem to find my label's script name and i can't find it either

-Also is there a manual that includes all the new  changes, sometimes i find the right code in here instead of the manual, do i  have an older versio?


#98
I am working on a new RPG and although i have adressed several challenging script issues i don't seem to be able to make an NPC walk left, then right, then left and so on, repeatedly until someone speaks to.

When i give him the command to walk left and then right he only walks right and when i put this command in repeatedly execute it jams, i could solve the problem by adding eBlock (wait for move to finish: true) but then i would block my script thus not allow my player character to do anything.

I want to have my NPCs walk left and right in the background so that the setting seems alive.

Can anyone give me any scripting hints? It's a simple question i guess but it looks really overwelming to me, thanks
SMF spam blocked by CleanTalk