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 - EnterTheStory (aka tolworthy)

#301
Thanks! And now for a completely different question...

Is it possible to find the array index number of a DeNGVaT string? I often use DeNGVaT as a way to associate strings with unique numbers. At present I have to make up a unique number and assign it to the string, then search all the strings for that number to find the string I want. It would be extremely helpful if I could just refer to the DeNGVaT string by its index number.
#302
QuoteNo. I've been doing this a lot, myself, and it's not noticeable.

Thanks. That's reassuring.

Quote
QuoteI plan to seamlessly switch between different games using runAGSGame,
I wonder why you're doing that? If it's seamless switching you need, it's generally better to simply combine both games into a single game.
Several reasons.
(1) I'm using 2.72 for (hopefully) Linux compatibility. And that means I'm restricted to 300 characters, 600 views, etc. The first game has 200 characters and 400 views, and the second game (War and Peace) will be larger.
(2) The compile is over 100MB per game (without sound), and an even bigger game would make testing too slow.
(3) The game is open ended - as time goes by more and more stories will be added to the game world.
(4) I'm still learning. I will tidy up the core code for the second game (e.g. changing the numbering of characters so the code is easier to follow).
(5) I'm aiming for an older audience, and many of the still have dial up, so this allows them to download just the stories they want and no more.
#303
How fast is DeNGVaT? Does anyone have real-world experience of using thousands of DeNGVaT global strings? I'm thinking of rewriting my code so that around a thousand DeNGVaYT strings are assigned when the game starts, and some mouse clicks instantly search several hundred DeNGVaT strings. Is this likely to affect performance? Any ideas?
#304
This is probably a very stupid question, so apologies in advance.

At the start of my game I need to create several thousand variables. I suppose I would need to run a function at assign these at startup. Would this cause a noticable pause in the first room starting up?

I plan to seamlessly switch between different games using runAGSGame, so even a tiny delay is bad. If there is a tiny delay, is there some way to have variables pre-assigned so there is no need to run through a function to add them one by one?
#305
I've been using DangVIT/dungVET/DengXiouPing/WhAtEvEr for a week now and it is AWESOME!!! Far more useful than I ever imagined. My game is based on large amounts of dialog, and I've got to the stage of coding the endless conversations and "if-then" choices. DoNgVoTe is the only way to make my code usable. I can take anything complicated, give it a meaningfully named alias, and just shove it into its own function. Without DeNeroVT my code would be utterly unreadable and unmaintainable. Thanks, SSH!
#306
Quote from: Pumaman on Mon 17/03/2008 23:49:28The only gotcha is the "else if" thing I mentioned, because this code:

if (something)
{
}
else if (something_different)
{
}
else if (another_thing)
{
}

is actually compiled like this:

Code: ags

if (something)
{
}
else 
{
  if (something_different) 
  {
  }
  else 
  {
    if (another_thing)
    {
    }
  }
}

Funny you mention that, as a beginner I always add those brackets. I don't trust myself to use strings of naked 'else's. I leave that to the experts.
#307
Quote from: KhrisMUC on Mon 17/03/2008 16:07:45
Are you sure you actually need that many ifs? I'm not sure about your programming skills, but such a high number of ifs usually suggests that the code isn't aware of a much simpler way of doing things... ;)

That would be me. :) However, in my defense, I've tried a lot of different methods, and this one seems the most appropriate for the task.

Quote from: Pumaman on Mon 17/03/2008 16:10:59
The only "if"-related restriction is that you can only have up to 75 nested if's (that is, an if inside another if -- but this also applies to "else" statements which means if you had 75 "else if"s in a row that would breach the limit). But if the "if"s are not related to each other then there's no limit to the number you can have in one function.

Thanks! Then a "tree" with 33 branches, each leading to 20 branches, each of THOSE has 20 branches, that would be perfectly safe.  Just 3 levels, not 75.

Quote from: Pumaman on Mon 17/03/2008 16:10:59
I've seen some repeatedly_execute functions with hundreds of "if" checks.

How did you get to see my code? :)
#308
Is there a limit to the number of "if" statements I can use in a function?

My previous game engine stored such things as bytes, so would allow up to 255 and no more.

Example: one of my functions has 33 top level "if" statements. Each of these leads to another 10-20 'if's, and each of those leads to more "if"s containing the actual code.  Should I split the functions up if it they grow over a certain size?
#309
Thanks! And sorry for giving such a long piece of code. I just narrowed it down to just a couple of lines, then came to upload the new code and you've already fixed it! Thanks again!
#310
DeNGVaT is fantastic! A real godsend. Thanks!

But I think I may have found a bug. I've tested this code on two different games (it goes in the keypress section) and it does the same weird stuff on both.

It's much simpler than it looks. I just save the string "rrrr1" or "cccc1" in a global called "woman and child_r1" or "woman and child_c1." Then reload and resave a few times. The second part (Ctrl-U) is identical to the first part (Ctrl-T) except that 'c' and 'r' have been swapped round.

Code: ags

	if (keycode==20) {														// Ctrl-T, test, temporary			
									
		Display("saving message called 'woman and child_c1' containing 'cccc1'");
		Global.Sets("woman and child_c1", "cccc1"); 
		
		String t = Global.Gets("woman and child_c1"); 
		Display("contents of 'woman and child_c1' is now '%s'", t);
		
		t = Global.Gets("woman and child_c1"); 
		Display("contents (again) of 'woman and child_c1' is now '%s'", t);
		
		Display("saving message called 'woman and child_r1' containing 'rrrr1'");
		Global.Sets("woman and child_r1", "rrrr1"); 
		
		t = Global.Gets("woman and child_r1"); 
		Display("contents of 'woman and child_r1' is now '%s'", t);
		
		t = Global.Gets("woman and child_c1"); 
		Display("contents of 'woman and child_c1' is now '%s'", t);		
		
		t = Global.Gets("woman and child_r1"); 
		Display("contents (once more) of 'woman and child_r1' is now '%s'", t);
		
									}									
	if (keycode==21) {														// Ctrl-U, another test, temporary			
									
		Display("saving message called 'woman and child_r1' containing 'rrrr1'");
		Global.Sets("woman and child_r1", "rrrr1"); 
		
		String t = Global.Gets("woman and child_r1"); 
		Display("contents of 'woman and child_r1' is now '%s'", t);
		
		t = Global.Gets("woman and child_r1"); 
		Display("contents (again) of 'woman and child_r1' is now '%s'", t);
		
		Display("saving message called 'woman and child_c1' containing 'cccc1'");
		Global.Sets("woman and child_c1", "cccc1"); 
		
		t = Global.Gets("woman and child_c1"); 
		Display("contents of 'woman and child_c1' is now '%s'", t);
		
		t = Global.Gets("woman and child_r1"); 
		Display("contents of 'woman and child_r1' is now '%s'", t);		// ********** now returns (null) ************
		
		t = Global.Gets("woman and child_c1"); 
		Display("contents (once more) of 'woman and child_c1' is now '%s'", t);
		
									}									


Ctrl-U returns a null bug if it is run first.

Ctrl-T works perfectly every time.

Ctrl-U works perfectly if Ctrl-T is run first.

Any idea what is happening here? I am guessing that this has something to do with the length of the strings? And DeNGVaT is scared of the letter 'r' for some reason? SSH did you have an old girlfriend who's name started with 'r' by any chance? :)
#311
Quote from: SSH on Sat 08/03/2008 09:59:29
Remember you need to put quotes around the names...

Ah...

now where is the icon for "extremely embarassed" or "hits head against brick wall"?

Fantastic module, BTW
#312
Forgive the extremely stupid noob question, but...

how do I declare a new DeNGVaT-controlled string (or int) in the first place?

I can see the functions for getting and setting existing strings, but nothing for creating the string. I tried just setting a string in the hopes that it might be created automatically, but that wouldn't compile. Sorry for being so dense!
#313
Thanks!

Embarassingly I just found an old thread on the same topic, probably the exact second that you posted.  http://www.adventuregamestudio.co.uk/yabb/index.php?topic=31866.0

I think I need more experience at using the search box. I searched for "blocking" and read about thirty different threads before giving up, searching for "emodewait" and finding that one.
#314
What's the best way to tell if blocking is on?

I write a line in "repeatedly execute always" that checks the mouse mode for "wait." But when blocking starts the mouseMode is no longer updated. So the mose is reported as being the last mode BEFORE waiting.

Any suggestions?
#315
Thanks. That's good to know.

Meanwhile I intend to experiment with 'character.frame' property. It looks like I can create a general purpose 'run always' function that will only be called when a certain flag is up, and then allow me to trigger any event based on any frame in any animation. That was what I was hoping for, so if I get it working I'll mark this thread as solved. Unless anyone has an even simpler solution.

Thanks again for the feedback.

Edit:

I tried it and it works! Thanks for the suggestions.
#316
Quote from: Ghost on Sat 02/02/2008 22:35:03
You can also, in a room's repeatedly_execute, check if an animation has reached a certain frame, and then call code from there. Would be a bit of a resource hog attempt, but works.

I didn't know you could do that. This sounds interesting, I'll try to find the name of the function. Thanks.

Quote from: Radiant on Sat 02/02/2008 23:21:02
simply start both animations at the same time, always, that way errors will remain constant rather than variable.

My concern is that a character might fire his gun every 20 seconds, so any errors will accumulate. Of course, I may be completely misunderstanding how AGS works here. If two processes run at the same time, and one of them needs a huge amount of code in a single frame, I am assuming this it would slip behind the other process?
#317
Quote from: Radiant on Sat 02/02/2008 12:10:53
create a separate animation for the smoke, that starts with several blank frames (that can be 1x1 pixel in size).

Start this animation at the exact same time as the gun firing loop is triggered.

Thanks. That was option 2 or my 3 options. I will probably have to do that. But it will be very time consuming. Each gunsmoke animation is 50 frames, the timing is totally different from the character animations (the smoke moves smoothly, the people often pause). And whenever I tweak a character animation I'll need to recalculate the timing of the smoke. Finally, if there is the slightest difference in timing this will be amplified in every loop. It will be a time consuming fudge, but maybe this is the best I can hope for.
#318
I have a number of characters who fire guns.
At the frame where the gun fires I trigger a sound (e.g. "bang!") but also need to trigger an animation (a puff of smoke)? These are old fashioned guns so the smoke is important.

What I've tried so far:
1. Just incorporating the smoke into each animation. Bad idea. The gunsmoke animation has many large frames (so the smoke spreads out smoothly) so it greatly increases the file size of each sprite. 

2. Creating a new gunsmoke view for each character (using the same images, so there is no impact on file size).  Character views typically have 10 frames (with variable speeds) and the gunsmoke loop has about 50 frames. Both need to be sybnchronized over many repeated loops, and I need to often change their speed. Extremely time consuming.

3. Have a "run always" function to always check if a gun was on screen, and make some calculations for when the smoke is likely to be needed. Again this is time consuming and clumsy, as there may be several guns on screen at once. I can't see how this would work without endless tweaking.

Any other ideas?
#319
Thanks for the answers. I use white fading betweemn my scenes, and it works fine, but the first scene always starts with black. I'll have to experiment with that one some more. As for saving global ints between games, AGS is amazing! This opens up a whole new world of possibilities. :)
#320
I plan to load a game from within a game, then close the original game. Are there any known issues with doing this on different systems? E.g on a slower computer, on Linux?

If game 1 to end with a white screen, then game 2 starts with a white screen, is there a danger of a black screen (or, worse, seeing the desktop) in between?

Also, I am guessing that the following would be possible, but would appreciate any comments: Could game 1 could write a text file saying "start in room x" and then game 2 would read that file and start in room x?
SMF spam blocked by CleanTalk