Showing posts with label Code. Show all posts
Showing posts with label Code. Show all posts

Sunday, May 13, 2012

Coding with no sleep



So do to a personal thingy I ended up going to work last night and coding with 3 hours sleep in about 35 hours.  I learned a pretty important lesson do to this... I can't code when dead tired.   I spent over an hour debugging this line of code.

miniSpot = cardStage.lenght - 1;

You know I think the worse part besides that it is 2 bugs is that flash didn't even throw an error when I found the spelling error on length and kept returning a 0... any ways

miniSpot = cardHolder.length - 1;

Makes so much more sense why the hell would i want stage properties... or make that mistake in the first place.  So I gave up...  got off work and walked home going to watch one episode of index II and my desktop had failed in a windows update, had no system restore points available.  After crying for a few minutes I went to bed.

Daisy

P.S. Reformatted that box!  Must have good box for D3... only 2 days to go.

Friday, July 29, 2011

Huh?


So continuing to work on effects. Got virgin to remove when sex is had and been working on sick. The main problem though is that every time I change something I have been forced to make deeper changes.

example:
checkClassPoints(0, 1, girl);
checkForEffect(22, girl)

to:

GameArray[girl].checkClassPoints("health")
GameArray[girl].checkForEffect("sick")

A lot easier to read and add conditionals later on from parsed data... but when your removing over 100 instances to the new format it takes a while. Hopefully will have sick working tonight and get to play with other stuff.

Daisy

Thursday, June 16, 2011

Pounding my head against a target.


Okay so trying to use the extends class stuff. So it work perfect for assistants and girls. Unfortunatly not for player. Basically if everything works fine you get...

girl.HP
assistant.HP

What you get for player though is

player.Combatant.HP

Because it was basically a static class... Which defeats the entire purpose. So after playing with it for a nice few hours I got a plan. I re-named the Player class to cPlayer and made the variable Player an instance of cPlayer. This created a few bugs most of them I fixed by every class that bugged out I added a new variable of Player and then assigned them at the start of the game... There has got to be a better way.

var Player:cPlayer = new cPlayer();
Girl.Player = Player;
GoodsScreen.Player = Player;
AuctionScreen.Player = Player;
StringExpander.Player = Player;
Bidding.Player = Player;
GameTables.Player = Player;
PictureList.Player = Player;

But hey it seems to be working. I'm sure I created bugs somewhere that I haven't found yet though. But now I can get...

Player.HP

From an extension class.

Sorry about the code stuff and I am sure someone is going to write in that this was a stupid idea but... oh well.

Daisy

Tuesday, June 14, 2011

Rance 2...




Thanks to everyone who posted ideas for the code. I think though AcidSerra has the code that I was looking for and knew was out there but for some reason I just couldn't wrap my mind about it. Thanks.

Compuscribe has suggested changing them all to extension classes which is a bit out of my comfort zone but actually makes a lot of sense. It does go against my KISS strategy. In which you really only need functions, if, while, input and output. But slowly people are converting me to complex code.

--------------

Now onto Rance 2, I was only able to make it to chapter 5 in one night. I want to give my thanks to the Rance Translation Team. A good solid translation, very smooth, and people sound correct. No bugs found.

The game play is pretty standard stuff the almost board game style navigation was surprising but is easy to understand. Combat is not especially tricky but the stamina systems stops it from being a one button pressing show. My main irritation is that the healing items become really irritating after a while as they only heal a tiny part and you have to go through 3 menus to use one, over and over. The H scenes are about what you expect from Rance, there, but not especially long or complicated. Not particularly usable as "Instructional Material".

Plot wise, I'm a bit pissed that Sil is cheating on Rance. He needs to train his slaves better. Other then that its not bad but its not great, and very linear that you have to find the obscure item a before you need to find obscure object 2. Rather old school gaming there.

Daisy

Monday, June 13, 2011

Player Equipment



So I spent the last night trying to find a really good way to do stat changes and make them universal from girls to assistants to player. This will make combat a huge less of a pain in the ass. Its just I'm not really happy with the code it seems to have to much redundancy. What would have been fine a year ago feels instead way to bloated. So if anyone has a better way I'm going to post the code...

http://pastebin.com/cfqKTuZp

Though using paste bin since it keeps formatting and doesn't create ugly code. Thanks in advance.

--------------

To the anonymous who posted the 4 megaupload files thank you. It saves me from trying to download 36 hotfile files... Still don't have it working but hopefully tonight some time.

Daisy

Saturday, June 4, 2011

Yesterday's News, Today!



Okay what I wanted to show yesterday, but had a few technical issues. And not sure if I explained the issue well.

So I have an array of player items.

[apple object][apple object][beer object][beer object]etc

my [apple object] has

public class Item {
public var name:String; //name of the item a string
public var producer = []; // who created the item
public var number:int; //how many of them
public var IDNumber:int; //okay so this is a specific number for this item not used for much except
//for producer
public var IDArray; // a link to the array that this item is in.... used for producer again
}

[apple object].name == apple
[apple object].producer == [apple tree, apple tree, apple tree, apple tree]
[apple object].number == 4 //I have 4 apples stacked
[apple object].IDNumber == 26
[apple object].IDArray = Player.itemArray

We send my [apple object] over to the image builder and it makes an apple but got one problem. I can't add an array as a tag to an image. Not sure why but it did not like it. (this would still be an object as far as flash is concerned but) i'm going to call it [apple image] what I can do though is add the rest of the properties to my [apple image]

So then when I mouse over my [apple image] I get most of the information except I don't have the producer array. But because I sent in a unique IDNumber and what array the item is in IDArray as a pointer... I can just go look.

The actual code which does have a bug I will fix tonight. (The girls crash it because they can have nulls in there array, easy fix took me a while to figure out.)

for (i2 = 0; i2 < e.target.IDArray.length; i2++) {
if(e.target.IDNumber == e.target.IDArray[i2].IDNumber) {
stringy = stringy + "Producer: ";
for (var i3 = 0; i3 < e.target.IDArray[i2].producer.length; i3++) {
stringy = stringy + " " + e.target.IDArray[i2].producer[i3] + ",";
}
}
}

I'm sure there is a better way to do it, but if your making suggestions please use small words and examples.

Daisy

Tuesday, February 22, 2011

Another Day


A night of trying to build a better mouse trap... As Zero_profile created the amazing idea of a backgrounds for the town that move with buildings in the fore ground. Then me and docclox created about a half dozen different versions. And it looks way to interesting to throw away so expect the towns to be a bit more exiting then a long list of buttons... someday.

Not much else to say, if you want to see an example of the panning backgrounds come join us in chat.

Daisy

Saturday, January 1, 2011

Furniture 2, New Year




Got Drag and Drop up for moving from player items to furniture array. Drag and drop is just so dull... for those of you wondering why its basically just positioning x y coordinates and then finessing them. Time consuming and then there was a number odd bugs that popped up the one I still don't get is the cleaner array not working.

My normal code for cleaning array (just change the name of the array):

//cleans the furnitureImageArray
function roomFurnitureClean(){
for (var i:Number = 0; i < furnitureImageArray.length; i++) {
if (furnitureImageArray.length != 0) {
removeChild(furnitureImageArray[i]);
furnitureImageArray.splice(0,1);
i = -1;
}
}
}

now the furniture array is actually made up of possible nulls and objects.

Example [object furnitureHousePlant],,,,[object furnitureBed],,,,[object furniturepiano]

So I modified to:

//cleans the furnitureImageArray
function roomFurnitureClean(){
for (var i:Number = 0; i < furnitureImageArray.length; i++) {
if (furnitureImageArray.length != 0) {
if (furnitureImageArray[i] != null {
removeChild(furnitureImageArray[i]);
}
furnitureImageArray.splice(0,1);
i = -1;
}
}
}

Which should have fixed it but for some reason it would never delete the last object and instead of crash and I still don't know why. But if you don't know why just use a different method my fix.

//cleans the furnitureImageArray
function roomFurnitureClean(){
var total:int = new int(0);
for (var i:Number = 0; i < furnitureImageArray.length; i++) {
if (furnitureImageArray.length != 0) {
if (furnitureArray[total] != -1) {
removeChild(furnitureImageArray[i]);
}
furnitureImageArray.splice(0,1);
i = -1;
total++;
}
}
}

That's right I'm totaling the spot from the array that actually holds what each furniture is. But I have no idea why that was necessary... oh well it works.

Add that to another bug that was just pure stupidity on my part but took forever to find and that was how I spent my new years eve.

Happy New Year.

Daisy

Monday, December 27, 2010

Instances Done



So about 5000 lines of code deleted. 200 less object instances created at start up and adding new jobs and icons is quite a bit easier. More of the what was I thinking being fixed and I saw a few places that I can probably remove even more code.

If otherworld has issues loading for you try this build its a new easy loader. If you don't have problems I don't recommend it quite yet as there are a few bugs, oh and don't touch meditate it is rather odd.

Getting some really odd feedback about the saving bugs. Please keep them coming, some of them are just odd. I'm starting to think that pointers after saving keep on pointing... *sigh*.

Bonus points to anyone who can ID the manga from the last two days.

Daisy

Friday, December 17, 2010

Back to the exp screen



First off I want to thank everyone who sent in code examples and changes. I'm still pouring over them and am not in any hurry to change the most called array in the game any time soon. Going to want to run a number of tests and samples before I get even close to that, and its not just that much of a priority at the moment. It works for right now let the dog sleep.

Back to the exp screen looks a bit different now and is still unbalanced and will probably need to be changed. I am playing with building large parts of this screen as objects in an array that are created when the screen is opened and destroyed as screen closes. This is how every thing should have been done, but up until doing the exploration and combat sprites I didn't have that good of a handle on it. Expect re-building of the rest of the screens slowly to this pattern. It should lower the load time at start. If you check the to do list my highest priority for the update after this is re-doing all of the jobs to this pattern. Why? Because right now all the jobs are created at start... 200+ instances of objects. Its got to die and will make new jobs much easier to add.

Got called in to work early, be safe.

Daisy

Thursday, December 16, 2010

Can of Worms



Okay so the next post is almost entirely code. If your not interested browse on and come back tomorrow.

Opened up a can of worms and going to go into it a bit. First off this entire code program is at:

Object Test You will need Flash to compile.

Or you can just follow along on the image below.

So This is how it SHOULD work but doesn't:

First off lets make the array and object:

//A simple global array because I'm lazy
var simpleArray:Array = new Array();

//A simple global object class because I'm Lazy
var TempObject:Object = {
hello:0,
world:100
}


function standard() {
var result;
//a variable since i don't care what its
//called when placed in the array



//Now it should work as
//result = new TempObject();
//this dosen't compile in action script though for
//any other object it would work
//fine... So instead this is the best version we
//can do and all the pointers now
//point to the same spot.

//Your loop to make 3 copies
for (var i:Number = 0; i < 3; i++) {
result = TempObject;
simpleArray.push(result);
}
traceArray(simpleArray);
//show it before changing one variable in the object
simpleArray[0].hello = 1;
traceArray(simpleArray);
//after changing the one object OMG it changed all
//the same variables GOD NO!
//pointers issue
}

//See pic



//My work around is the ghosts.

//an array exactly the same as the last with a different name
var ghostArray:Array = new Array();

//make 3 ghost objects Note I changed the number of world so you can see which one //is which

var GhostObject1:Object = {
hello:0,
world:200
}
var GhostObject2:Object = {
hello:0,
world:201
}
var GhostObject3:Object = {
hello:0,
world:202
}

function ghost() {
//Just push the 3 into our global array
ghostArray.push(GhostObject1);
ghostArray.push(GhostObject2);
ghostArray.push(GhostObject3);
//trace it
traceArray(ghostArray);
ghostArray[0].hello = 1;
//change 1 spot and trace again
traceArray(ghostArray);
}

//see pic

And what do you know it changed. Your going to want to check out references other then my say so.

http://www.actionscript.org/forums/archive/index.php3/t-143689.html


http://www.actionscript.org/forums/showthread.php3?t=68660

If you guys have a better solution I am more then willing to hear it, as I admit I am a cheap programmer using the KISS system.

Daisy

Tuesday, May 4, 2010

Try stealing my slave will you! Well I have Mugi!




More fun with Mugi Intercepting Events... That pesky noble who keeps stealing your slave and costing you money. He hasn't met Mugi's guards yet :)

The code for next lessons update with assistants.

function DoWalkTownCenterAsAssistant(NumEvent:Number, present:Boolean) : Boolean {
if (!present) return false;//If mugi isn't there no event
if (NumEvent == 3) {//Event Number 3 Passing Noble
MugiAngryMini._visible = true;//small pic
MugiAngrySoldSlaveMaleSM._visible = true;//big pic
_root.AddText("Mugi Pissed retrieved slave");
return true;
}
return false;//Wasn't event number #3 nothing happened
}

How many is too many



I have an addiction to bunny girls. Mio unfortunatly has fed this addiction.





function HideBunnyGirl() {
PlanningBunnySuitSleazyBarMugi2._visible = false;
PlanningBunnySuitSleazyBarMugi._visible = false;
PlanningBunnyGirlLazySleazyBar._visible = false;
PlanningBunnySuitLingereSleazyBar._visible = false;
PlanningBunnySuitSleazyBarEmbarresed._visible = false;
PlanningBunnySuitSleazyBarBlueLeotard._visible = false;
PlanningBunnySuitSleazyBarBlueLeotard2._visible = false;
PlanningBunnySuitStreetGigSinging._visible = false;
PlanningBunnySuitStreetGigLazy2._visible = false;
PlanningBunnySuitStreetGigBlackLeotard._visible = false;
PlanningBunnySuitStreetGigLazy._visible = false;
PlanningBunnySuitSleazyBarRedLeotard._visible = false;
PlanningBunnySuitSleazyBarRedLeotard2._visible = false;
PlanningBunnySuitSleazyBarRedLeotard3._visible = false;
PlanningBunnySuitSleazyBarRedLeotard4._visible = false;
}

Is that enough?

Thursday, April 29, 2010

and Mugi v.2 had an infinite loop....

She is designed to check 10 times and give up but instead the code was

fixed version

if (tempTotal == 10) {//will try to check for 10 items then give up no infinite looping or lagging the user.
tempTotal = 0;
_root.ServantSpeak("Have a great day!", true);
return;
}
else {
temp = int(Math.random()*52) + 1;
tempTotal = tempTotal + 1;
}

original version

if (tempTotal == 10) {//will try to check for 10 items then give up no infinite looping or lagging the user.
tempTotal = 0;
_root.ServantSpeak("Have a great day!", true);
return;
}
else {
temp = int(Math.random()*52) + 1;
tempTotal == tempTotal + 1;
}

Stupid check in line rather then assign.

I apologize for everyones trouble, but as always I want to emphasize that Mugi is a ton of coding that is untested. She is only a v.2 after all.

Will put an updated mugi .21 here

http://rapidshare.com/files/381741596/Mugi_v.21.rar

Wednesday, April 28, 2010

Playing with Mugi



Working on Mugi today.

I want to make Mugi and Mio work together, her happiness with your training of Mio should affect the development of Mio and trigger special events. But there's a big issue with that how do you let the user know how happy Mugi is, constantly doing warnings for the entire game would be boring and then I came up on an odd idea. Why not use the assistant box description to display stats.

function StartMorningAsAssistant(intro:Boolean) : Boolean
{
_root.AssistantDescription = "A rich girl. She likes part time jobs and to watch girls together.\r\rHappiness: " + _root.AssistantData.CustomFlag + "%\r(Mugi's happiness affects the speed at which a slave is trained.)";

...
return true;
}

See above Image

This is more of a mock up then a final version. It works but nothing actually changes the variable for now, but it does show proof of concept.

Also changes to Mugi heading towards V3

//Changed how eclipse dates for orihime are checked. -- Untested
//Papus draft antidote warnings - untested
//Guided Pony Girl - untested
//Guided Dick Girl - untested
//Guided Dick Girl Pony Girl - untested
//Guided Dick Girl Courtesian- untested
//Guided Cow Girl - Untested