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

#1
Um, yeah i'll have to get the code i wrote, its not on this pc
Im not trying to spawn the player character, I do however have a lot more variabes in the function than in the example I got on top. Infact its a struct array thing in a script module
so its kinda like this

int spawnnpc(int npc, int view, int health, string name,int xpos, int ypos)
{
npc[npc].health = health;
npc[npc].name = name;

charachter[npc].changeview(view);
character[npc].changeroom(player.room, xpos,ypos)
}

but there is a lot mor variables, ill have to paste the code I guess cuz its got a lot more variables...
What happens is that the game seems to get stuck before the fade in, as if it was paused with no error message. it works fine when I take out the changeroom bit

also:
even the npc.name string ends up messed up and not what I define in the function.
I did not export the struct, only the spawnnpc function. It still compiles though

#2
hi there
Im trying to make a function that I can call from a room script to spawn a npc character.
In a script module i have something that looks like this:


int spawnnpc(int npc, int  view, int xpos, int ypos )
{

character[npc].changeview(view);
character[npc].changeroom(player.room, xpos, ypos);
}

Then:

I call this function in the "before fade in" section
It works fine up till the changeroom command; it seems to get stuck there.
Are you not allowed to use that command in a function? It works when I call the changeroom function seperately, which defeats the object of having a spawnnpc function.
#3
640 x 480 16bit
Not really an Adventure Game but very addictive.
Nova Trade is a futuristic commodity trading game. You are put in charge of a Trading station that floats around in space. The aim is to make money and keep your popularity up. The higher your popularity the more customers you have and the more money you make. You have to buy stock from one of the dealers or from the black market and then trade with your customers. You will also be able to add a food court to your station where aliens can come and spend their money. There is also the constant threat of giant space pirates that want to destroy the station and it is your job to take them out. - There is a lot more to it but it is still in production.


- graphics 45%
- scripting 65%
- music/sound 50%

Screen Shots:


The Station, the little space ships land on the station's parking bay when you have a customer.

the food court... it is far from complete, the more customers you have , the more aliens will be in the room

the "Dealers" and "Customers" windows.. this is where you buy stock and sell it to the customers.

giant space pirate, you will have a number of ways to defend the station agains it.

There is a cool Scroling Starfield background that you cant see on the screenshots.
Still a lot of work to do on the graphics. And the gui will look a bit different when it is done.
Some better screen shots comming later.
Thanx Akatosh :)
#4
Thanks, I got it now, You guys should be in every major city! :)

NOTE: You cannot currently import string variables.

Just a pity I can't import and export my own strings that are in a struct yet... maybe they could add that in future.
#5
Lo
I am a bit of a newbie at this...
I recently discovered how to use structs and I think they are the coolest things since sliced bread. The problem is that I cant figure out how to export and import them cuz the manual only deals with importing a single variable.
Say I did this in the Global script or i a Module:

struct product {
  int price;
  int sellprice;
}

product beer;
beer.price = 40
beer.sellprice = 60

1. How do I export it?
export beer;  ?

2.Now if I want to access this from any script how do I import it cuz..
import int beer;  - does not work
import int beer.price; - does not work

I would like to be able do do something like this in any room script:

Display(" We are trading Beer for %d credits and you can sell it for %d 
               credits",beer.price, beer.sellprice);
Thanks

#6
This kinda looks ok:
script for Room: Player enters room (after fadein)
 
SetTimer(1,50);

script for Room: Repeatedly execute
 

if (IsTimerExpired(1)==1)
{
PlaySound(1);       //Sound1.wav must be the thundersound
RawSaveScreen();    // Save the current screen in memory
RawClearScreen(15); // Makes the background White
Wait(10);           // Pauses the game so that you can see
RawRestoreScreen(); // Brings back the original background
ShakeScreenBackground(4, 4, 5); // Shakes the screen
SetTimer(1, Random(200));    // resets the timer
}

The other option is to put RawDrawImage(0,0,6);  instead of the RawClearScreen(15) function, where the 6 is the image slot of a background image the same as the rooms one accept for some cool lightning stuff drawn unto it.


#7
Yeah you can do it
I dont have my manual here so I dont know the code off hand.
But what I would do is:
Make a timer when the room starts
Settimer(1,50);

then in the repeately execute section I would say this:

If (Istimerexpired(1) ==1)
{
1. play sound  --  thunder sound
2. rawdraw save screen    --- see manual under Room section
3.rawdrawimage or colour to make the lightning effect  see manual under Room section
4. wait(1)  ---Wait a short time for the people to see the effect
5. Shakescreen -- see manual under SREEN
6. rawdraw restore screen --- Lightning Flash stops
7. C.player.Move() --- make the player move back
8. Settimer(1,50) -- Reset the timer
}

If you dont know what I mean then I will paste for you the exact code from the manual. But im pretty sure this sould give you the right effect!

#8
Thanks dude, your a LEGEND!
#9
Hi
I am currently working on a game where the player will have guns and be able to shoot at oponents. My battle system works great, I use objects for bullets:
The objects move to from the player to the mouse curser:

if (mouse click thing)
{
object[0].setposition(player.x,player.y);
object[0].move(mouse.x,mouse.y,......);
}

it works great but the problem I have is that in a scrolling room the mouse coordinates only stays in the 320 x 240 section of my room, so if the character is outside of this area the objects move back to that section of the room.
Is thier anyway to make the objects move to the cursor if the cursor is outside of the 320 x 240 screen coords?
#10
Yeah thats a good idea Stupot, I did this:

int bulletnumber = 0;

if (bulletnumber >5)
{ buletnumber = 0;}


if ((IsKeyPressed(32) ==1) && (IsTimerExpired(1)==1))
{
object[bulletnumber].Move(mouse.x, mouse.y, 15, eNoBlock, eAnywhere);
SetTimer(1, 5);
bulletnumber++; }
}

so now the first 6 object in the room are your bullets, its cool, it looks like a machine gun firing hehe.
but I wish I did not have to waste objects like that since you only get 20 in a room :(
#11
HI
I am working on a death match arena style game where you fight against enemys with a number of different guns and items from your inventory.
Everything works perfectly and im later gonna turn it into a whole adventure game.

I am currently using objects as the bullets/rockets, this works nicely with a
object.move(player.x, player.y+100, 15, noeblock) kinda thing
The problem is that this limits me to only 1 bullet at a time since the object gets reused everytime the player shoots.

My question:
Is there a way to do the same thing with maybe dynamic sprites or overlays?
I cant find any way to move the sprites across the screen once I draw them.
And..
If this is possible, how would I apply it to the
(AreThingsOverlapping(1004, cEnemy) line for collisions? (since it only works for characters and objects)
Thanks
#12
Hi
I am working on a game that only works with the keybored, so i am going to disable the mouse completely. I was wondering if there is a way that I could control dialog options with the keybored for example if you want to choose dialog option1 you can press 1 or maybe even have it scroll between options when you press the arrow keys. Is this at all possible and how would I do it?
Do i need a plugin for it?
SMF spam blocked by CleanTalk