About random scripts?

This forum is meant for posting anything related to Adventure Maker that doesn't fit in the other forums.Please post technical questions in the Technical Support Forum!

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

About random scripts?

Postby ZeornWarlock » Sun Dec 23, 2007 4:27 am

Hi there,

I am not a pro scripter, I learn as I test things. However, I have been scripting with Bioware's aurora engine for a few years with their NWN game editor. AM is a bit different although they share some similarities and looks easy. I do not have the full version yet and I would like to know if some random scripts were created and posted for AM yet?

Random scripts similar to the one I did with the Aurora engine. See below?

////////////////////////////////////////////////////////////////////////////////////
//ZeornWarlock
//Part of random weapon generation script?

int nint = d6(1);

if(nint==1)
{
CreateItemOnObject("nw_wpltr001",OBJECT_SELF);//Trident
SetLocalInt(OBJECT_SELF,"WEAPON_TREASURE1",1);
}

else if (nint==2)
{
CreateItemOnObject("nw_wswsc001",OBJECT_SELF); //Scimitar
SetLocalInt(OBJECT_SELF,"WEAPON_TREASURE1",1);
}

else if (nint==3)
{
CreateItemOnObject("nw_wspku001",OBJECT_SELF); //Kukri
SetLocalInt(OBJECT_SELF,"WEAPON_TREASURE1",1);
}

else if (nint==4)
{
CreateItemOnObject("zep_falchion",OBJECT_SELF); //Falchion
SetLocalInt(OBJECT_SELF,"WEAPON_TREASURE1",1);
}

else if (nint==5)
{
CreateItemOnObject("zep_xdbsc_001",OBJECT_SELF); //Double Scimitar
SetLocalInt(OBJECT_SELF,"WEAPON_TREASURE1",1);
}

else if (nint==6)
{
CreateItemOnObject("zep_katar",OBJECT_SELF); //Katar
SetLocalInt(OBJECT_SELF,"WEAPON_TREASURE1",1);
}

/////////////////////////////////////////////////////////////////////////////////////

I am looking for scripts dealing with random events or effects. In my example above I would like to create an AM random item given to the Player, how would I do that?

Thanks. :)

ZW.
User avatar
ZeornWarlock
Expert Member
 
Posts: 347
Joined: Tue Jun 05, 2007 12:52 am
Location: In front of the monitor.

Postby Candle » Sun Dec 23, 2007 12:40 pm

Please don't PM me questions, ask here in the forums!
``````````````
Between grand theft and a legal fee, there only stands a law degree.
User avatar
Candle
Administrator
 
Posts: 3077
Joined: Sat Feb 07, 2004 2:21 am
Location: Rudy's Bar

Postby ZeornWarlock » Sun Dec 23, 2007 11:21 pm

Thanks, Candle. :)

By the way, i is for interger and RND * 4 for random four I guess. However, what does the +1 stand for? Maybe to avoid a 0 number?

randomize
i = int( RND * 4 ) + 1
If i = 1 then PlaySound GetPath(2) + "voice1.mp3", False
If i = 2 then PlaySound GetPath(2) + "voice2.mp3", False
If i = 3 then PlaySound GetPath(2) + "voice3.mp3", False
If i = 4 then PlaySound GetPath(2) + "voice4.mp3", False

Oh and if I wanted to make a random inventory object instead of a mp3, do I just type in its name or its ref. or both?

ZW.
User avatar
ZeornWarlock
Expert Member
 
Posts: 347
Joined: Tue Jun 05, 2007 12:52 am
Location: In front of the monitor.

Postby Mystery » Sun Dec 23, 2007 11:59 pm

I assume it's for avoiding zero.

Would you like to add a random item to the player's inventory?
If so, you can create those items using the Manage Inventory Frame, and then just use
Action.AddItem "Item_Name"
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby ZeornWarlock » Mon Dec 24, 2007 4:25 am

Mystery,

Yes that is what I wanted try via scripts. However, I just "searched" a bit more around the forums and I found the main page on VB scripting for AM. A lot did answer questions I was about to ask! :P

I am trying to figure out most of AM?s possibilities and limits as I have a few projects in mind, which I want to go commercial with. I just want to make sure AM can answer most of my call.

However, I have tried many game makers/editors and so far AM really kick their butts literally. My only problem with AM so far is its conversation wizard and the fact that we cannot create animated backgrounds. (For panoramic view) On static 2d scenes, animated gifs in hotspots works best for sure. :lol:

I did send an example of a powerful conversation editor from another game to GM-Support, so maybe he will consider including a similar one in the future. Crossing fingers. :twisted:

As for animated backgrounds, that would really help the panoramic feature. Animated hotspots on a pano view are bad right now, however I have seen that problem in most of Ubisoft?s CSI games. Therefore, I am not sure GM-Support could fix that. I think animations and pano. view do not work well together, period. :?

ZW.
User avatar
ZeornWarlock
Expert Member
 
Posts: 347
Joined: Tue Jun 05, 2007 12:52 am
Location: In front of the monitor.


Return to Adventure Maker General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests