• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Alan_Smithee new guns

Jack Rackham

ex train dispatcher
Quest Writer
Storm Modder
I really like the idea of multiple guns and have not yet seen them in the game. But in init_items there are the same values for min, max, acc and rechargetime. Why is that?
 
Perhaps they´re not balanced out yet <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
 
I have been thinking about time bombs; I'd post this in a SWAK thread but couldn't be bothered to look for one of the old things to `re-raise` it. Anyway, I know large lengths of time can be set, with a consequence afterward - generally a month at a time for some quests. But what about tiny amounts of time, minutes or even seconds? This'd create `timebomb-style` SWAK weapons, like a grenade with a fuse, so you could lob it or set it down and run away and not get killed instantly along with everyone else.

I'm also ruminating on a quest where you'd have to plant a series of time bombs, and I think it'd be awesome if there'd be Dire Consequences for not getting out of the way in time... this sort of thing could also be used in big random mazes, like Incan or dungeon, where you'd have to rush through perhaps without killing everyone or getting all the treasure available. Would be a unique challenge.
 
<!--`QuoteBegin-alan_smithee`+--><div class='quotetop'>QUOTE(alan_smithee)</div><div class='quotemain'><!--QuoteEBegin-->Oh by the way, CCC, were you serious about your `monkey-bomb`? I really wanna see that.[/quote]
As serious as you can be about a monkey bomb <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" /> (and let's call it monkey BAIT to keep up the appearance of realism <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" /> )
I think I'll reduce my forum time somewhat to allocate the time to all the open modprojects that I have already announced <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/hi.gif" style="vertical-align:middle" emoid=":gday" border="0" alt="hi.gif" />

For time code look at the SWAK code in LAI_poor.c It has a timer that revives the stunned people after about two minutes.
 
Oh, I could be `dead-serious` about a monkey bomb...

Thanks for the tip. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="onya.gif" />
 
You can call a function after a delay by setting an event handler and then using a postevent() call.
Or you can trigger a quest after a delay with LAI_QuestDelay().
For an example of how to use the latter, check the Town Economies thread (at the end).
For the former (though this may be in the POTC C thread):
PostEvent and SendMessage:
because those two are functions /themselves/, which take as a string the function name to call, they can't pass arguments directly to the function; instead, they do like this:
PostEvent(string eventname, string params, Extra_Params_here)
where eventname is defined elsewhere by setevenhandler* to point to a function.
Then, in the function body, it uses GetEventData() to find the data.
*or by #event_handler() in the preprocessor block.

params is a string, detailing the parameters to expect. It is in the form "llsssf" or some such, where:
l = message_number or regular int
s = string
f = float
i = attribute reference
e = entity (aka object)
Example:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->SetEventHandler("print", "PrintNumTimes");

void PrintNumTimes()

{

  int numtimes = GetEventData();

  string printstr = GetEventData();

  for(int i = 0; i < numtimes; i++) Log_SetStringToLog(i + " " + printstr);

}

//then, in some function:

    PostEvent("print", 100, "ls", 5, "Hello World");<!--c2--></div><!--ec2-->

This will, after a delay of 100 milliseconds, print Hello World to the log five times.
 
And suppose if I wanted, after a minute or so, to call several bombs exploding at once in certain places, possibly ripping the character to shreds if he don't get out of the way?
 
Probably best to make it a quest case then.
Add bomb attributes to the location.
Add a line in locations_loader that, if it sees the bomb attribute, sets an LAi_QuestDelay() with the specified time delay.
In the quest case, check the location for bomb attributes, and, if they exist, loop through (using a for loop and GetAttribute calls) and explode all the bombs there.
You can be more complex if you like, with separate quest cases so that you can have differently timed explosions.

(Using CCC's handy Explosion function to do the actual explosions...)
 
Back
Top