View Full Version : Total Noob - Here we go!
scissorheart
24-03-08, 02:29 PM
Hi
Just a quick note to say that I have decided to throw myself in at the deep end and learn how to program a Dizzy game from scratch. I did a little bit of SQL and Access in an old job so I kind of understand the theory behind programming. The first of the three books looks a bit daunting though! Arrghhh
Oh well - guess i'll never get anywhere without trying huh!
Rob East
:v2_dizzy_walkman:
good luck rob! try to understand the basics first - the difference between Static (Brush) and Dynamic (Object) Tiles, how objects in the map are manipulated in the code, etc etc.
unpak a small game like 'mushroom pie' using the 'pak' tool that comes with the dev tools, and look at the coding and map to try to understand better how the game is coded. use the books for reference when you're not sure what something does, or you can ask in here and someone will usually be able to help.
scissorheart
24-03-08, 03:24 PM
Thanks
I certainly will. I am goint to read through all of the books and make a few little demo games in order to get my head around the process before I start mapping out a full game. I'll take my time and absorb lots of ideas from the original games and the new ones that have been created here and hopefully, I'll have a new game to pass on to you all!
Rob
xelanoimis
25-03-08, 01:42 PM
Welcome to the community!
Yes, it's best to start with the books, but don't expect to understand everything before you start a small game of your own. For example, in a simple game, you don't need everything that is written in the GS9 Programming Book. You just need to know the basics, for example, how to call a function like the one provided by the engine to show a simple text message.
Work on the examples from the DizzyAGE manual because they show you how to implement the most common situations, found in a classic Dizzy game. Then try to put them together in a little game of your own.
And, if you need help, don't hesitate to ask.
Good luck!
Alex
Couple of things i haven't found the answer to.. (probably very simple)
But how do i name objects? (like bread) and i how do i go about getting things like bats to move? i've spend all day getting to grips with the map first attempt i forgot to make sure platforms were blocks (to stand walk on) than just background lol but i think i've got those controls sorted now.
at the moment I'm just trying to get the baddies to move.
oh i have a story and a map drawn put and puzzles in on paper, IF I'm able to master the basics with dizzyage id be a happy Chappy. once i've got theses baddies to move and can name the items i can start trying to code theses puzzles.. LOL I'm not giving up.. in fact i've giving up 4 times today but I'm still battling on... Really want to do this.
Cheers!
(by the way I'm alittle dumb and having no clue about any of this but i keep telling myself gotta start somewere..hey i have a brain like to think its not useless) :v2_dizzy_walkman:
Mishmash02
23-04-08, 12:57 AM
You seem to be a lot further into doing things than I am.
So don't worry and don't give up, I'm still getting used to the map, I've no idea how to actually run a game yet but I haven't read that part of the book yet so that would be why =p
I too have my ideas on paper, and mentioned a few of them to TF (although some of them I doubt I'll be doing just because they're a bit crazy lol)
Looks as though there might be a few more upcoming games soon then =)
Give it about a year before mine is ready though lol (just in time for next years comp haha!)
Well i found how to do it.. i just can't do it...well it doesn't work.
going by the book i was testing with the 'bucket' as the book described. seems simple enough, follow the instructions as written down and it doesn't work.
so i tried something else.. the conversation with Daisy test..again following the instructions and nothing happens.. the only difference is with the bucket the game wont load due to a scrip error and with daisy it will load but you still can't talk to her. I'm not sure what I'm getting wrong as I'm doing everything the book tells me.
:egg:
What makes its worse its just the beginning...lol
Well i found how to do it.. i just can't do it...well it doesn't work.
going by the book i was testing with the 'bucket' as the book described. seems simple enough, follow the instructions as written down and it doesn't work.
so i tried something else.. the conversation with Daisy test. the only difference is with the bucket the game wont load due to a scrip error and with daisy it will load but you still can't talk to her.
What makes its worse its just the beginning...lol
This is happening to me as well.
and as you say these are at the beginning
i've also unpaked the healing potion game to compare the script but thats beyond me to.
Here is a good idea on the dizzyage website is a page for video tutorials
maybe the likes of T-F,pteal ,Alex who have made allot of games could do some tutorials on scripts for us beginners.
This may help more beginners made games as i'm up to 3 good idea's
and have done 2 maps but with out the scripts the games will not get finished
I too have my ideas on paper, and mentioned a few of them to TF (although some of them I doubt I'll be doing just because they're a bit crazy lol)
a BIT crazy?!?!? :p
Well i found how to do it.. i just can't do it...well it doesn't work.
going by the book i was testing with the 'bucket' as the book described. seems simple enough, follow the instructions as written down and it doesn't work.
so i tried something else.. the conversation with Daisy test..again following the instructions and nothing happens.. the only difference is with the bucket the game wont load due to a scrip error and with daisy it will load but you still can't talk to her. I'm not sure what I'm getting wrong as I'm doing everything the book tells me.
:egg:
What makes its worse its just the beginning...lol
right, regarding the Bread item, firstly make sure in the map properties for that tile, you have the Draw property set to img+mat, this ensures it draws the image and the material.
second, make the Class property 'item', this ensures the game will try to pick it up if you press enter when standing over it.
thirdly, items you're picking up must have a brush 'type' of 'Dynamic'.
and lastly, you must assign a unique ID property for the item. i normally try to keep all items in sequential order, eg. 1000, 1001, 1002 etc. it can also help to have a list of them in somewhere like notepad, for easy reference when writing the code.
then in the game.gs script file, you need the following bit of code in the function called ObjectsSetNames(), so that it looks something like this:
func ObjectsSetNames()
{
ObjSetName( ObjFind(1000), "LOAF OF BREAD" );
}
there are a few reasons why the script may have returned an error, the most common one being that you may not have put a ; at the end of the line of code. However i think in this instance it's more likely that you haven't changed the brush type of the item to 'Dynamic', so when the game looks to assign a name to object 1000, it's not finding a dynamic object with ID of 1000, because it's still a static brush.
regarding Daisy, i think it's probably the same thing, either you haven't changed the brush type to 'Dynamic' or you haven't set the class to 'Action' (for items that need to be actionable).
Try that and let us know if it still doesn't work.
Also a quick note on brush types. 'Static' brush types are best for background tiles, anything you want to walk on, or anything that you won't ever be moving or actioning in the game. if you'll be moving it (even if in the code) or actioning it, you need to change it to 'Dynamic' type. Dynamic brushes are used for items, coins, moving baddies, or anything you need to action, such as a character or a trigger for a door. If you want a 'blocker' such as a door, you'll need to use a Static type brush.
i hope this helps.
Here is a good idea on the dizzyage website is a page for video tutorials
maybe the likes of T-F,pteal ,Alex who have made allot of games could do some tutorials on scripts for us beginners.
if someone shows me how to record a video of my screen while i'm doing stuff, i may look at doing something like that.
xelanoimis
23-04-08, 09:26 AM
Hello,
Have you checked the articles section on the DizzyAGE website?
http://www.yolkfolk.com/dizzyage/articles.html
As for "trying by the book and didn't worked", you can send me your data folder, and I'll see what's missing. If it's not in the book, I'll add it. Please use my email address from the DizzyAGE website, and attach your data folder compressed as a zip file. I'll post here the results too
As for video tutorials, it would be great if Jamie or someone can come up with some. I even have a page ready for them, on DizzyAGE website, but never got the time to do any.
I'm not sure what is best for capture. Have a look at FRAPS, or do some google research.
http://www.fraps.com/news.php
The movies you can upload on youtube, and I'll post the links on DizzyAGE.
Alex
T-F:
Only a little correction: material property of brush is taken by the engine only at static brushes, so drawing with img+mat at dynamic brushes has no effect, it's the same as img. But it's only taunting :D:D:D
pamuch & Meph:
At dynamic brushes you have to set property ID (unique number) and class (action, item, coin etc.). So set material property to 0 at dynamic brushes, it has no effect. And draw property at dynamic brushes is only 0-none or 1-img (not draw or draw). At static brushes are also taken values 2-map (only material map, not visible) and 3-img+mat (material map and it is visible).
Of course, setting draw property to img+mat at dynamic brushes is the same as only img and setting it to mat is the same as none (it's not visible but still active !).
If you want to have non active and visible dynamic brush, you have to set property class to 0 (and then e.g. after solving some puzzle set it to action again). And if you want to have non active and not visible dynamic brush simply set property disable to 1.
And don't forget to redraw material map after changing material or disable property at static brushes with GameCommand(CMD_REFRESH);
If you want to test collisions at dynamic brushes in the script you have to set collider property to 1-call handler. 2-hard collision is used e.g. for lifts or moving platforms - Dizzy tries to move on the top of the brush, nothing is called. Dynamic collisions aren't pixel perfect (material map at static brushes is pixel perfect).
To set these poperties at dynamic brushes in the script you have to use unique ID of brush from the editor in this way: ObjSet(ObjFind(ID), O_DISABLE, 1); ObjFind returns the internal index of brush in the engine. And for reading of properties: y = ObjGet(ObjFind(ID), O_Y); At static brushes you need to use BrushSet, BrushFind and e.g. B_X. For player properties you need to use: PlayerSet(P_X, 400); Don't mix these functions and properties ! And GS9 script engine is case sensitive !
And a little note: ActionObject callback function has priority over UseObject callback function. When you have both callbacks in the script for the same ID then only ActionObject callback will be called, so you need to call UseObject from the ActionObject in this case !
And how to do action, collision, using of item in the script ? Very simple example with comments is following:
// objects:
// Daisy, ID 1000, type dynamic, collision call handler,
// class action, shader blend, draw img
//
// Some bucket brush, ID 2000, type dynamic, collision none,
// class item, shader opaque, draw img
//
// Some pickaxe brush, ID 3000, type dynamic, collision none,
// class item, shader opaque, draw img
//
// add this to func ObjectsSetNames()
// ObjSetName(ObjFind(2000), "A BUCKET");
// ObjSetName(ObjFind(3000), "A PICKAXE");
// following functions add at the end of game.gs script
//
// function with 1 - first touching Daisy,
// 0 - end of collision, 2 - during collision
func CollideObject_1000_1()
{
idx = ObjFind(1000);
if (ObjGet(idx, O_STATUS) == 0) //only for the first time ?
{
OpenDialogMessage("YOU TOUCHED DAISY");
ObjSet(idx, O_STATUS, 1); //we don't want second touch
return;
}
}
// pressing action button over Daisy
func ActionObject_1000()
{
OpenDialogMessage("YOU PRESSED\nACTION BUTTON\nOVER DAISY");
// now we will open inventory dialog
// and if you select something we will
// call UseObject function
// because ActionObject has priority
// over UseObject
// returns internal engine index
// of an item
itemidx = OpenDialogInventory();
if(itemidx!=-1) // you selected something or not ?
{
UseObject(itemidx);
return;
}
// or you can put code form function UseObject
// direct above return; and don't use UseObject(itemidx) call
}
// you selected an item from inventory dialog
func UseObject_1000(idx)
{
if (idx == ObjFind(2000)) // is it a bucket ?
{
OpenDialogMessage("YOU GAVE\nA BUCKET\nTO DAISY");
InventorySub(idx); // delete item from inventory
}
else
{
OpenDialogMessage("IT'S NOT A BUCKET");
DropObject(idx); // put the item
}
}
I've gotten the Bush sorted out, the ID done and everything..got all that worked out yesterday.
i can pick the item up.. i just can't name it, when i add in that code to the script i just get an error message. the game still loads and i can still pick it up but its just remains unnamed.
Edit: I've just done it :D not sue how i didn't/wasn't doing anything different. but some how its worked.
better experiment.
cheers
Edit 2: the problem was with the ID tags.. they weren't saving correctly... when i add a 2nd item and chage the ID tags all items were change to that ID number...
Edit 3 Woohoo done it.. found what i was doing wrong.. appears i need t change the ID before i place the object down. everytime i changed it with the item in place all the items change. if that makes scence which is proboly why i could get Daisy to talk.. good i've learned something else today.
you can check for duplicate id's in the editor. click on the switch tool icon at the top and then on the orange script debug icon. when you click on check for duplicate id's, it tells you how many there are and they will be flashing on your map.
something that I found very useful
I had a text file open that listed every id I had used, with a short description.
also I use id's in groups
eg
1000 - 1999 characters
3000 - 3999 moving brushes
4000 - 4999 pickup items
5000 - 5999 action brushes
xelanoimis
23-04-08, 02:38 PM
Yes. When opened from the top tool bar, or with the [P] key, the brush properties page refers to the current brush setting. So the brushes you place on the map will keep these properties.
Later, you can adjust properties of an already placed brush, with the right click on it, and by chosing the props dialog from the pull-down menu. This time it's for this brush in particular.
Of course you should NOT set an ID in the current properties dialog (for example 1000) and then place more brushes with this setting. That would result in duplicates IDs there's no way for the game to know which one of them you want access from the script.
yep,cheers got that sorted out.
gave up in the daisy conversation with Denzil that was doing my head in so i'll come back to that.
doing the Dylan thing.. which seems to be doing okay but the object he gives me when i give him his red bucket is already on screen and you have access to it regardless of doing the puzzle or not.
just got in from work thanks to all for your help
will have another go tonight
will let you no how i get on
ounce again thanks
Trying to get theses bats working.
i can get one to move (in a straight line) but when i try adding a 2nd bat in the 2nd room it vanishes and appears in the first room with the other bat and only one will move. :hitwall: the books don't seem to cover theses simple problems and solutions
lol if only i hadn't lost my job i wouldn't have had the time.. i've giving up 5 times today.. :egg:
Check target properties at bat and waypoints and their IDs, also don't forget to set speed (O_USER property) at waypoints. And of course don't forget to call AIUpdateTrain(idx) in UpdateRoom_x_y() callback function. Of course only if you're using this method for moving (AITrain and waypoints). And don't forget to call ObjPresent(idx) when moving from one room to another room (in UpdateRoom callback of every room).
don't know anything about wave points at the moment.
the IDs appear to be fine I'm proboly missing something in the code.
I think the best way how to solve your problem is to show your code or send me PM.
well I'm just using the same one for the first bat but changing the room number. there ins't anything in the books explain.
the 2nd bat appears for a second and then vanishes to the first room. dones't move or anything
Oh i've manged to stop of from changing rooms.. kinda of progress, I'll see if i can get it to move.
Edit: i can get two bats to move in one room, and thats it.. so far
Edit. got a bat to move in a different room, but at the moment it leaves the room..lol but its progress. gotta find a way of keeping it in one room.
after doing alittle test of what i've learned so far i manged to get one bat and one ghost moving proboly in two different rooms and name/pick up an object.. plus i can build the rooms if that counts priding i remember to change the IDs, and brush types lol
right thats a start. as long as i learn something every day I'll be a happy chappy.
now time to practic on a puzzle!
EDIT :v2_dizzy_yahoo: done it.. problem i didn't change the coordinates in the script file.. didn't know i had to until after some experimenting
Something else.
been trying theses wave points and things.. getting rocks or ran drops to fall.
now i can get them to fall but thats it.. they fall once and of course are still on the floor if you leave the room and come back.. how do i get them to keep falling?
cheers
you don't want to use waypoints for those
create your brush - set as
dynamic
collider to call handler
class to hurt or kill
in you game script add -
func UpdateRoom_*_*()
{
WaterDrip1(ObjFind(****));
}
func WaterDrip1(idx)
{
y1=ObjGet(idx,O_Y);
y1+=1;
if(y1>****) y1 = **** - gs_rand(1);
ObjSet(idx,O_Y,y1);
}
replace the * with your info
increase the WaterDrip* when you add a new one
y1+=1 increase this for speed
y1>**** will be the lowest co'ordinate the drip reaches
y1 = **** drip respawn co'ordinate
gs_rand(*) to randomize respawn within the 2
you can make your own func for rocks like -
RockDrop*()
BoulderDrop*()
Cheers.
I'll give that a try tomorrow.. when I'm not so tired.
I was getting sick of theses wave points.. i did it once and couldn't get a 2nd to work if i can do without them I'll be happy.
:dizzy_cool:
xelanoimis
24-04-08, 09:10 PM
Thanks for helping on the thread Colin!
One mention:
gs_rand(1) is always 0
You might wanted to write gs_rand(*), so he can replace the * with a greater value.
It also helps if the randomized position of the bolder or drop starts out of the screen (above) or behind some other brushes.
Appreciate the help.
i just hope I'm able to achieve something after all this.. But my gear got delivered today so I'll be filming/working on a commercial tomorrow .. looking forward to doing something i know about.
:D
I still can't get that drop to fall.
pasted in that code, changed the room number, Id and coordinates according and nothing... either i get an error message or i don't and the drop or in my case the apple doesn't move.
:dizzy_confused:
feel really stupid to be honest.
Woo worked.. not sure why i didn't the first time... odd.
CHEERS.
doesn't seem to work in a 2nd room, LOL
whats annoying is one minute things will load but the drop dones't move.. and the next nothing loads and i just get error messages.. seems every time i try to edit or fix some like a number it buggers but and wont go back... feels far to sensitive.
EDIT.. panic over the found the problem.. the 2nd room i tried it in had a bat.. its seems i can't have two nasties on one room.. it works fine in a unoccupied room.. not that i would want to place to baddies on one room anyway but now i know i can't do that anyway... at the moment I'm just testing and seeing if i can get things to work so I'm just putting/trying everyone in 2 rooms..lol anyway.. point being i learned something.
Which means even if i can't crack the puzzles and texts i can still make a game of some sorts.. just be a deadly maze kinda stuff and collecting coins..lol more a action game and puzzles.
but I'll see how i get on with the puzzles/using objects and so on..
Fantastic.
Have to excuse my ramblings and constant edits and updates.. sometimes it help just to writing things down and talk to myself. out of fustrachion..lol kinda a prosess/therapy stuff. :P
Thanks for the help. (until next time.. see ya soon)
lol
xelanoimis
25-04-08, 05:39 PM
Don't worry about ramblings, Meph. That's why this forum is for :)
Now, try to pay closer attention to the text in the book.
It may not be too comprehensive, but it does point a few things that are necessary, so every word might count.
Try to understand each example well, before you move to the next one.
Most important, try to realize why it doesn't work at first, and why it works later. Check what you did to make it work, and if you don't understand why it works, search the books about it, or ask here.
It might be slow and require some effort at first, but then you'll get the hang of it, and spot the problems immediately.
------
Of course you can have more baddies in the same room. They just must have different IDs, and you should do the update code fore each of them.
The UpdateRoom_RX_RY() callback is called only in the RX,RY room. If you want to have an object moving between two rooms, you must update it in both rooms, meaning to place it's move code (usually you call a function), in the two corresponding UpdateRoom_RX_RY() functions. And the required ObjPresent call, to instruct the game, that that object can be moved into the room, after the player entered it.
The error messages you get when you run the game, they are your "friends". They tell you the line where the script has a problem. Try to understand what they say, and why the script crashes there. You might need to check in the GS9 Book for details, but the effort pays nice later.
Most of the errors you get from the script, you can fix in an instant, if you know where to look for. For example you search for an object, using a bad ID. The ObjFind will return -1. Trying this index later on an object function, like ObjSet, will report an error of a bad index. So you can check the code there and realize it's the bad ID in the ObjFind call, that generated this bad index. You get the idea.
If you feel like you need to learn more on the programming side, you can try simple programs in the console provided with the GS9 Book. You can't use there functions that are specific to DizzyAGE. Only the basics of the GS9 language.
I'm sure you'll manage to add nice puzzles to your game. The idea is not to have a lot of complex ones, but to tune them, to have them in the right context, for your game.
So good luck with it!
P.S. I liked your stop-motion movies, from your website. Reminds me of the Neverhood game, a nice quest made with this clay technique.
http://en.wikipedia.org/wiki/The_Neverhood
I still haven't found the time to finish it :(.
sounds to me like you might be calling an UpdateRoom_RX_RY()
for the same room more than once
meaning you have set one up to control a bat
and then one to control a water drop, or a rock drop
you need to combine them into one
example:-
func UpdateRoom_RX_RY()
{
WaterDrip1(ObjFind(id#1));
RockDrop1(ObjFind(id#2));
AIUpdateSpider(ObjFind(id#3));
AIUpdateChainLink(ObjFind(id#4));
AIUpdateTrain(ObjFind(id#5));
}
func WaterDrip1(idx)
{
y1=ObjGet(idx,O_Y);
y1+=1;
if(y1>****) y1 = **** - gs_rand(*);
ObjSet(idx,O_Y,y1);
}
func RockDrop1(idx)
{
y1=ObjGet(idx,O_Y);
y1+=1;
if(y1>****) y1 = **** - gs_rand(*);
ObjSet(idx,O_Y,y1);
}
Colin i think thats the reason why. cheers.
I'll have alittle experiment and see.
I'm getting used to the basic script error messages...and fixing them, normally its something simple like a } in the wrong place.. other times its like what Colin was saying and i was calling the same room more than once. but im getting more and more able to see them and fix them, don't know how to fix things if you don't make mistakes.
While things may be quite simple once you know how its just finding how and were to look, i've read the map and the dizzyage book which were both useful but this G29 is rather heavy.
and theses no good in just reading the thing.. i like to learn one thing at a time.. (today was those drops, the other day it was moving bats)
for example. theres no chapter showing you how to use an pic to break past rocks, much like doing those drops. but I'm hoping I'll be able to work that out with the info and stuff i've collected from theses books and the info thats in the script folders, even checking out that mushroom pie one. But those drops were a pain hence i was doing with with wavepoints to start with..lol
I'll get there if i stick at it, i've spend to much time and lost to much hair to give up, plus i want to see my ideas complete. But to be fair I'm not a computer language kinda chap..and most of my learning comes from doing and trial and error.. lol just like those animations. I'm far more practical than technical i guess.. :P
there is something thats got me puzzled with the messages/dialog commands but i want to see if i can work that out first.
Oh by the way if and when (hopefully when) i crack the dizzyage code the game in question I'm naming 'Scrambled egg dizzy' I'm bring this up so you all know that title is booked! hehehe
Cheers
for example. theres no chapter showing you how to use an pic to break past rocks, much like doing those drops. but I'm hoping I'll be able to work that out with the info and stuff i've collected from theses books and the info thats in the script folders, even checking out that mushroom pie one.
Meph, you do it the same way you'd open a door. it simply boils down to 'use item to get past blockage'
Oh by the way if and when (hopefully when) i crack the dizzyage code the game in question I'm naming 'Scrambled egg dizzy' I'm bring this up so you all know that title is booked! hehehe
Mish, that title is taken y'hear?!?! haha
i haven't done doors yet... lol im getting to it.
well i've got dizzy to tell me this brick it pretty solid and a hammer would knock it down. :v2_dizzy_clapping:
However he keeps saying it every time you action it.
i been trying to advance the talk status to either the inventory opens or your just ignored but haven't been able to do it yet.. am i approaching this the correct way? probably not.. lol
oh and that thing i was slightly puzzled with the messages i've worked out.. well i found that in the book :P thank god it wasn't anything serious
EDIT: done.. used that disable command..
time to write down some notes and see if i can knock the bugger down...
try modifying this to suit your needs
func ActionObject_*id1*()
{
idx = ObjFind(*id1*);
if(ObjGet(idx,O_STATUS)==1)
{
idx = OpenDialogInventory();
if(idx!=-1) UseObject(idx);
return;
}
idx = ObjFind(*id1*);
if(ObjGet(idx,O_STATUS)==0)
{
your initial messages go here and any brush/object switches
go in here
idx = ObjFind(*id1*);
ObjSet(idx,O_STATUS,1);
}
}
func UseObject_*id1*( idx )
{
if(ObjGet(idx,O_ID)==*id2*)
{
put your messages and brush/object switches
in here for when the right item is used
return;
}
else
{
put a doesn't work message or put
DropObject(idx);
}
}
*id1* is your action brush ID
*id2* is the item ID that correctly activates it
don't forget to disable *id1* once it's used
So here when STATUS=0 the initial message shows
then turns the STATUS=1 so you can either use an item on it or drop it
colin, try enclosing code in [ CODE ] tags, so that it looks like this:
some code
some more code
colin, try enclosing code in [ CODE ] tags, so that it looks like this:
some code
some more code
thanks for the advice. i've edited it:tup:
i've managed to get dozy to ask for an item, take it and give me another :v2_dizzy_clapping: i tried that a while go and i couldn't get it to work but i've found what i was doing wrong.. pretty simple/obvious in the end.
not having much luck with this knocking the wall down at the moment he just drops the object in front it of it.. but i;e gotten him to examine it and say something.
i'll keep at it.
the trick is to use the status of the object trigger to do different things.
for example:
if status=0 then examine it, and set status to 1
if status=1 then open the inventory to use an item
if item used is the correct one, then do *whatever*
you can then set the status to 2, ready for if you need to do something else there. alternatively just disable the trigger.
i've got it to half work.. without useing an item..lol
Its a start :D
oh the door puzzle in the book, the link to the solutions dones't work.. just shows you the spider one. not that i was cheating. ;)
heres how to do a 'blocker' puzzle.
in the map, make:
a 'blocker' object with type=static, id=2001, and draw=img+mat
a 'trigger' object just in front of the blocker, (used to trigger the code), with type=dynamic, id=2000, draw=mat, disable=no, class=action, status=0
an 'item' object, with type=dynamic, id=1000, draw=img+mat, disable=no, class=item
in game.gs, put the following code:
/////////////////////////////
//Door
/////////////////////////////
func ActionObject_2000()
{
idx = ObjFind(2000);
if(ObjGet(idx,O_STATUS)==5)
{
idx = OpenDialogInventory();
if(idx!=-1) UseObject(idx);
return;
}
idx = ObjFind(2000);
if(ObjGet(idx,O_STATUS)==0)
{
Message0(5,4,"YOU RATTLE\nTHE DOOR.");
Message0(6,5,"BUT IT'S LOCKED.");
MessagePop();
ObjSet(idx,O_STATUS,5);
}
}
func UseObject_2000( idx )
{
if(ObjGet(idx,O_ID)==1000)
{
Message0(5,4,"YOU TURN THE\nKEY IN THE LOCK");
Message0(6,5,"AND THE DOOR\nCREAKS OPEN...");
MessagePop();
InventorySub(idx);
idx = BrushFind(2001);
BrushSet(idx,B_DRAW,0);
idx = ObjFind(2000);
ObjSet(idx,O_DISABLE,1);
GameCommand(CMD_REFRESH);
return;
}
else
{
DropObject(idx);
}
}
and that will work. just ask if you want to know the details of how it works, but hopefully you can disect it and work out what bit does what for yourself.
Thanks,
Yeah i can see how it work, I'm getting familiar with what all the codes mean.. while i can't always remember how to type them out off the top of my head i know what they do when i see them now.
can't see what i was doing wrong just by looking at it, something must be in the wrong place. I got the action correct with out and text but i can see i was putting that in the wrong place.. but i couldn't get an item to make the action happen, error message didn't seem to like the func UseObject command.
anyway I'll see if i can find what i was doing wrong.
Cheers.
i can't always remember how to type them out off the top of my head
hahaha i NEVER type those kind of 'standard' commands off the top of my head, i normally just copy+paste them from elsewhere in the code (or from another of my games) and change them around a bit to suit the situation.
as i always copy+paste them, i really wouldn't be able to write them out off the top of my head!
bit of code i was mission
in the action object, might have been another little bit but that was the main thing i noticed.
idx = OpenDialogInventory();
if(idx!=-1) UseObject(idx);
return;
still took me an hour to fix things. turns out i was also trying to code something into the script that didn't want coding.. adding an extra ID object.. it was just something i somehow got working the first time and thought i had to do the same here.. turns out i didn't need to write it in to make it happen.. LOL Anyway.. i got mixed because i have so many scribbles written down and number reminding me what the scribbles mean.. and crap. should have just wiped it all and started fresh.
Got one more/last question i think
how do i change Dizzys start location?
i''ll be a bit bugged if i can do it..
once i got Dizzy in the right place.. i just need to add some baddies, collectibles and a few other bits and bobs.. but so fair all puzzles/items and map are in place..and things seem to be working a treat, Just have to make sure Dizzy and get to everywere with out getting stuck and all that i think I've fixed those points now.
and then just polish it up.
Its pretty simple but its a start i guess :D playable. (or will be)
Thanks.
Look in the gamedef.gs file. There are lots of things here that you can change. Just read the comments.
The lines you want are
#def PLAYER_BEGINX 640
#def PLAYER_BEGINY 246
yeah i read that, but wouldn't just change the position in the room he already starts in? (the default/template room)
thats what i wasn't sure about... i want to start him in a completely different room.
EDIT: oh bugger.. sorry me being a bit stupid.. i've done it now. thanks.
i should have just tried it first.. hell its late i've been doing this since 4pm lol
Cheers
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.